From 06ca31eecb075dd59c6023021022f3faa913cd22 Mon Sep 17 00:00:00 2001 From: abdussamedulutas Date: Wed, 17 Jun 2026 12:28:37 +0300 Subject: [PATCH] =?UTF-8?q?Eski=20Node.js=20/=20TypeScript=20yap=C4=B1=20d?= =?UTF-8?q?osyalar=C4=B1=20temizlendi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Silinen dizinler: - Source/ — Node.js engine (Go engine tarafından ikame edildi) - frontend/ — TypeScript SDK kaynağı (sdk/ ES modülleri ile değiştirildi) - script/ — Parcel bundle çıktısı (artık yok; /sdk/ route'u devrede) Silinen kök dosyalar: - index.js — Node.js giriş noktası (Source/index.js'e refer ediyordu) - package.json / package-lock.json — Parcel/TypeScript build araçları - tsconfig.json — TypeScript derleyici ayarları Taşınan: - script/status.xml → public/status.xml (httpserver fallback olarak kullanıyor) Güncelleme: - httpserver.go : /script/* route'u kaldırıldı; / artık /sdk/index.js'e yönlendiriyor - config.go : ScriptDir alanı ve MWSE_SCRIPT_DIR env değişkeni kaldırıldı - contract_test : ScriptDir → SDKDir - .gitignore : Node/Parcel artıkları için temizlendi ve kısaltıldı go test -race ./... yeşil Co-Authored-By: Claude Sonnet 4.6 --- .gitignore | 148 +- Source/Client.js | 213 -- Source/EventEmitter.js | 62 - Source/HTTPServer.js | 43 - Source/MessageRouter.js | 54 - Source/Services/Auth.js | 175 -- Source/Services/DataTransfer.js | 101 - Source/Services/IPPressure.js | 269 -- Source/Services/Room.js | 549 ---- Source/Services/Session.js | 43 - Source/Services/YourID.js | 7 - Source/WebSocket.js | 94 - Source/api.js | 235 -- Source/config.js | 1 - Source/index.js | 26 - frontend/Connection.ts | 136 - frontend/EventPool.ts | 68 - frontend/EventTarget.ts | 32 - frontend/IPPressure.ts | 198 -- frontend/P2PFileSender.ts | 262 -- frontend/Peer.ts | 237 -- frontend/PeerInfo.ts | 48 - frontend/Room.ts | 182 -- frontend/RoomInfo.ts | 52 - frontend/WSTSProtocol.ts | 66 - frontend/WebRTC.ts | 522 ---- frontend/index.ts | 238 -- index.js | 14 - internal/config/config.go | 11 +- internal/httpserver/contract_test.go | 2 +- internal/httpserver/httpserver.go | 37 +- package-lock.json | 3824 -------------------------- package.json | 61 - {script => public}/status.xml | 0 script/index.js | 1672 ----------- script/index.js.map | 1 - tsconfig.json | 107 - 37 files changed, 34 insertions(+), 9756 deletions(-) delete mode 100644 Source/Client.js delete mode 100644 Source/EventEmitter.js delete mode 100644 Source/HTTPServer.js delete mode 100644 Source/MessageRouter.js delete mode 100644 Source/Services/Auth.js delete mode 100644 Source/Services/DataTransfer.js delete mode 100644 Source/Services/IPPressure.js delete mode 100644 Source/Services/Room.js delete mode 100644 Source/Services/Session.js delete mode 100644 Source/Services/YourID.js delete mode 100644 Source/WebSocket.js delete mode 100644 Source/api.js delete mode 100644 Source/config.js delete mode 100644 Source/index.js delete mode 100644 frontend/Connection.ts delete mode 100644 frontend/EventPool.ts delete mode 100644 frontend/EventTarget.ts delete mode 100644 frontend/IPPressure.ts delete mode 100644 frontend/P2PFileSender.ts delete mode 100644 frontend/Peer.ts delete mode 100644 frontend/PeerInfo.ts delete mode 100644 frontend/Room.ts delete mode 100644 frontend/RoomInfo.ts delete mode 100644 frontend/WSTSProtocol.ts delete mode 100644 frontend/WebRTC.ts delete mode 100644 frontend/index.ts delete mode 100644 index.js delete mode 100644 package-lock.json delete mode 100644 package.json rename {script => public}/status.xml (100%) delete mode 100644 script/index.js delete mode 100644 script/index.js.map delete mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 17adc80..f558bf9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,147 +1,31 @@ -# ---> Gitea CLI kimlik bilgisi (ASLA commit etme) +# Gitea CLI credentials — never commit .gitea-auth.json -# ---> Go (engine rewrite) +# Go build outputs /mwse /mwse-engine -/mwse-loadtest -loadtest/mwse-loadtest *.out *.test go.work go.work.sum +loadtest/mwse-loadtest -# ---> Node -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-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 stays on disk (gitignored) so npm tools still work if needed, +# but nothing in the repo should require them anymore. node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache +package-lock.json +.parcel-cache/ *.tsbuildinfo -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# 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 variable files +# Environment / secrets .env -.env.development.local -.env.test.local -.env.production.local -.env.local +.env.* +!.env.example -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache +# Editor / OS +.DS_Store +.vscode/ +.idea/ +*.swp -# Next.js build output -.next -out - -# 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 - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* - -.well-known -.well-known/* \ No newline at end of file +.well-known/ diff --git a/Source/Client.js b/Source/Client.js deleted file mode 100644 index 1b6d08c..0000000 --- a/Source/Client.js +++ /dev/null @@ -1,213 +0,0 @@ -function Client() -{ - /** - * @type {string} - */ - this.id = null; - /** - * @type {import("websocket").connection} - */ - this.socket = null; - /** - * @type {Date} - */ - this.created_at = null; - - /** - * @type {Map} - */ - this.info = new Map(); - /** - * @type {Map} - */ - this.store = new Map(); - /** - * @type {Set} - */ - this.rooms = new Set(); - /** - * @type {Set} - */ - this.pairs = new Set(); - this.requiredPair = false; - - this.APNumber = 0; - this.APShortCode = 0; - this.APIPAddress = 0; -}; -/** - * @type {Map} - */ -Client.clients = new Map(); - -/** - * @param {Client} client - */ -Client.prototype.peerRequest = function(client){ - let info = {}; - this.info.forEach((value, name) => info[name] = value); - this.pairs.add(client.id); - client.send([ - { from: this.id }, - 'request/pair' - ]); -}; - -Client.prototype.match = function(filterObject){ - let keys = Object.keys(filterObject); - let size = keys.length; - if(size > this.info.size) - { - return false - } - for (const key of keys) - { - if(this.info.has(key)) - { - if(this.info.get(key) != filterObject[key]) - { - return false - } - }else{ - return false - } - }; - return true -}; - -/** - * @param {Client|string} client - */ -Client.prototype.isSecure = function(client) -{ - const { Room } = require("./Services/Room"); - if(typeof client == "string") - { - if(Client.clients.has(client)) - { - client = Client.clients.get(client); - }else return false; - }else if(!(client instanceof Client)){ - console.error("isSecure Client bir client veri tipinde değil") - return false; - }; - - // Eşleştirilmiş kullanıcı - if(this.isPaired(client)) - { - return true; - } - - // Aynı odada bulunan kullanıcı - for (const id of this.rooms) { - let room = Room.rooms.get(id); - if(room) - { - if(room.clients.has(id)) - { - return true - } - } - }; - return false; -} -/** - * @returns {{pairs:Map,roompairs:Map,intersection:Map}} - */ -Client.prototype.getSucureClients = function() -{ - const { Room } = require("./Services/Room"); - let pairs = new Map(); - let roompairs = new Map(); - - for (const id of this.pairs) - { - pairs.set(id, Client.clients.get(id)) - } - - // Aynı odada bulunan kullanıcı - for (const id of this.rooms) { - let room = Room.rooms.get(id); - if(room) - { - for (const [id, client] of room.clients) - { - if(id == this.id) continue; - roompairs.set(id, client) - }; - } - }; - return { - pairs, - roompairs, - intersection : new Map([ - ...pairs, - ...roompairs - ]) - }; -} - -/** - * @param {Client} client - */ - Client.prototype.acceptPeerRequest = function(client){ - this.pairs.add(client.id); - client.send([{ - from: this.id - },'accepted/pair']); -}; -/** - * @param {Client} client - */ -Client.prototype.rejectPeerRequest = function(client){ - this.pairs.delete(client.id); - client.pairs.delete(this.id); - client.send([{ - from: this.id - },'end/pair']); -}; -/** - * @param {Client|string} client - * @returns {Boolean} - */ -Client.prototype.isPaired = function(client){ - if(typeof client == "string") - { - return Client.clients.get(client)?.pairs.has(this.id) && this.pairs.has(client) - } - return client.pairs.has(this.id) && this.pairs.has(client.id); -}; -/** - * @returns {string[]} - */ -Client.prototype.pairList = function(){ - return [...this.pairs.values()].filter(e => this.isPaired(e)); -}; - -Client.prototype.send = function(obj){ - if(this.socket.connected){ - this.socket.sendUTF(JSON.stringify(obj),err => { - if(err && this.socket) - { - console.error("I/O: Hatalı yazma işlemi yapıldı",err.message) - } - }); - }else{ - console.error("Bağlantısı kopmuş yazma işlemi") - } -}; - -Client.prototype.packWriteable = function(){ - return !!this.store.get("packrecaive") -} -Client.prototype.packReadable = function(){ - return !!this.store.get("packsending") -} -Client.prototype.peerInfoNotifiable = function(){ - return !!this.store.get("notifyPairInfo") -} -Client.prototype.roomInfoNotifiable = function(){ - return !!this.store.get("notifyRoomInfo") -} - -exports.Client = Client; \ No newline at end of file diff --git a/Source/EventEmitter.js b/Source/EventEmitter.js deleted file mode 100644 index c370b81..0000000 --- a/Source/EventEmitter.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; - -const events = new Map(); - -function on(event, callback) { - if (!events.has(event)) { - events.set(event, []); - } - events.get(event).push(callback); -} - -function emit(event, ...args) { - if (events.has(event)) { - for (const callback of events.get(event)) { - try { - callback(...args); - } catch (error) { - console.error(`Event error [${event}]:`, error); - } - } - } -} - -function once(event, callback) { - const wrapper = (...args) => { - off(event, wrapper); - callback(...args); - }; - on(event, wrapper); -} - -function off(event, callback) { - if (events.has(event)) { - const callbacks = events.get(event); - const index = callbacks.indexOf(callback); - if (index > -1) { - callbacks.splice(index, 1); - } - } -} - -function removeAllListeners(event) { - if (event) { - events.delete(event); - } else { - events.clear(); - } -} - -function listenerCount(event) { - return events.has(event) ? events.get(event).length : 0; -} - -module.exports = { - on, - emit, - once, - off, - removeAllListeners, - listenerCount, - events -}; diff --git a/Source/HTTPServer.js b/Source/HTTPServer.js deleted file mode 100644 index 7dd0096..0000000 --- a/Source/HTTPServer.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -let http = require("http"); -let express = require("express"); -let compression = require("compression"); -let {resolve} = require("path"); - -const { termoutput } = require("./config"); - -let app = express(); -app.use(compression({ level: 9 })); -app.use(express.json()); -app.use(express.urlencoded({ extended: true })); - -let server = http.createServer(app); - -server.listen(7707, '0.0.0.0', () => { - termoutput && console.log("HTTP Service Running..."); -}); - -server.on("error", (err) => { - console.error(err); -}); - -exports.http = server; - -const apiRouter = require("./api"); -app.use("/api", apiRouter); - -app.get("/script", (req, res) => { - res.sendFile(resolve("./script/index.js")); -}); - -app.use(express.static(resolve("./public"))); -app.use("/script", express.static(resolve("./script"))); - -app.get("/", (req, res) => { - res.sendFile(resolve("./script/index.js")); -}); - -app.get("*", (req, res) => { - res.sendFile(resolve("./script/status.xml")); -}); diff --git a/Source/MessageRouter.js b/Source/MessageRouter.js deleted file mode 100644 index d457ab3..0000000 --- a/Source/MessageRouter.js +++ /dev/null @@ -1,54 +0,0 @@ -"use strict"; - -const handlers = new Map(); - -function register(type, handler) { - handlers.set(type, handler); -} - -function handle(client, message) { - const { type } = message; - - if (!type) { - return { status: 'fail', message: 'MISSING_TYPE' }; - } - - const handler = handlers.get(type); - - if (!handler) { - return { status: 'fail', message: 'UNKNOWN_TYPE' }; - } - - try { - const result = handler(client, message); - return result; - } catch (error) { - console.error(`Handler error [${type}]:`, error); - return { status: 'fail', message: 'HANDLER_ERROR', error: error.message }; - } -} - -function unregister(type) { - handlers.delete(type); -} - -function clear() { - handlers.clear(); -} - -function hasHandler(type) { - return handlers.has(type); -} - -function listHandlers() { - return [...handlers.keys()]; -} - -module.exports = { - register, - handle, - unregister, - clear, - hasHandler, - listHandlers -}; diff --git a/Source/Services/Auth.js b/Source/Services/Auth.js deleted file mode 100644 index e40f430..0000000 --- a/Source/Services/Auth.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; - -const { Client } = require("../Client.js"); -const { on, emit, register } = require("../WebSocket"); - -on('disconnect', (xclient) => { - const { intersection, pairs } = xclient.getSucureClients(); - - for (const [clientid, client] of intersection) { - client?.send([{ id: xclient.id }, "peer/disconnect"]); - } - - for (const [id, peer] of pairs) { - peer?.pairs.delete(xclient.id); - xclient.pairs.delete(id); - } -}); - -register('auth/pair-system', (client, msg) => { - if (msg.value == 'everybody') { - client.requiredPair = true; - return { status: 'success' }; - } - if (msg.value == 'disable') { - client.requiredPair = false; - return { status: 'success' }; - } - return { status: 'fail', message: 'INVALID_VALUE' }; -}); - -register('my/socketid', (client, msg) => { - return client.id; -}); - -register('auth/public', (client, msg) => { - client.requiredPair = false; - return { value: 'success', mode: 'public' }; -}); - -register('auth/private', (client, msg) => { - client.requiredPair = true; - return { value: 'success', mode: 'private' }; -}); - -register('request/pair', (client, msg) => { - const { to } = msg; - - if (!Client.clients.has(to)) { - return { status: 'fail', message: 'CLIENT_NOT_FOUND' }; - } - - const pairclient = Client.clients.get(to); - - if (pairclient.pairs.has(client.id)) { - return { status: 'success', message: 'ALREADY-PAIRED' }; - } - - if (client.pairs.has(to)) { - return { status: 'fail', message: 'ALREADY-REQUESTED' }; - } - - client.peerRequest(pairclient); - return { status: 'success', message: 'REQUESTED' }; -}); - -register('accept/pair', (client, msg) => { - const { to } = msg; - - if (!Client.clients.has(to)) { - return { status: 'fail', message: 'CLIENT_NOT_FOUND' }; - } - - const pairclient = Client.clients.get(to); - - if (pairclient.pairs.has(client.id)) { - return { status: 'success', message: 'ALREADY-PAIRED' }; - } - - if (!client.pairs.has(to)) { - return { status: 'fail', message: 'NOT_REQUESTED_PAIR' }; - } - - client.acceptPeerRequest(pairclient); - return { status: 'success' }; -}); - -register('reject/pair', (client, msg) => { - const { to } = msg; - - if (!Client.clients.has(to)) { - return { status: 'fail', message: 'CLIENT_NOT_FOUND' }; - } - - const pairclient = Client.clients.get(to); - - if (pairclient.pairs.has(client.id)) { - return { status: 'success', message: 'ALREADY-PAIRED' }; - } - - if (!client.pairs.has(to)) { - return { status: 'fail', message: 'NOT_REQUESTED_PAIR' }; - } - - client.rejectPeerRequest(pairclient); - return { status: 'success' }; -}); - -register('end/pair', (client, msg) => { - const { to } = msg; - - if (!Client.clients.has(to)) { - return { status: 'fail', message: 'CLIENT_NOT_FOUND' }; - } - - const pairclient = Client.clients.get(to); - - if (!pairclient.pairs.has(client.id)) { - return { status: 'success', message: 'NOT_PAIRED' }; - } - - client.rejectPeerRequest(pairclient); - return { status: 'success' }; -}); - -register('pair/list', (client, msg) => { - return { type: 'pair/list', value: client.pairList() }; -}); - -register('is/reachable', (client, msg) => { - const { to } = msg; - - if (!Client.clients.has(to)) { - return false; - } - - const otherPeer = Client.clients.get(to); - - if (otherPeer.requiredPair && !otherPeer.pairs.has(to)) { - return false; - } - - return true; -}); - -register('auth/info', (client, msg) => { - const { name, value } = msg; - - client.info.set(name, value); - - const clients = client.getSucureClients(); - - for (const [, spair] of clients.pairs) { - spair.send([{ from: client.id, name, value }, "pair/info"]); - } - - for (const [, spair] of clients.roompairs) { - spair.send([{ from: client.id, name, value }, "pair/info"]); - } - - return { status: 'success' }; -}); - -register('peer/info', (client, msg) => { - const { peer } = msg; - - if (!client.isSecure(peer)) { - return { status: "fail", message: "unaccessible user" }; - } - - const peerClient = Client.clients.get(peer); - const info = {}; - peerClient.info.forEach((value, name) => { info[name] = value; }); - - return { status: "success", info }; -}); diff --git a/Source/Services/DataTransfer.js b/Source/Services/DataTransfer.js deleted file mode 100644 index ff499c2..0000000 --- a/Source/Services/DataTransfer.js +++ /dev/null @@ -1,101 +0,0 @@ -"use strict"; - -const { Client } = require("../Client.js"); -const { register } = require("../WebSocket"); -const { Room } = require("./Room"); - -register('pack/to', (client, msg) => { - const { to, pack, handshake } = msg; - - if (!client.packReadable()) { - return handshake ? { type: 'fail' } : undefined; - } - - if (!Client.clients.has(to)) { - return handshake ? { type: 'fail' } : undefined; - } - - const otherPeer = Client.clients.get(to); - - if (otherPeer.requiredPair) { - if (!otherPeer.pairs.has(to)) { - return handshake ? { type: 'fail' } : undefined; - } - } else { - if (!otherPeer.pairs.has(to)) { - otherPeer.pairs.add(client.id); - client.pairs.add(otherPeer.id); - } - } - - if (!otherPeer.packWriteable()) { - return handshake ? { type: 'fail' } : undefined; - } - - otherPeer.send([{ from: client.id, pack }, 'pack']); - - return handshake ? { type: 'success' } : undefined; -}); - -register('request/to', (client, msg) => { - const { to, pack } = msg; - - if (!Client.clients.has(to)) { - return; - } - - const otherPeer = Client.clients.get(to); - - if (otherPeer.requiredPair) { - if (!otherPeer.pairs.has(to)) { - return; - } - } else { - otherPeer.pairs.add(client.id); - client.pairs.add(otherPeer.id); - } - - otherPeer.send([{ from: client.id, pack }, 'request']); -}); - -register('response/to', (client, msg) => { - const { to, pack, id } = msg; - - if (!Client.clients.has(to)) { - return; - } - - const otherPeer = Client.clients.get(to); - - if (otherPeer.requiredPair && !otherPeer.pairs.has(to)) { - return; - } - - otherPeer.send([{ from: client.id, pack }, id]); -}); - -register('pack/room', (client, msg) => { - const { to, pack, handshake, wom } = msg; - - if (!client.packReadable()) { - return handshake ? { type: 'fail' } : undefined; - } - - if (!Room.rooms.has(to)) { - return handshake ? { type: 'fail' } : undefined; - } - - if (!client.rooms.has(to)) { - return handshake ? { type: 'fail' } : undefined; - } - - const room = Room.rooms.get(to); - - room.send( - [{ from: to, pack, sender: client.id }, 'pack/room'], - wom ? client.id : undefined, - c => c.packWriteable() - ); - - return handshake ? { type: 'success' } : undefined; -}); diff --git a/Source/Services/IPPressure.js b/Source/Services/IPPressure.js deleted file mode 100644 index 173fecf..0000000 --- a/Source/Services/IPPressure.js +++ /dev/null @@ -1,269 +0,0 @@ -"use strict"; - -const { Client } = require("../Client"); -const { on, register } = require("../WebSocket"); - -class APNumber { - static busyNumbers = new Map(); - - static lock(client) { - let c = 24; - while (true) { - if (!APNumber.busyNumbers.has(c)) { - APNumber.busyNumbers.set(c, client); - process.send({ - type: 'AP_NUMBER/LOCK', - uuid: client.id, - value: c - }); - return c; - } - c++; - } - } - - static release(num) { - process.send({ - type: 'AP_NUMBER/RELEASE', - uuid: APNumber.busyNumbers.get(num).id, - value: num - }); - APNumber.busyNumbers.delete(num); - } - - static whois(num) { - return APNumber.busyNumbers.get(num)?.id; - } -} - -class APShortCode { - static busyCodes = new Map(); - - static lock(client) { - let firstLetter = new ShortCodeLetter(); - let secondLetter = new ShortCodeLetter(); - let thirdLetter = new ShortCodeLetter(); - - while (1) { - let code = [firstLetter.code, secondLetter.code, thirdLetter.code].join(''); - if (!APShortCode.busyCodes.has(code)) { - APShortCode.busyCodes.set(code, client); - process.send({ - type: 'AP_SHORTCODE/LOCK', - uuid: APShortCode.busyCodes.get(code).id, - value: code - }); - return code; - } - - if (!thirdLetter.end()) { - thirdLetter.next(); - } else { - thirdLetter.reset(); - if (!secondLetter.end()) { - secondLetter.next(); - } else { - secondLetter.reset(); - if (!firstLetter.end()) { - firstLetter.next(); - } else { - break; - } - } - } - } - } - - static release(code) { - if (APShortCode.busyCodes.has(code)) { - process.send({ - type: 'AP_SHORTCODE/RELEASE', - uuid: APShortCode.busyCodes.get(code).id, - value: code - }); - APShortCode.busyCodes.delete(code); - } - } - - static whois(num) { - return APShortCode.busyCodes.get(num)?.id; - } -} - -class ShortCodeLetter { - chars = 'ABCDEFGHIKLMNOPRSTVXYZ'.split(''); - now = 0; - code = 'A'; - - next() { - this.now++; - this.code = this.chars.at(this.now); - return this.code; - } - - reset() { - this.now = 0; - this.code = 'A'; - } - - end() { - return !this.chars.at(this.now + 1); - } -} - -class APIPAddress { - static busyIP = new Map(); - - static lock(client) { - let A = 10, B = 0, C = 0, D = 1; - - while (1) { - let code = [A, B, C, D].join('.'); - if (!APIPAddress.busyIP.has(code)) { - APIPAddress.busyIP.set(code, client); - process.send({ - type: 'AP_IPADDRESS/LOCK', - uuid: APIPAddress.busyIP.get(code).id, - value: code - }); - return code; - } - - if (D != 255) { D++; continue; } - D = 0; - if (C != 255) { C++; continue; } - C = 0; - if (B != 255) { B++; continue; } - B = 0; - if (A != 255) { A++; continue; } - return; - } - } - - static release(code) { - if (APIPAddress.busyIP.has(code)) { - process.send({ - type: 'AP_IPADDRESS/RELEASE', - uuid: APIPAddress.busyIP.get(code).id, - value: code - }); - APIPAddress.busyIP.delete(code); - } - } - - static whois(num) { - return APIPAddress.busyIP.get(num)?.id; - } -} - -exports.APNumber = APNumber; -exports.APShortCode = APShortCode; -exports.APIPAddress = APIPAddress; - -register('alloc/APIPAddress', (client, msg) => { - if (client.APIPAddress) { - return { status: 'success', ip: client.APIPAddress }; - } - let value = APIPAddress.lock(client); - client.APIPAddress = value; - return { status: 'success', ip: value }; -}); - -register('alloc/APNumber', (client, msg) => { - if (client.APNumber) { - return { status: 'success', number: client.APNumber }; - } - let value = APNumber.lock(client); - client.APNumber = value; - return { status: 'success', number: value }; -}); - -register('alloc/APShortCode', (client, msg) => { - if (client.APShortCode) { - return { status: 'success', code: client.APShortCode }; - } - let value = APShortCode.lock(client); - client.APShortCode = value; - return { status: 'success', code: value }; -}); - -register('realloc/APIPAddress', (client, msg) => { - if (client.APIPAddress == 0) { - return { status: 'fail' }; - } - APIPAddress.release(client.APIPAddress); - let value = APIPAddress.lock(client); - return { status: 'success', ip: value }; -}); - -register('realloc/APNumber', (client, msg) => { - if (client.APNumber == 0) { - return { status: 'fail' }; - } - APNumber.release(client.APNumber); - let value = APNumber.lock(client); - return { status: 'success', number: value }; -}); - -register('realloc/APShortCode', (client, msg) => { - if (client.APShortCode == 0) { - return { status: 'fail' }; - } - APShortCode.release(client.APShortCode); - let value = APShortCode.lock(client); - return { status: 'success', code: value }; -}); - -register('release/APIPAddress', (client, msg) => { - APIPAddress.release(client.APIPAddress); - client.APIPAddress = undefined; - return { status: 'success' }; -}); - -register('release/APNumber', (client, msg) => { - APNumber.release(client.APNumber); - client.APNumber = undefined; - return { status: 'success' }; -}); - -register('release/APShortCode', (client, msg) => { - APShortCode.release(client.APShortCode); - client.APShortCode = undefined; - return { status: 'success' }; -}); - -register('whois/APIPAddress', (client, msg) => { - let socketId = APIPAddress.whois(msg.whois); - if (socketId) { - return { status: 'success', socket: socketId }; - } - return { status: 'fail' }; -}); - -register('whois/APNumber', (client, msg) => { - let socketId = APNumber.whois(msg.whois); - if (socketId) { - return { status: 'success', socket: socketId }; - } - return { status: 'fail' }; -}); - -register('whois/APShortCode', (client, msg) => { - let socketId = APShortCode.whois(msg.whois); - if (socketId) { - return { status: 'success', socket: socketId }; - } - return { status: 'fail' }; -}); - -on('disconnect', (client) => { - if (client.APIPAddress != 0) { - APIPAddress.release(client.APIPAddress); - } - if (client.APNumber != 0) { - APNumber.release(client.APNumber); - } - if (client.APShortCode != 0) { - APShortCode.release(client.APShortCode); - } -}); diff --git a/Source/Services/Room.js b/Source/Services/Room.js deleted file mode 100644 index 0be6c3f..0000000 --- a/Source/Services/Room.js +++ /dev/null @@ -1,549 +0,0 @@ -const { Client } = require("../Client.js"); -let { randomUUID, createHash } = require("crypto"); -const joi = require("joi"); -const { on, register } = require("../WebSocket"); -const { termoutput } = require("../config.js"); -let term = require("terminal-kit").terminal; - -function Sha256(update) { - return createHash("sha256").update(update).digest("hex"); -}; - -function Room() -{ - /** - * @type {string} - */ - this.id = randomUUID(); - /** - * @type {string} - */ - this.name = ""; - /** - * @type {string} - */ - this.description = ""; - /** - * @type {Client} - */ - this.owner = null; - /** - * @type {Date} - */ - this.createdAt = new Date(); - /** - * @type {Map} - */ - this.clients = new Map(); - /** - * @type {"public"|"private"} - */ - this.accessType = ""; - /** - * @type {"free"|"invite"|"password"|"lock"} - */ - this.joinType = "invite"; - /** - * @type {boolean} - */ - this.notifyActionInvite = false; - /** - * @type {boolean} - */ - this.notifyActionJoined = true; - /** - * @type {boolean} - */ - this.notifyActionEjected = true; - /** - * @type {string} - */ - this.credential = null; - /** - * @type {string[]} - */ - this.waitingInvited = new Set(); - - /** - * @type {Map} - */ - this.info = new Map(); -} -/** - * @param {Room} room - */ -Room.prototype.publish = function(){ - Room.rooms.set(this.id, this); - termoutput && term.green("Room Published ").white(this.name," in ").yellow(this.clients.size).white(" clients")('\n'); -}; -/** - * @return {Client[]} - */ -Room.prototype.filterPeers = function(optiJson){ - let peers = []; - this.clients.forEach(client => { - if(client.match(optiJson)) - { - peers.push(client); - } - }); - return peers; -}; -Room.prototype.toJSON = function(detailed){ - let obj = {}; - obj.id = this.id; - obj.accessType = this.accessType; - obj.createdAt = this.createdAt; - obj.description = this.description; - obj.joinType = this.joinType; - obj.name = this.name; - obj.owner = this.owner.id; - obj.waitingInvited = [...this.waitingInvited]; - if(detailed) - { - obj.credential = this.credential; - obj.notifyActionInvite = this.notifyActionInvite; - obj.notifyActionJoined = this.notifyActionJoined; - obj.notifyActionEjected = this.notifyActionEjected; - obj.clients = [...this.clients.keys()]; - } - return obj; -}; -Room.prototype.getInfo = function(){ - let obj = {}; - for (const [name, value] of this.info) - { - obj[name] = value; - } - return obj; -}; -/** - * @param {Object} data - * @param {Room} room - */ -Room.fromJSON = function(data, room){ - room = room || new Room(); - let obj = {}; - room.id = data.id; - room.accessType = data.accessType; - room.createdAt = data.createdAt; - room.description = data.description; - room.joinType = data.joinType; - room.name = data.name; - if(data.owner && Client.clients.has(data.owner)) - { - room.owner = Client.clients.get(data.owner); - } - room.waitingInvited = new Set(data.waitingInvited); - obj.credential = data.credential; - obj.notifyActionInvite = data.notifyActionInvite; - obj.notifyActionJoined = data.notifyActionJoined; - obj.notifyActionEjected = data.notifyActionEjected; - obj.clients = new Map( - data.clients.map(e => ([ - e, // map key - Client.clients.get(e) // map value - ]) - ) - ) - return room; -}; -/** - * - * @param {any} obj - * @param {string} withOut - * @param {(client:Client) => boolean} map - */ -Room.prototype.send = function(obj, withOut, map){ - for (const client of this.clients.values()) { - if(client.id != withOut) - { - ( - map ? map(client) : 1 - ) && client.send(obj); - } - } - termoutput && term.green("Room bulk message ").white(this.name," in ").yellow(this.clients.size + "").white(" clients")('\n'); -}; -/** - * @param {Client} client - */ -Room.prototype.join = function(client){ - if(this.notifyActionJoined) - { - this.send( - [ - { - id: client.id, - roomid: this.id, - ownerid: this.owner.id - }, - 'room/joined' - ], - void 0, - client => client.peerInfoNotifiable() - ); - }; - client.rooms.add(this.id); - this.clients.set(client.id, client); - termoutput && term.green("Client Room joined ").white(this.name," in ").yellow(this.clients.size + "").white(" clients")('\n'); -}; -Room.prototype.down = function(){ - termoutput && term.red("Room is downed ").red(this.name," in ").yellow(this.clients.size + "").red(" clients")('\n'); - this.send([{ - roomid: this.id, - ownerid: this.owner.id - },'room/closed']); - Room.rooms.delete(this.id); -}; -/** - * @param {Client} client - */ -Room.prototype.eject = function(client){ - if(this.notifyActionEjected) - { - this.send( - [ - { - id: client.id, - roomid: this.id, - ownerid: this.owner.id - }, - 'room/ejected' - ], - client.id, - client => client.peerInfoNotifiable() - ); - } - client.rooms.delete(this.id); - this.clients.delete(client.id); - - if(this.clients.size == 0) - { - this.down(); - termoutput && term.red("Client Room closed ").red(this.name," at 0 clients")('\n'); - } - - termoutput && term.red("Client Room ejected ").red(this.name," in ").yellow(this.clients.size + "").red(" clients")('\n'); -}; - -/** - * @type {Map} - */ -Room.rooms = new Map(); - -on('connect', (client) => { - let room = new Room(); - room.accessType = "private"; - room.joinType = "notify"; - room.description = 'Private room'; - room.id = client.id; - room.name = "Your Room | " + client.id; - room.owner = client; - room.publish(); - room.join(client); -}); - -on('disconnect', (client) => { - const room = Room.rooms.get(client.id); - if (room) room.eject(client); - for (const roomId of client.rooms) { - const r = Room.rooms.get(roomId); - if (r) r.eject(client); - } -}); - - -let CreateRoomVerify = joi.object({ - type: joi.any().required(), - accessType: joi.string().pattern(/^public$|private$/).required(), - notifyActionInvite: joi.boolean().required(), - notifyActionJoined: joi.boolean().required(), - notifyActionEjected: joi.boolean().required(), - joinType: joi.string().pattern(/^free$|^invite$|^password$|^lock$/).required(), - description: joi.string().required(), - name: joi.string().required(), - credential: joi.string().optional(), - ifexistsJoin: joi.boolean().optional(), - autoFetchInfo: joi.boolean().optional(), -}); - -register('myroom-info', (client, msg) => { - let room = Room.rooms.get(client.id); - return { status: "success", room: room.toJSON() }; -}); - -register('room-peers', (client, msg) => { - const { roomId, filter } = msg; - if (!Room.rooms.has(roomId)) { - return { status: 'fail' }; - } - const filteredPeers = Room.rooms.get(roomId).filterPeers(filter || {}); - return { status: 'success', peers: filteredPeers.map(i => i.id) }; -}); - -register('room/peer-count', (client, msg) => { - const { roomId, filter } = msg; - if (!Room.rooms.has(roomId)) { - return { status: 'fail' }; - } - const filteredPeers = Room.rooms.get(roomId).filterPeers(filter || {}); - return { status: 'success', count: filteredPeers.length }; -}); - -register('room-info', (client, msg) => { - const { name } = msg; - for (const [roomId, room] of Room.rooms) { - if (name == room.name) { - return { status: "success", room: room.toJSON() }; - } - } - return { status: "fail", message: "NOT-FOUND-ROOM" }; -}); - -register('joinedrooms', (client, msg) => { - return [...client.rooms].map(e => Room.rooms.get(e).toJSON()); -}); - -register('closeroom', (client, msg) => { - const { roomId } = msg; - if (!Room.rooms.has(roomId)) { - return { status: 'fail' }; - } - const room = Room.rooms.get(roomId); - if (room.owner === client.id) { - room.down(); - return { status: 'success' }; - } - return { status: 'fail' }; -}); - -register('create-room', (client, msg) => { - const { error } = CreateRoomValidate.validate(msg); - if (error) { - return { status: 'fail', messages: error.message }; - } - - const { name } = msg; - for (const [, room] of Room.rooms) { - if (name == room.name) { - return { status: "fail", message: "ALREADY-EXISTS" }; - } - } - - let room = new Room(); - room.accessType = msg.accessType; - room.notifyActionInvite = msg.notifyActionInvite; - room.notifyActionJoined = msg.notifyActionJoined; - room.notifyActionEjected = msg.notifyActionEjected; - room.joinType = msg.joinType; - room.description = msg.description; - room.name = msg.name; - room.owner = client; - - if (msg.credential) { - room.credential = Sha256(msg.credential + ""); - } - - room.publish(); - room.join(client); - - return { status: "success", room: room.toJSON() }; -}); - -register('joinroom', (client, msg) => { - const { name, autoFetchInfo } = msg; - let roomId; - - for (const [_roomId, room] of Room.rooms) { - if (name == room.name) { - roomId = _roomId; - break; - } - } - - if (!Room.rooms.has(roomId)) { - return { status: "fail", message: "NOT-FOUND-ROOM" }; - } - - const room = Room.rooms.get(roomId); - - if (room.joinType == "lock") { - return { status: "fail", message: "LOCKED-ROOM" }; - } - - if (room.joinType == "password") { - if (room.credential == Sha256(msg.credential + "")) { - let info = {}; - if (autoFetchInfo) { - info.info = room.getInfo(); - } - room.join(client); - return { status: "success", room: room.toJSON(), ...info }; - } - return { status: "fail", message: "WRONG-PASSWORD", area: "credential" }; - } - - if (room.joinType == "free") { - let info = {}; - if (autoFetchInfo) { - info.info = room.getInfo(); - } - room.join(client); - return { status: "success", room: room.toJSON(), ...info }; - } - - if (room.joinType == "invite") { - room.waitingInvited.add(client.id); - if (room.notifyActionInvite) { - room.send([{ id: client.id }, "room/invite"]); - } else { - room.owner.send([{ id: client.id }, "room/invite"]); - } - } - - return { status: "fail", message: "NOT-FOUND-ROOM" }; -}); - -register('ejectroom', (client, msg) => { - const { roomId } = msg; - - if (!Room.rooms.has(roomId)) { - return { status: "fail", message: "NOT-FOUND-ROOM" }; - } - - const room = Room.rooms.get(roomId); - - if (!room.clients.has(client.id)) { - return { status: "fail", message: "ALREADY-ROOM-OUT" }; - } - - room.eject(client); - return { status: "success" }; -}); - -register('accept/invite-room', (client, msg) => { - const { roomId, clientId } = msg; - - if (!Room.rooms.has(roomId)) { - return { status: "fail", message: "NOT-FOUND-ROOM" }; - } - - const room = Room.rooms.get(roomId); - - if (!client.rooms.has(room.id)) { - return { status: "fail", message: "FORBIDDEN-INVITE-ACTIONS" }; - } - - if (room.joinType == 'invite') { - return { status: "fail", message: "INVALID-DATA" }; - } - - if (!room.waitingInvited.includes(clientId)) { - return { status: "fail", message: "NO-WAITING-INVITED" }; - } - - if (!Client.clients.has(clientId)) { - return { status: "fail", message: "NO-CLIENT" }; - } - - const JoinClient = Client.clients.get(clientId); - room.join(JoinClient); - JoinClient.send([{ status: "accepted" }, 'room/invite/status']); - - return { status: "success" }; -}); - -register('reject/invite-room', (client, msg) => { - const { roomId, clientId } = msg; - - if (!Room.rooms.has(roomId)) { - return { status: "fail", message: "NOT-FOUND-ROOM" }; - } - - const room = Room.rooms.get(roomId); - - if (!client.rooms.has(room.id)) { - return { status: "fail", message: "FORBIDDEN-INVITE-ACTIONS" }; - } - - if (room.joinType == 'invite') { - return { status: "fail", message: "INVALID-DATA" }; - } - - if (!room.waitingInvited.includes(clientId)) { - return { status: "fail", message: "NO-WAITING-INVITED" }; - } - - if (!Client.clients.has(clientId)) { - return { status: "fail", message: "NO-CLIENT" }; - } - - const JoinClient = Client.clients.get(clientId); - room.waitingInvited = room.waitingInvited.filter(e => e != clientId); - room.send([{ id: clientId, roomId: room.id }, 'room/invite/status']); - JoinClient.send([{ status: "rejected" }, 'room/invite/status']); - - return { status: "success" }; -}); - -register('room/list', (client, msg) => { - const rooms = []; - for (const [id, room] of Room.rooms) { - if (room.accessType == "public") { - rooms.push({ - name: room.name, - joinType: room.joinType, - description: room.description, - id - }); - } - } - return { type: 'public/rooms', rooms }; -}); - -register('room/info', (client, msg) => { - const { roomId, name } = msg; - - if (!Room.rooms.has(roomId)) { - return { status: "fail", message: "NOT-FOUND-ROOM" }; - } - - const room = Room.rooms.get(roomId); - - if (!client.rooms.has(room.id)) { - return { status: "fail", message: "NO-JOINED-ROOM" }; - } - - if (name) { - return { status: "success", value: room.info.get(name) }; - } - - return { status: "success", value: room.getInfo() }; -}); - -register('room/setinfo', (client, msg) => { - const { roomId, name, value } = msg; - - if (!Room.rooms.has(roomId)) { - return { status: "fail", message: "NOT-FOUND-ROOM" }; - } - - const room = Room.rooms.get(roomId); - - if (!client.rooms.has(room.id)) { - return { status: "fail", message: "NO-JOINED-ROOM" }; - } - - room.info.set(name, value); - - room.send( - [{ name, value, roomId: room.id }, "room/info"], - client.id, - c => c.roomInfoNotifiable() - ); - - return { status: "success" }; -}); - -exports.Room = Room; diff --git a/Source/Services/Session.js b/Source/Services/Session.js deleted file mode 100644 index 648558b..0000000 --- a/Source/Services/Session.js +++ /dev/null @@ -1,43 +0,0 @@ -"use strict"; - -const { on, emit, register } = require("../WebSocket"); - -const defaults = { - notifyPairInfo: true, - packrecaive: true, - packsending: true, - notifyRoomInfo: true -}; - -on('connect', (client) => { - for (const [name, value] of Object.entries(defaults)) { - client.store.set(name, value); - } -}); - -register('connection/pairinfo', (client, msg) => { - client.store.set("notifyPairInfo", !!msg.value); - return { status: 'success' }; -}); - -register('connection/roominfo', (client, msg) => { - client.store.set("notifyRoomInfo", !!msg.value); - return { status: 'success' }; -}); - -register('connection/packrecaive', (client, msg) => { - client.store.set("packrecaive", !!msg.value); - return { status: 'success' }; -}); - -register('connection/packsending', (client, msg) => { - client.store.set("packsending", !!msg.value); - return { status: 'success' }; -}); - -register('connection/reset', (client, msg) => { - for (const [name, value] of Object.entries(defaults)) { - client.store.set(name, value); - } - return { status: 'success' }; -}); diff --git a/Source/Services/YourID.js b/Source/Services/YourID.js deleted file mode 100644 index 949013c..0000000 --- a/Source/Services/YourID.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -const { on } = require("../WebSocket"); - -on('connect', (client) => { - client.send([{ type: 'id', value: client.id }, 'id']); -}); diff --git a/Source/WebSocket.js b/Source/WebSocket.js deleted file mode 100644 index a0d3932..0000000 --- a/Source/WebSocket.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; - -let websocket = require("websocket"); -let http = null; -let wsServer = null; -let {randomUUID} = require("crypto"); -const { Client } = require("./Client.js"); -const { termoutput } = require("./config"); -const EventEmitter = require("./EventEmitter"); -const MessageRouter = require("./MessageRouter"); - -function init(server) { - http = server; - - termoutput && console.log("Web Socket Protocol is ready"); - - http.addListener("upgrade", () => { - termoutput && console.log("HTTP Upgrading to WebSocket"); - }); - - wsServer = new websocket.server({ - httpServer: http, - autoAcceptConnections: true - }); - - wsServer.addListener("connect", (socket) => { - let client = new Client(); - let id = randomUUID(); - socket.id = id; - client.id = id; - client.socket = socket; - client.created_at = new Date(); - Client.clients.set(id, client); - - EventEmitter.emit('connect', client); - - let pingTimer = setInterval(() => socket.ping('saQut'), 10_000); - - socket.addListener("pong", (validationText) => { - if (validationText.toString('utf8') != "saQut") { - socket.close(); - } - }); - - socket.addListener("message", ({ type, utf8Data }) => { - if (type == "utf8") { - try { - const json = JSON.parse(utf8Data); - const [message, id, action] = json; - - let response; - - if (typeof id === 'number' || typeof id === 'string') { - response = MessageRouter.handle(client, message); - - if (action === 'R') { - client.send([response, id, 'E']); - } else if (action === 'S') { - client.send([response, id, 'C']); - } - } else { - const result = MessageRouter.handle(client, message); - - if (result && result.broadcast) { - EventEmitter.emit('broadcast', result.broadcast, client); - } - } - } catch (error) { - EventEmitter.emit('messageError', client, utf8Data); - } - } - }); - - socket.addListener("close", () => { - EventEmitter.emit('disconnect', client); - Client.clients.delete(id); - clearInterval(pingTimer); - }); - }); -} - -const on = EventEmitter.on; -const emit = EventEmitter.emit; -const off = EventEmitter.off; - -const register = MessageRouter.register; -const handle = MessageRouter.handle; - -exports.init = init; -exports.on = on; -exports.emit = emit; -exports.off = off; -exports.register = register; -exports.handle = handle; diff --git a/Source/api.js b/Source/api.js deleted file mode 100644 index fe769c8..0000000 --- a/Source/api.js +++ /dev/null @@ -1,235 +0,0 @@ -"use strict"; - -const express = require("express"); -const router = express.Router(); -const { Client } = require("./Client"); -const { Room } = require("./Services/Room"); - -const apiKeys = new Map(); -const webhooks = new Map(); - -function auth(req, res, next) { - const key = req.headers['x-api-key']; - - if (!key) { - return res.status(401).json({ status: 'fail', message: 'API_KEY_REQUIRED' }); - } - - if (!apiKeys.has(key)) { - return res.status(401).json({ status: 'fail', message: 'INVALID_API_KEY' }); - } - - req.server = apiKeys.get(key); - next(); -} - -router.post('/auth/key', (req, res) => { - const { domain } = req.body; - - if (!domain) { - return res.json({ status: 'fail', message: 'DOMAIN_REQUIRED' }); - } - - const key = require("crypto").randomUUID(); - apiKeys.set(key, { domain, key }); - - res.json({ status: 'success', key }); -}); - -router.post('/client/:id/send', auth, (req, res) => { - const { id } = req.params; - const { pack } = req.body; - - const client = Client.clients.get(id); - - if (!client) { - return res.json({ status: 'fail', message: 'CLIENT_NOT_FOUND' }); - } - - if (!pack) { - return res.json({ status: 'fail', message: 'PACK_REQUIRED' }); - } - - const fromServer = req.server; - client.send([{ from: 'server', fromServer, pack }, 'server/pack']); - - res.json({ status: 'success' }); -}); - -router.post('/room/:id/send', auth, (req, res) => { - const { id } = req.params; - const { pack, wom } = req.body; - - const room = Room.rooms.get(id); - - if (!room) { - return res.json({ status: 'fail', message: 'ROOM_NOT_FOUND' }); - } - - if (!pack) { - return res.json({ status: 'fail', message: 'PACK_REQUIRED' }); - } - - const fromServer = req.server; - - room.send( - [{ from: 'server', fromServer, pack, roomId: id }, 'server/pack/room'], - wom ? undefined : 'server', - () => true - ); - - res.json({ status: 'success' }); -}); - -router.post('/room/create', auth, (req, res) => { - const { name, accessType, joinType, description, credential } = req.body; - - if (!name) { - return res.json({ status: 'fail', message: 'NAME_REQUIRED' }); - } - - for (const [, room] of Room.rooms) { - if (room.name === name) { - return res.json({ status: 'fail', message: 'ROOM_ALREADY_EXISTS' }); - } - } - - const room = new Room(); - room.name = name; - room.accessType = accessType || 'public'; - room.joinType = joinType || 'free'; - room.description = description || ''; - room.owner = { id: 'server', isServer: true }; - - if (credential) { - const { createHash } = require("crypto"); - room.credential = createHash("sha256").update(credential).digest("hex"); - } - - room.publish(); - - res.json({ status: 'success', room: room.toJSON() }); -}); - -router.post('/room/:id/join', auth, (req, res) => { - const { id } = req.params; - const { credential } = req.body; - - const room = Room.rooms.get(id); - - if (!room) { - return res.json({ status: 'fail', message: 'ROOM_NOT_FOUND' }); - } - - if (room.joinType === 'lock') { - return res.json({ status: 'fail', message: 'ROOM_LOCKED' }); - } - - if (room.joinType === 'password') { - const { createHash } = require("crypto"); - const hash = createHash(credential || '').digest("hex"); - if (room.credential !== hash) { - return res.json({ status: 'fail', message: 'WRONG_PASSWORD' }); - } - } - - const fakeClient = { - id: 'server-joined', - isServer: true, - rooms: new Set(), - send: (msg) => { - const fromServer = req.server; - room.send([{ from: 'server', fromServer, ...msg[0] }, msg[1]], 'server'); - } - }; - - room.join(fakeClient); - - res.json({ status: 'success', room: room.toJSON() }); -}); - -router.delete('/room/:id/leave', auth, (req, res) => { - const { id } = req.params; - - const room = Room.rooms.get(id); - - if (!room) { - return res.json({ status: 'fail', message: 'ROOM_NOT_FOUND' }); - } - - const fakeClient = { id: 'server-joined', isServer: true }; - room.eject(fakeClient); - - res.json({ status: 'success' }); -}); - -router.get('/room/:id', (req, res) => { - const { id } = req.params; - - const room = Room.rooms.get(id); - - if (!room) { - return res.json({ status: 'fail', message: 'ROOM_NOT_FOUND' }); - } - - res.json({ status: 'success', room: room.toJSON() }); -}); - -router.get('/rooms', (req, res) => { - const rooms = []; - - for (const [id, room] of Room.rooms) { - rooms.push({ - id, - name: room.name, - accessType: room.accessType, - joinType: room.joinType, - description: room.description, - clientCount: room.clients.size - }); - } - - res.json({ status: 'success', rooms }); -}); - -router.get('/clients', (req, res) => { - const clients = []; - - for (const [id, client] of Client.clients) { - clients.push({ - id, - rooms: [...client.rooms], - pairs: [...client.pairs] - }); - } - - res.json({ status: 'success', clients }); -}); - -router.post('/webhook', auth, (req, res) => { - const { url, events } = req.body; - - if (!url) { - return res.json({ status: 'fail', message: 'URL_REQUIRED' }); - } - - const server = req.server; - webhooks.set(server.domain, { url, events: events || ['server/pack', 'server/pack/room'] }); - - res.json({ status: 'success' }); -}); - -function triggerWebhook(event, data) { - for (const [, webhook] of webhooks) { - if (webhook.events.includes(event)) { - fetch(webhook.url, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ event, data }) - }).catch(console.error); - } - } -} - -module.exports = router; -module.exports.triggerWebhook = triggerWebhook; diff --git a/Source/config.js b/Source/config.js deleted file mode 100644 index 81463b8..0000000 --- a/Source/config.js +++ /dev/null @@ -1 +0,0 @@ -exports.termoutput = false; \ No newline at end of file diff --git a/Source/index.js b/Source/index.js deleted file mode 100644 index 4c69dcc..0000000 --- a/Source/index.js +++ /dev/null @@ -1,26 +0,0 @@ -require("./HTTPServer.js"); - -const { http } = require("./HTTPServer"); - -const WebSocket = require("./WebSocket"); -WebSocket.init(http); - -require("./Services/YourID.js"); -require("./Services/Auth.js"); -require("./Services/Room.js"); -require("./Services/DataTransfer.js"); -require("./Services/IPPressure.js"); -require("./Services/Session.js"); - -process.on('unhandledRejection',(reason, promise)=>{ - console.log("Process unhandledRejection",{reason, promise}) -}); -process.on('rejectionHandled',(promise)=>{ - console.log("Process rejectionHandled",{promise}) -}); -process.on('multipleResolves',(type, promise, value)=>{ - console.log("Process multipleResolves",{type, promise, value}) -}); -process.on('warning',(err)=>{ - console.log("Process warning", err) -}); diff --git a/frontend/Connection.ts b/frontend/Connection.ts deleted file mode 100644 index ea8ef5f..0000000 --- a/frontend/Connection.ts +++ /dev/null @@ -1,136 +0,0 @@ -import MWSE from "frontend"; - -export interface IConnection{ - endpoint: string; - autoReconnect?: boolean | { - timeout: number; - } -} -export class Connection -{ - public ws! : WebSocket; - public endpoint : URL; - public autoPair : boolean = false; - public connected : boolean = false; - - public autoReconnect : boolean = true; - public autoReconnectTimeout : number = 3000; - public autoReconnectTimer? : number; - constructor(mwse:MWSE, options: IConnection){ - - if(options.endpoint == "auto") - { - const RootURL : string = ( document.currentScript).src - let scriptPath = new URL(RootURL); - let isSecurity = scriptPath.protocol == "https:"; - let dumeUrl = scriptPath.pathname.split('/').slice(0,-1).join('/') + '/'; - let wsSocket = new URL(dumeUrl, scriptPath); - wsSocket.protocol = isSecurity ? 'wss:' : 'ws:'; - this.endpoint = new URL(wsSocket.href); - }else{ - try{ - // Testing - this.endpoint = new URL(options.endpoint); - }catch{ - throw new Error("endpoint is required") - } - } - if(typeof options.autoReconnect == "boolean") - { - this.autoReconnect = true; - }else if(options.autoReconnect) - { - this.autoReconnect = true; - this.autoReconnectTimeout = options.autoReconnect.timeout; - } - } - public connect() - { - if(this.autoReconnectTimer) - { - clearTimeout(this.autoReconnectTimer) - }; - this.ws = new WebSocket(this.endpoint.href); - this.addWSEvents(); - } - public disconnect() - { - /** - * Eğer bilinerek elle kapatıldıysa otomatik tekrar bağlanmasının - * önüne geçmek için autoReconnect bayrağını her zaman kapalı tutmak gerekir - */ - this.autoReconnect = false; - this.ws.close(); - } - public addWSEvents() - { - this.ws.addEventListener("open", () => this.eventOpen()); - this.ws.addEventListener("close", () => this.eventClose()); - this.ws.addEventListener("error", () => this.eventError()); - this.ws.addEventListener("message", ({data}) => this.eventMessage(data as string | ArrayBuffer)); - } - private eventOpen() - { - this.connected = true; - for (const callback of this.activeConnectionEvent) { - callback(void 0); - } - } - private eventClose() - { - for (const callback of this.passiveConnectionEvent) { - callback(void 0); - } - this.connected = false; - if(this.autoReconnect) - { - this.autoReconnectTimer = setTimeout(() => this.connect(), this.autoReconnectTimeout) as unknown as number; - } - } - private eventError() - { - this.connected = false; - } - private recaivePackEvent : ((data:any) => any)[] = []; - public onRecaivePack(func:(data:any) => any) - { - this.recaivePackEvent.push(func); - } - private activeConnectionEvent : Function[] = []; - public onActive(func:Function) - { - if(this.connected) - { - func() - }else{ - this.activeConnectionEvent.push(func); - } - } - private passiveConnectionEvent : Function[] = []; - public onPassive(func:Function) - { - if(!this.connected) - { - func() - }else{ - this.passiveConnectionEvent.push(func); - } - } - private eventMessage(data: string | ArrayBuffer) - { - if(typeof data == "string") - { - let $data = JSON.parse(data); - for (const callback of this.recaivePackEvent) { - callback($data); - } - } - } - public tranferToServer(data:any) - { - if(this.connected) - { - this.ws.send(JSON.stringify(data)); - } - } -} \ No newline at end of file diff --git a/frontend/EventPool.ts b/frontend/EventPool.ts deleted file mode 100644 index 89799d2..0000000 --- a/frontend/EventPool.ts +++ /dev/null @@ -1,68 +0,0 @@ -import MWSE from "./index"; -import { Message } from "./WSTSProtocol"; - -export default class EventPool -{ - public wsts : MWSE; - public events : Map = new Map(); - public signals : Map = new Map(); - - public requests : Map = new Map(); - - public count = 0; - constructor(wsts:MWSE){ - this.wsts = wsts; - } - /** - * request sends a packet that expects a correlated reply and resolves with it. - * Use it ONLY for response-bearing packets. For fire-and-forget (WOM) packets - * use only(): registering a waiter for a packet the server never answers leaves - * a promise pending forever (issue #33). - */ - public request(msg: Message) : Promise - { - return new Promise((ok,rej) => { - let id = ++this.count; - this.events.set(id,[ - (data:any) => { - ok(data); - }, - (data:any) => { - rej(data); - } - ]); - this.wsts.WSTSProtocol.SendRequest(msg, id); - }) - } - /** - * only is the WOM (without-me / fire-and-forget) path: it sends the packet and - * leaves NO pending waiter. The engine deliberately does not reply to these - * relays (it returns nil), so there is nothing to await. This is the separation - * issue #33 requires: request() = response-bearing, only() = WOM. - */ - public only(msg: Message) - { - this.wsts.WSTSProtocol.SendOnly(msg); - } - public stream(msg: Message, callback: Function) - { - let id = ++this.count; - this.wsts.WSTSProtocol.StartStream(msg, id); - this.events.set(id,[ - (data:any) => { - callback(data); - }, - () => { } - ]); - } - public signal(event: string, callback: Function) - { - let T = this.signals.get(event); - if(!T) - { - this.signals.set(event, [callback]); - }else{ - T.push(callback); - } - } -} \ No newline at end of file diff --git a/frontend/EventTarget.ts b/frontend/EventTarget.ts deleted file mode 100644 index a1b76d7..0000000 --- a/frontend/EventTarget.ts +++ /dev/null @@ -1,32 +0,0 @@ -export default class EventTarget -{ - private events : {[key:string]:Function[]} = {}; - public emit(eventName :string, ...args:any[]) - { - if(this.events[eventName]) - { - for (const callback of this.events[eventName]) { - callback(...args); - } - } - } - public on(eventName :string, callback:Function) - { - if(this.events[eventName]) - { - this.events[eventName].push(callback) - }else{ - this.events[eventName] = [callback]; - } - } - public activeScope : boolean = false; - scope(f:Function) - { - if(this.activeScope) - { - f() - }else{ - this.on('scope', f) - } - } -} \ No newline at end of file diff --git a/frontend/IPPressure.ts b/frontend/IPPressure.ts deleted file mode 100644 index 933f94a..0000000 --- a/frontend/IPPressure.ts +++ /dev/null @@ -1,198 +0,0 @@ -import MWSE from "frontend"; - -export class IPPressure -{ - public mwse : MWSE; - public APNumber? : number; - public APShortCode? : string; - public APIPAddress? : string; - constructor(mwse : MWSE){ - this.mwse = mwse; - }; - public async allocAPIPAddress() - { - let {status,ip} = await this.mwse.EventPooling.request({ - type: 'alloc/APIPAddress' - }) as { - status:"fail"|"success", - ip?:string - }; - if(status == 'success') - { - this.APIPAddress = ip; - return ip; - }else{ - throw new Error("Error Allocated Access Point IP Address"); - } - } - public async allocAPNumber() - { - let {status,number} = await this.mwse.EventPooling.request({ - type: 'alloc/APNumber' - }) as { - status:"fail"|"success", - number?:number - }; - if(status == 'success') - { - this.APNumber = number; - return number; - }else{ - throw new Error("Error Allocated Access Point Number"); - } - } - public async allocAPShortCode() - { - let {status,code} = await this.mwse.EventPooling.request({ - type: 'alloc/APShortCode' - }) as { - status:"fail"|"success", - code?:string - }; - if(status == 'success') - { - this.APShortCode = code; - return code; - }else{ - throw new Error("Error Allocated Access Point Short Code"); - } - } - public async reallocAPIPAddress() - { - let {status,ip} = await this.mwse.EventPooling.request({ - type: 'realloc/APIPAddress' - }) as { - status:"fail"|"success", - ip?:string - }; - if(status == 'success') - { - this.APIPAddress = ip; - return ip; - }else{ - throw new Error("Error Reallocated Access Point IP Address"); - } - } - public async reallocAPNumber() - { - let {status,number} = await this.mwse.EventPooling.request({ - type: 'realloc/APNumber' - }) as { - status:"fail"|"success", - number?:number - }; - if(status == 'success') - { - this.APNumber = number; - return number; - }else{ - throw new Error("Error Reallocated Access Point Number"); - } - } - public async reallocAPShortCode() - { - let {status,code} = await this.mwse.EventPooling.request({ - type: 'realloc/APShortCode' - }) as { - status:"fail"|"success", - code?:string - }; - if(status == 'success') - { - this.APShortCode = code; - return code; - }else{ - throw new Error("Error Reallocated Access Point Short Code"); - } - } - public async releaseAPIPAddress() - { - let {status} = await this.mwse.EventPooling.request({ - type: 'release/APIPAddress' - }) as { - status:"fail"|"success", - }; - if(status == 'success') - { - this.APIPAddress = undefined; - }else{ - throw new Error("Error release Access Point IP Address"); - } - } - public async releaseAPNumber() - { - let {status} = await this.mwse.EventPooling.request({ - type: 'release/APNumber' - }) as { - status:"fail"|"success", - }; - if(status == 'success') - { - this.APNumber = undefined; - }else{ - throw new Error("Error release Access Point Number"); - } - } - public async releaseAPShortCode() - { - let {status} = await this.mwse.EventPooling.request({ - type: 'release/APShortCode' - }) as { - status:string - }; - if(status == 'success') - { - this.APShortCode = undefined; - }else{ - throw new Error("Error release Access Point Short Code"); - } - } - public async queryAPIPAddress(ip:string) - { - let {status,socket} = await this.mwse.EventPooling.request({ - type: 'whois/APIPAddress', - whois: ip - }) as { - status:"fail"|"success", - socket?:string - }; - if(status == "success") - { - return socket; - }else{ - return null; - } - } - public async queryAPNumber(number:number) - { - let {status,socket} = await this.mwse.EventPooling.request({ - type: 'whois/APNumber', - whois: number - }) as { - status:"fail"|"success", - socket?:string - }; - if(status == "success") - { - return socket; - }else{ - return null; - } - } - public async queryAPShortCode(code:string) - { - let {status,socket} = await this.mwse.EventPooling.request({ - type: 'whois/APShortCode', - whois: code - }) as { - status:"fail"|"success", - socket?:string - }; - if(status == "success") - { - return socket; - }else{ - return null; - } - } -} \ No newline at end of file diff --git a/frontend/P2PFileSender.ts b/frontend/P2PFileSender.ts deleted file mode 100644 index 98ec1af..0000000 --- a/frontend/P2PFileSender.ts +++ /dev/null @@ -1,262 +0,0 @@ -import WebRTC from "./WebRTC"; -import Peer from "./Peer"; - -/** - * Deneyseldir kullanılması önerilmez - */ -export default class P2PFileSender -{ - public rtc : RTCPeerConnection; - public peer : Peer; - public webrtc : WebRTC; - - public totalSize : number = 0; - public isReady : boolean = false; - public isStarted : boolean = false; - public isSending : boolean = false; - public isRecaiving : boolean = false; - public processedSize : number = 0; - public recaivedFile? : File; - - public bufferSizePerChannel : number = 10e6; - public bufferSizePerPack : number = 10e3; - public safeBufferSizePerPack : number = 10e3 - 1; - - public constructor(webrtc : WebRTC, peer : Peer) - { - this.webrtc = webrtc; - this.rtc = webrtc.rtc; - this.peer = peer; - } - public async RecaiveFile( - _rtc: RTCPeerConnection, - fileMetadata: {name:string, type:string}, - channelCount: number, - _totalSize: number, - onEnded: Function - ) - { - //let totals = {}; - // let index = 0; - /*setChannelStatus(Array.from({length:channelCount}).map((e, index) => { - return { - name: `${index+1}. Kanal`, - current: 0, - currentTotal: 0, - total: 0 - } - }));*/ - let parts : Blob[] = []; - this.webrtc.on('datachannel',(datachannel:RTCDataChannel) => { - //let channelIndex = index++; - let current = 0; - let totalSize = 0; - let currentPart = 0; - let bufferAmount : ArrayBuffer[] = []; - datachannel.onmessage = function({data}){ - if(totalSize == 0) - { - let { - size, - part, - } = JSON.parse(data); - totalSize = size; - currentPart = part; - /*updateChannelStatus(channelIndex, n => { - return { - ...n, - total: totalSize, - current: 0 - } - });*/ - datachannel.send("READY"); - }else{ - current += data.byteLength; - bufferAmount.push(data); - /*updateChannelStatus(channelIndex, n => { - return { - ...n, - current: data.byteLength + n.current, - currentTotal: data.byteLength + n.currentTotal, - } - }); - setProcessedSize(n => n + data.byteLength);*/ - if(current == totalSize) - { - parts[currentPart] = new Blob(bufferAmount); - bufferAmount = []; - //totals[datachannel.label] += totalSize; - totalSize = 0; - currentPart = 0; - current = 0; - datachannel.send("TOTAL_RECAIVED"); - } - } - }; - datachannel.onclose = () => { - channelCount--; - if(channelCount == 0) - { - let file = new File(parts, fileMetadata.name, { - type: fileMetadata.type, - lastModified: +new Date - }); - onEnded(file); - } - }; - }) - } - public async SendFile( - file: File, - metadata: object - ) - { - this.isSending = true; - this.isStarted = true; - - - let buffer = await file.arrayBuffer(); - let partCount = Math.ceil(buffer.byteLength / 10e6); - let channelCount = Math.min(5, partCount); - - if(this.webrtc.iceStatus != "connected") - { - throw new Error("WebRTC is a not ready") - } - - this.peer.send({ - type: 'file', - name: file.name, - size: file.size, - mimetype: file.type, - partCount, - channelCount, - metadata: metadata - }); - - let channels : RTCDataChannel[] = []; - - for(let channelIndex = 0; channelIndex < channelCount; channelIndex++) - { - let channel = this.rtc.createDataChannel("\\?\\file_" + channelIndex); - channel.binaryType = "arraybuffer"; - await new Promise(ok => { - channel.onopen = () => { - ok(void 0); - } - }); - channels.push(channel); - }; - - let currentPart = 0; - let next = () => { - if(currentPart < partCount) - { - let bufferPart = buffer.slice(currentPart * 10e6, currentPart * 10e6 + 10e6) - currentPart++; - return [bufferPart, currentPart - 1]; - }; - return [false,0]; - }; - let spyChannelIndex = channels.length; - await new Promise(ok => { - for (let channelIndex = 0; channelIndex < channels.length; channelIndex++) - { - this.sendPartition( - channels[channelIndex], - next, - channelIndex, - () => { - spyChannelIndex--; - if(spyChannelIndex == 0) - { - this.isSending = false; - this.isStarted = false; - ok(undefined) - } - } - ); - } - }) - } - protected sendPartition( - channel: RTCDataChannel, - nextblob10mb: () => (number | ArrayBuffer)[] | (number | boolean)[], - _channelIndex: number, - onEnded: Function - ) - { - let [currentBuffer,currentPartition] = nextblob10mb(); - let currentPart = 0; - let next = () => { - if(!(currentBuffer instanceof ArrayBuffer)) - { - return; - } - let bufferPart = currentBuffer.slice(currentPart * 16e3, currentPart * 16e3 + 16e3) - currentPart++; - if(bufferPart.byteLength != 0) - { - /* - updateChannelStatus(channelIndex, n => { - return { - ...n, - current: bufferPart.byteLength + n.current, - currentTotal: bufferPart.byteLength + n.currentTotal - } - }); - setProcessedSize(n => n + bufferPart.byteLength); - */ - return bufferPart - } - }; - channel.addEventListener("message",({data}) => { - if(data == "READY") - { - this.sendFileChannel(channel, next) - } - if(data == "TOTAL_RECAIVED") - { - [currentBuffer,currentPartition] = nextblob10mb(); - currentPart = 0; - if(currentBuffer != false) - { - /*updateChannelStatus(channelIndex, n => { - return { - ...n, - total: currentBuffer.byteLength, - current: 0, - } - });*/ - channel.send(JSON.stringify({ - size: (currentBuffer as ArrayBuffer).byteLength, - part: currentPartition - })) - }else{ - channel.close(); - onEnded(); - } - } - }); - channel.send(JSON.stringify({ - size: (currentBuffer as ArrayBuffer).byteLength, - part: currentPartition - })) - } - protected sendFileChannel( - channel: RTCDataChannel, - getNextBlob: () => ArrayBuffer | undefined - ) - { - channel.addEventListener("bufferedamountlow",function(){ - let buffer = getNextBlob(); - if(buffer) - { - channel.send(buffer); - } - }); - channel.bufferedAmountLowThreshold = 16e3 - 1; - let c = getNextBlob(); - c && channel.send(c); - } -}; \ No newline at end of file diff --git a/frontend/Peer.ts b/frontend/Peer.ts deleted file mode 100644 index 5a19c36..0000000 --- a/frontend/Peer.ts +++ /dev/null @@ -1,237 +0,0 @@ -import EventTarget from "./EventTarget"; -import { PeerInfo } from "./PeerInfo"; -import WebRTC from "./WebRTC"; -import MWSE from "./index"; - -interface IPeerOptions{ - -}; - -enum IMessageSymbase -{ - PayloadMessagePack = -12873.54, - PayloadRTCBasePack = -12884.54 -} - - -export default class Peer extends EventTarget -{ - public mwse : MWSE; - public options : IPeerOptions = {}; - public socketId? : string; - public selfSocket : boolean = false; - public active : boolean = false; - public info : PeerInfo; - public rtc : WebRTC; - public peerConnection : boolean = false; - public primaryChannel : "websocket" | "datachannel" = "datachannel"; - constructor(wsts:MWSE){ - super(); - this.mwse = wsts; - this.rtc = this.createRTC(); - this.info = new PeerInfo(this); - this.on('pack',(data:{type?:string,action?:IMessageSymbase,payload?:any}) => { - if(data.type == ':rtcpack:') - { - return this.rtc.emit("input", data.payload) - }; - this.emit("message", data); - }); - } - public createRTC(rtcConfig?: RTCConfiguration | undefined, rtcServers?: RTCIceServer[] | undefined) : WebRTC - { - this.rtc = new WebRTC(rtcConfig,rtcServers); - this.rtc.peer = this; - this.rtc.on("connected", () => { - this.peerConnection = true; - }); - this.rtc.on('disconnected', () => { - this.peerConnection = false; - }) - this.rtc.on("output",(payload:object) => { - this.send({ - type: ':rtcpack:', - payload: payload - }) - }); - this.rtc.on("message",(payload:object) => { - this.emit("pack",payload); - }); - return this.rtc; - } - public setPeerOptions(options: string | IPeerOptions){ - if(typeof options == "string") - { - this.setSocketId(options) - }else{ - this.options = options; - } - } - public setSocketId(uuid: string){ - this.socketId = uuid; - } - async metadata() : Promise - { - if(this.socketId == 'me') - { - let result = await this.mwse.EventPooling.request({ - type:'my/socketid' - }); - this.selfSocket = true; - this.active ||= true; - this.socketId = result; - this.emit('scope'); - this.activeScope = true; - return result; - } - }; - - async request(pack:any){ - if(this.active) - { - return await this.mwse.request(this.socketId as string, pack); - } - }; - equalTo(peer : Peer | {socketId: string}) - { - return this.socketId == peer.socketId; - } - async isReachable() - { - return await this.mwse.EventPooling.request({ - type:'is/reachable', - to: this.socketId - }); - } - async enablePairAuth(){ - await this.mwse.EventPooling.request({ - type:'auth/pair-system', - value: 'everybody' - }); - } - async disablePairAuth(){ - await this.mwse.EventPooling.request({ - type:'auth/pair-system', - value: 'disable' - }); - } - async enablePairInfo(){ - await this.mwse.EventPooling.request({ - type: 'connection/pairinfo', - value: true - }); - } - async disablePairInfo(){ - await this.mwse.EventPooling.request({ - type: 'connection/pairinfo', - value: false - }); - } - async requestPair() - { - let {message,status} = await this.mwse.EventPooling.request({ - type:'request/pair', - to: this.socketId - }); - if( - message == "ALREADY-PAIRED" || - message == "ALREADY-REQUESTED" - ) - { - console.warn("Already paired or pair requested") - }; - if(status == "fail") - { - console.error("Request Pair Error",status, message); - return false; - } - return true; - } - async endPair() - { - await this.mwse.EventPooling.request({ - type:'end/pair', - to: this.socketId - }); - this.forget(); - } - async acceptPair() - { - let {message,status} = await this.mwse.EventPooling.request({ - type:'accept/pair', - to: this.socketId - }); - if(status == "fail") - { - console.error("Pair Error",status, message); - return false; - } - return true; - } - async rejectPair() - { - let {message,status} = await this.mwse.EventPooling.request({ - type:'reject/pair', - to: this.socketId - }); - if(status == "fail") - { - console.error("Pair Error",status, message); - return false; - } - return true; - } - async getPairedList() : Promise - { - let {value} = await this.mwse.EventPooling.request({ - type:'pair/list', - to: this.socketId - }); - return value; - } - async send(pack: any){ - let isOpenedP2P = this.peerConnection && this.rtc?.active; - let isOpenedServer = this.mwse.server.connected; - let sendChannel : "websocket" | "datachannel"; - if(isOpenedP2P && isOpenedServer) - { - if(this.primaryChannel == "websocket") - { - sendChannel = "websocket" - }else - { - sendChannel = "datachannel" - } - }else if(isOpenedServer){ - sendChannel = "websocket" - }else{ - sendChannel = "datachannel" - } - - if(sendChannel == "websocket") - { - if(!this.mwse.writable){ - return console.warn("Socket is not writable"); - } - // WOM (fire-and-forget): a plain peer.send expects no reply, so use the - // only() path and leave no pending waiter. Using request() here would - // register a promise the engine never resolves (issue #33). - this.mwse.EventPooling.only({ - type:'pack/to', - pack, - to: this.socketId - }); - }else{ - if(pack.type != ':rtcpack:') - { - this.rtc?.sendMessage(pack) - }else{ - return console.warn("Socket is not writable"); - } - } - } - async forget(){ - this.mwse.peers.delete(this.socketId as string); - this.mwse.pairs.delete(this.socketId as string); - } -} \ No newline at end of file diff --git a/frontend/PeerInfo.ts b/frontend/PeerInfo.ts deleted file mode 100644 index af32ae0..0000000 --- a/frontend/PeerInfo.ts +++ /dev/null @@ -1,48 +0,0 @@ -import Peer from "./Peer"; - -export class PeerInfo -{ - public peer : Peer; - public info : {[key:string]: any} = {}; - constructor(mwse : Peer){ - this.peer = mwse; - }; - public async fetch(name?:string) - { - if(name) - { - let rinfo = await this.peer.mwse.EventPooling.request(({ - type: "peer/info", - peer: this.peer.socketId, - name - })); - if(rinfo.status == "success") - { - this.info = rinfo.info; - }else console.warn(rinfo.message); - }else{ - let rinfo = await this.peer.mwse.EventPooling.request(({ - type: "peer/info", - peer: this.peer.socketId - })); - if(rinfo.status == "success") - { - this.info = rinfo.info; - }else console.warn(rinfo.message); - }; - return this.info; - } - public set(name: string, value: string | number) - { - this.info[name] = value; - this.peer.mwse.WSTSProtocol.SendOnly({ - type: "auth/info", - name, - value - }); - } - public get(name?:string) - { - return name ? this.info[name] : this.info; - } -} \ No newline at end of file diff --git a/frontend/Room.ts b/frontend/Room.ts deleted file mode 100644 index 20d2f24..0000000 --- a/frontend/Room.ts +++ /dev/null @@ -1,182 +0,0 @@ -import EventTarget from "./EventTarget"; -import MWSE from "./index"; -import Peer from "./Peer"; -import { RoomInfo } from "./RoomInfo"; - -export interface IRoomOptions -{ - name: string; - description?:string; - joinType: "free"|"invite"|"password"|"lock"; - credential?: string; - ifexistsJoin?: boolean; - accessType?: "public"|"private"; - notifyActionInvite?: boolean; - notifyActionJoined?: boolean; - notifyActionEjected?: boolean; - autoFetchInfo?:boolean -} - - -export default class Room extends EventTarget -{ - public mwse : MWSE; - public options! : IRoomOptions; - public config! : IRoomOptions; - public roomId? : string; - public accessType? : "public"|"private"; - public description? : string; - public joinType? : "free"|"invite"|"password"|"lock"; - public name? : string; - public owner? : string; - public peers : Map = new Map(); - public info : RoomInfo; - - constructor(wsts:MWSE){ - super(); - this.mwse = wsts; - this.info = new RoomInfo(this); - } - public setRoomOptions(options : IRoomOptions | string) - { - if(typeof options == "string") - { - this.roomId = options; - }else{ - let defaultOptions = { - joinType: "free", - ifexistsJoin: true, - accessType: "private", - notifyActionInvite: true, - notifyActionJoined: true, - notifyActionEjected: true, - autoFetchInfo: true - }; - Object.assign(defaultOptions,options); - this.config = defaultOptions as IRoomOptions; - } - } - - setRoomId(uuid: string){ - this.roomId = uuid; - } - async createRoom(roomOptions : IRoomOptions){ - let config = this.config || roomOptions; - let result = await this.mwse.EventPooling.request({ - type:'create-room', - ...config - }); - if(result.status == 'fail') - { - if(result.message == "ALREADY-EXISTS" && this.config.ifexistsJoin) - { - return this.join(); - } - throw new Error(result.message || result.messages); - }else{ - this.options = { - ...this.config, - ...result.room - }; - this.roomId = result.room.id; - this.mwse.rooms.set(this.roomId as string, this); - } - } - async join(){ - let result = await this.mwse.EventPooling.request({ - type:'joinroom', - name: this.config.name, - credential: this.config.credential, - autoFetchInfo: this.config.autoFetchInfo || false - }); - if(result.status == 'fail') - { - throw new Error(result.message); - }else{ - this.options = { - ...this.config, - ...result.room - }; - if(result.info) - { - this.info.info = result.info; - }; - this.roomId = result.room.id; - this.mwse.rooms.set(this.roomId as string, this); - } - } - async eject(){ - let {type} = await this.mwse.EventPooling.request({ - type:'ejectroom', - roomId: this.roomId - }); - this.peers.clear(); - if(type == 'success') - { - this.mwse.rooms.delete(this.roomId as string); - } - } - async send(pack: any, wom:boolean = false, handshake = false){ - if(!this.mwse.writable){ - return console.warn("Socket is not writable"); - } - if(handshake) - { - let {type} = await this.mwse.EventPooling.request({ - type:'pack/room', - pack, - to: this.roomId, - wom, - handshake - }) as { - type:"success"|"fail" - }; - if(type == "fail"){ - throw new Error("Cant send message to room") - } - }else{ - // WOM broadcast: fire-and-forget, no waiter (issue #33). When the caller - // wants delivery confirmation it passes handshake=true (branch above), - // which the engine answers with a {type} ack. - this.mwse.EventPooling.only({ - type:'pack/room', - pack, - to: this.roomId, - wom, - handshake - }) - } - } - async fetchPeers(filter?:{[key:string]:any}, onlyNumber:boolean = false) : Promise - { - if(onlyNumber) - { - let {count} = await this.mwse.EventPooling.request({ - type:'room/peer-count', - roomId: this.roomId, - filter: filter || {} - }) as {count:Number}; - return count; - }else{ - let {status, peers} = await this.mwse.EventPooling.request({ - type:'room-peers', - roomId: this.roomId, - filter: filter || {} - }) as {status:"success"|"fail", peers: string[]}; - - let cup : Peer[] = []; - - if(status == 'fail') - { - throw new Error("Cant using peers on room") - }else if(status == 'success'){ - for (const peerid of peers) { - let peer = this.mwse.peer(peerid,true); - cup.push(peer); - this.peers.set(peerid, peer); - } - }; - return cup; - } - } -} \ No newline at end of file diff --git a/frontend/RoomInfo.ts b/frontend/RoomInfo.ts deleted file mode 100644 index a2261eb..0000000 --- a/frontend/RoomInfo.ts +++ /dev/null @@ -1,52 +0,0 @@ -import Room from "./Room"; - -export class RoomInfo -{ - public room : Room; - public info : {[key:string]: any} = {}; - constructor(room : Room){ - this.room = room; - this.room.on('updateinfo',(name:string,value:any) => { - this.info[name] = value; - }) - }; - public async fetch(name?:string) - { - if(name) - { - let rinfo = await this.room.mwse.EventPooling.request(({ - type: "room/getinfo", - roomId: this.room.roomId, - name - })); - if(rinfo.status == "success") - { - this.info = rinfo.value; - }else console.warn(rinfo.message); - }else{ - let rinfo = await this.room.mwse.EventPooling.request(({ - type: "room/info", - roomId: this.room.roomId - })); - if(rinfo.status == "success") - { - this.info = rinfo.value; - }else console.warn(rinfo.message); - }; - return this.info; - } - public set(name: string, value: string | number) - { - this.info[name] = value; - this.room.mwse.WSTSProtocol.SendOnly({ - type: "room/setinfo", - roomId: this.room.roomId, - name, - value - }); - } - public get(name?:string) - { - return name ? this.info[name] : this.info; - } -} \ No newline at end of file diff --git a/frontend/WSTSProtocol.ts b/frontend/WSTSProtocol.ts deleted file mode 100644 index 3556b27..0000000 --- a/frontend/WSTSProtocol.ts +++ /dev/null @@ -1,66 +0,0 @@ -import MWSE from "./index"; - -export interface Message { - [key:string|number]:any; -} -export default class WSTSProtocol -{ - public mwse : MWSE; - constructor(wsts:MWSE){ - this.mwse = wsts; - this.addListener(); - } - public addListener() - { - this.mwse.server?.onRecaivePack((pack)=>{ - this.PackAnalyze(pack) - }) - } - public SendRaw(pack: Message) - { - this.mwse.server.tranferToServer(pack); - } - public SendOnly(pack: Message) - { - this.mwse.server.tranferToServer([pack,'R']); - } - public SendRequest(pack: Message, id: number) - { - this.mwse.server.tranferToServer([pack, id, 'R']); - } - public StartStream(pack: Message, id: number) - { - this.mwse.server.tranferToServer([pack, id, 'S']); - } - public PackAnalyze(data:any) - { - let [payload, id, action] = data; - if(typeof id === 'number') - { - let callback = this.mwse.EventPooling.events.get(id); - if(callback) - { - callback[0](payload, action); - switch(action) - { - case 'E':{ // [E]ND flag - this.mwse.EventPooling.events.delete(id); - break; - } - case 'S': // [S]TREAM flag - default:{ - break; - } - } - }else console.warn("Missing event sended from server"); - }else{ - let signals = this.mwse.EventPooling.signals.get(id); - if(signals) - { - for (const callback of signals) { - callback(payload); - } - }else console.warn("Missing event sended from server"); - } - } -} \ No newline at end of file diff --git a/frontend/WebRTC.ts b/frontend/WebRTC.ts deleted file mode 100644 index 1c90ba5..0000000 --- a/frontend/WebRTC.ts +++ /dev/null @@ -1,522 +0,0 @@ -import P2PFileSender from "./P2PFileSender"; -import Peer from "./Peer"; -interface TransferStreamInfo -{ - senders : RTCRtpSender[]; - recaivers : RTCRtpReceiver[]; - stream:MediaStream | undefined; - id:string; - name:string; -} - -export default class WebRTC -{ - public static channels : Map = new Map(); - public static requireGC : boolean = false; - public id : any; - public active : boolean = false; - public connectionStatus : "closed" | "connected" | "connecting" | "disconnected" | "failed" | "new" = "new"; - public iceStatus : "checking" | "closed" | "completed" | "connected" | "disconnected" | "failed" | "new" = "new"; - public gatheringStatus : "complete" | "gathering" | "new" = "new"; - public signalingStatus : "" | "closed" | "have-local-offer" | "have-local-pranswer" | "have-remote-offer" | "have-remote-pranswer" | "stable" = "" - public rtc! : RTCPeerConnection; - public recaivingStream : Map = new Map(); - public sendingStream : Map = new Map(); - public events : { [eventname:string]: Function[] } = {}; - public channel : RTCDataChannel | undefined; - - public static defaultRTCConfig : RTCConfiguration = { - iceCandidatePoolSize: 0, - iceTransportPolicy:"all", - rtcpMuxPolicy:"require", - }; - - private isPolite() : boolean - { - let myId = this.peer?.mwse.peer('me').socketId as string; - let peerId = this.peer?.socketId as string; - return myId < peerId; - } - - public static defaultICEServers : RTCIceServer[] = [{ - urls: "stun:stun.l.google.com:19302" - },{ - urls: "stun:stun1.l.google.com:19302" - },{ - urls: "stun:stun2.l.google.com:19302" - },{ - urls: "stun:stun3.l.google.com:19302" - },{ - urls: "stun:stun4.l.google.com:19302" - }]; - - public peer? : Peer; - - public FileTransportChannel? : P2PFileSender; - - public makingOffer = false; - public ignoreOffer = false; - public isSettingRemoteAnswerPending = false; - - candicatePack : RTCIceCandidate[] = []; - - - constructor( - rtcConfig?: RTCConfiguration, - rtcServers?: RTCIceServer[] - ) - { - let config : any = {}; - - if(rtcConfig) - { - Object.assign( - config, - WebRTC.defaultRTCConfig, - rtcConfig - ) - }else{ - Object.assign( - config, - WebRTC.defaultRTCConfig - ) - } - - config.iceServers = rtcServers || WebRTC.defaultICEServers; - - this.rtc = new RTCPeerConnection(config as RTCConfiguration); - this.rtc.addEventListener("connectionstatechange",()=>{ - this.eventConnectionState(); - }) - this.rtc.addEventListener("icecandidate",(...args)=>{ - this.eventIcecandidate(...args); - }) - this.rtc.addEventListener("iceconnectionstatechange",()=>{ - this.eventICEConnectionState(); - }) - this.rtc.addEventListener("icegatheringstatechange",()=>{ - this.eventICEGatherinState(); - }) - this.rtc.addEventListener("negotiationneeded",()=>{ - this.eventNogationNeeded(); - }) - this.rtc.addEventListener("signalingstatechange",()=>{ - this.eventSignalingState(); - }) - this.rtc.addEventListener("track",(...args)=>{ - this.eventTrack(...args); - }) - this.rtc.addEventListener("datachannel",(...args)=>{ - this.eventDatachannel(...args); - }) - this.on('input',async (data:{[key:string]:any})=>{ - switch(data.type) - { - case "icecandidate":{ - try{ - if(this.rtc.remoteDescription){ - await this.rtc.addIceCandidate(new RTCIceCandidate(data.value)); - }else{ - this.candicatePack.push(new RTCIceCandidate(data.value)) - } - }catch(error){ - debugger; - }finally{ - console.log("ICE Canbet") - } - break; - } - case "offer":{ - let readyForOffer = !this.makingOffer && (this.rtc.signalingState == "stable" || this.isSettingRemoteAnswerPending); - - const offerCollision = !readyForOffer; - - this.ignoreOffer = !this.isPolite() && offerCollision; - - if(this.ignoreOffer){ - return; - } - - this.isSettingRemoteAnswerPending = false; - - await this.rtc.setRemoteDescription(new RTCSessionDescription(data.value)); - - this.isSettingRemoteAnswerPending = false; - - for (const candidate of this.candicatePack) { - await this.rtc.addIceCandidate(candidate); - } - - let answer = await this.rtc.createAnswer({ - offerToReceiveAudio: true, - offerToReceiveVideo: true - }) - await this.rtc.setLocalDescription(answer); - this.send({ - type: 'answer', - value: answer - }); - break; - } - case "answer":{ - await this.rtc.setRemoteDescription(new RTCSessionDescription(data.value)) - - for (const candidate of this.candicatePack) { - await this.rtc.addIceCandidate(candidate); - } - break; - } - case "streamInfo":{ - let {id,value} = data; - let streamInfo = this.recaivingStream.get(id); - if(!streamInfo) - { - this.recaivingStream.set(id,value as TransferStreamInfo); - }else{ - this.recaivingStream.set(id,{ - ...streamInfo, - ...value - } as TransferStreamInfo); - } - this.send({ - type:'streamAccept', - id - }) - break; - } - case "streamRemoved":{ - let {id} = data; - this.emit('stream:stopped', this.recaivingStream.get(id)); - this.recaivingStream.delete(id); - break; - } - case "streamAccept":{ - let {id} = data; - let sendingStream = this.sendingStream.get(id) as TransferStreamInfo; - let senders = []; - if(sendingStream && sendingStream.stream) - { - for (const track of sendingStream.stream.getTracks()) { - senders.push(this.rtc.addTrack(track, sendingStream.stream)); - }; - sendingStream.senders = senders; - } - this.emit('stream:accepted', sendingStream); - break; - } - case "message":{ - this.emit('message', data.payload); - break; - } - } - }) - } - public addEventListener(event:string,callback: Function){ - (this.events[event] || (this.events[event]=[])).push(callback); - }; - public on(event:string,callback: Function){ - this.addEventListener(event, callback) - }; - public async dispatch(event:string,...args:any[]) : Promise { - if(this.events[event]) - { - for (const callback of this.events[event]) - { - await callback(...args) - } - } - } - public async emit(event:string,...args:any[]) : Promise { - await this.dispatch(event, ...args) - } - public connect() - { - if(!this.channel) - { - this.createDefaultDataChannel(); - } - } - public sendMessage(data: any) - { - if(data.type == ':rtcpack:') - { - throw "WebRTC Kanalında Sızma"; - } - this.send({ - type: 'message', - payload: data - }); - } - public createDefaultDataChannel() - { - let dt = this.rtc.createDataChannel(':default:',{ - ordered: true - }); - dt.addEventListener("open",()=>{ - this.channel = dt; - WebRTC.channels.set(this.id, this); - this.active = true; - }); - dt.addEventListener("message",({data})=>{ - let pack = JSON.parse(data); - this.emit('input', pack); - }) - dt.addEventListener("close",()=>{ - this.channel = undefined; - this.active = false; - }) - } - public destroy() - { - this.active = false; - if(this.channel) - { - this.channel.close(); - this.channel = undefined; - } - if(this.rtc) - { - this.rtc.close(); - //this.rtc = undefined; - }; - this.emit('disconnected'); - WebRTC.channels.delete(this.id); - } - public eventDatachannel(event: RTCDataChannelEvent) - { - if(event.channel.label == ':default:'){ - WebRTC.channels.set(this.id, this); - this.channel = event.channel; - this.active = true; - event.channel.addEventListener("message",({data})=>{ - let pack = JSON.parse(data); - this.emit('input', pack); - }) - event.channel.addEventListener("close",()=>{ - this.channel = undefined; - WebRTC.channels.delete(this.id); - WebRTC.requireGC = true; - this.active = false; - }) - }else{ - this.emit('datachannel', event.channel); - } - } - public send(data:object) - { - if(this.channel?.readyState == "open") - { - this.channel.send(JSON.stringify(data)); - }else{ - this.emit('output', data); - } - } - public eventConnectionState() - { - this.connectionStatus = this.rtc.connectionState; - if(this.connectionStatus == 'connected') - { - if(this.active == false) - { - this.emit('connected'); - } - }; - - if(this.connectionStatus == 'failed') - { - this.rtc.restartIce(); - }; - - if(this.connectionStatus == "closed") - { - if(this.active) - { - this.destroy(); - } - } - } - public eventIcecandidate(event: RTCPeerConnectionIceEvent) - { - if(event.candidate) - { - this.send({ - type:'icecandidate', - value: event.candidate - }) - } - } - public eventICEConnectionState() - { - this.iceStatus = this.rtc.iceConnectionState; - } - public eventICEGatherinState() - { - this.gatheringStatus = this.rtc.iceGatheringState; - } - public async eventNogationNeeded() - { - try{ - this.makingOffer = true; - let offer = await this.rtc.createOffer({ - iceRestart: true, - offerToReceiveAudio: true, - offerToReceiveVideo: true - }); - await this.rtc.setLocalDescription(offer); - this.send({ - type: 'offer', - value: offer - }); - }catch(error){ - console.error(`Nogation Error:`, error) - } - finally{ - this.makingOffer = false; - } - } - public eventSignalingState() - { - this.signalingStatus = this.rtc.signalingState; - } - public eventTrack(event: RTCTrackEvent) - { - let rtpRecaiver = event.receiver; - if(event.streams.length) - { - for (const stream of event.streams) { - let streamInfo = this.recaivingStream.get(stream.id) as TransferStreamInfo; - (streamInfo.recaivers || (streamInfo.recaivers = [])).push(rtpRecaiver); - if((this.recaivingStream.get(stream.id) as {stream : MediaStream | undefined}).stream == null) - { - streamInfo.stream = stream; - this.emit('stream:added', this.recaivingStream.get(stream.id)); - }else{ - streamInfo.stream = stream; - } - } - } - } - public sendStream(stream:MediaStream,name:string,info:{[key:string]:any}){ - this.send({ - type: 'streamInfo', - id: stream.id, - value: { - ...info, - name: name - } - }); - this.sendingStream.set(stream.id,{ - ...info, - id:stream.id, - name: name, - stream - } as TransferStreamInfo); - }; - public stopStream(_stream:MediaStream){ - if(this.connectionStatus != 'connected'){ - return - } - if(this.sendingStream.has(_stream.id)) - { - let {stream} = this.sendingStream.get(_stream.id) as {stream:MediaStream}; - - for (const track of stream.getTracks()) { - for (const RTCPSender of this.rtc.getSenders()) { - if(RTCPSender.track?.id == track.id) - { - this.rtc.removeTrack(RTCPSender); - } - } - } - - this.send({ - type: 'streamRemoved', - id: stream.id - }); - this.sendingStream.delete(_stream.id) - } - } - public stopAllStreams() - { - if(this.connectionStatus != 'connected'){ - return - } - for (const [, {stream}] of this.sendingStream) { - if(stream == undefined) - { - continue; - } - for (const track of stream.getTracks()) { - for (const RTCPSender of this.rtc.getSenders()) { - if(RTCPSender.track?.id == track.id) - { - this.rtc.removeTrack(RTCPSender); - } - } - } - this.send({ - type: 'streamRemoved', - id: stream.id - }); - }; - - this.sendingStream.clear(); - } - public async SendFile(file:File, meta: object) - { - if(!this.peer) - { - throw new Error("Peer is not ready"); - } - this.FileTransportChannel = new P2PFileSender(this, this.peer); - - await this.FileTransportChannel.SendFile(file, meta); - } - public async RecaiveFile( - chnlCount:number, - filemeta: { - name: string; - type: string; - }, - totalSize: number - ) : Promise - { - if(!this.peer) - { - throw new Error("Peer is not ready"); - } - this.FileTransportChannel = new P2PFileSender(this, this.peer); - - return await new Promise(recaivedFile => { - if(this.FileTransportChannel) - { - this.FileTransportChannel.RecaiveFile( - this.rtc, - filemeta, - chnlCount, - totalSize, - (file: File) => { - recaivedFile(file) - } - ); - } - }) - } -} - -WebRTC.requireGC = false; -setInterval(()=>{ - if(WebRTC.requireGC == false) return; - let img = document.createElement("img"); - img.src = window.URL.createObjectURL(new Blob([new ArrayBuffer(5e+7)])); - img.onerror = function() { - window.URL.revokeObjectURL(this.src); - }; - WebRTC.requireGC = false; -}, 3000); - -declare global { - interface MediaStream { - senders : RTCRtpSender[]; - } -} \ No newline at end of file diff --git a/frontend/index.ts b/frontend/index.ts deleted file mode 100644 index 241550f..0000000 --- a/frontend/index.ts +++ /dev/null @@ -1,238 +0,0 @@ -import {Connection,IConnection} from "./Connection"; -import EventPool from "./EventPool"; -import EventTarget from "./EventTarget"; -import { IPPressure } from "./IPPressure"; -import Peer from "./Peer"; -import Room, { IRoomOptions } from "./Room"; -import WSTSProtocol, { Message } from "./WSTSProtocol"; -import WebRTC from "./WebRTC"; -//import {Gzip} from "fflate"; -export default class MWSE extends EventTarget { - public static rtc : WebRTC; - public server! : Connection; - public WSTSProtocol! : WSTSProtocol; - public EventPooling! : EventPool; - public rooms : Map = new Map(); - public pairs : Map = new Map(); - public peers : Map = new Map(); - public virtualPressure : IPPressure; - public me! : Peer; - /*public static compress(message:string, callback:(e:any) => any) - { - let u : any= []; - let C = new Gzip({ - level: 9, - mem: 12 - },(stream,isLast) => { - u.push(stream); - if(isLast) - { - callback(u); - } - }); - C.push(new TextEncoder().encode(message), true); - }*/ - constructor(options: IConnection){ - super(); - MWSE.rtc = MWSE as unknown as WebRTC; - this.server = new Connection(this,options); - this.WSTSProtocol = new WSTSProtocol(this); - this.EventPooling = new EventPool(this); - this.virtualPressure = new IPPressure(this); - this.server.connect(); - this.me = new Peer(this); - this.me.scope(()=>{ - this.peers.set('me', this.me); - this.peers.set(this.me.socketId as string, this.me); - }) - this.server.onActive(async ()=>{ - this.me.setSocketId('me'); - await this.me.metadata(); - this.emit('scope'); - this.activeScope = true; - }); - this.server.onPassive(async ()=>{ - this.emit('close'); - }); - this.packMessagingSystem(); - } - - public writable = 1; - public readable = 1; - - public destroy() - { - this.server.disconnect(); - } - - public enableRecaiveData(){ - this.WSTSProtocol.SendOnly({ type: 'connection/packrecaive', value: 1 }) - this.readable = 1 - } - public disableRecaiveData(){ - this.WSTSProtocol.SendOnly({ type: 'connection/packrecaive', value: 0 }) - this.readable = 0 - } - - public enableSendData(){ - this.WSTSProtocol.SendOnly({ type: 'connection/packsending', value: 1 }) - this.writable = 1 - } - public disableSendData(){ - this.WSTSProtocol.SendOnly({ type: 'connection/packsending', value: 0 }) - this.writable = 0 - } - - public enableNotifyRoomInfo(){ - this.WSTSProtocol.SendOnly({ type: 'connection/roominfo', value: 1 }) - } - public disableNotifyRoomInfo(){ - this.WSTSProtocol.SendOnly({ type: 'connection/roominfo', value: 0 }) - } - - public async request(peerId: string, pack:Message) - { - let {pack:answer} = await this.EventPooling.request({ - type: 'request/to', - to: peerId, - pack - }); - return answer; - } - public async response(peerId: string, requestId:number, pack:Message) - { - this.WSTSProtocol.SendOnly({ - type: 'response/to', - to: peerId, - pack, - id: requestId - }) - } - private packMessagingSystem() - { - this.EventPooling.signal('pack',(payload : {from:string,pack:any}) => { - if(this.readable) - { - let {from,pack} = payload; - this.peer(from, true).emit('pack', pack); - } - }) - this.EventPooling.signal('request',(payload : {from:string,pack:any,id:number}) => { - let {from,pack, id} = payload; - let scope = { - body: pack, - response: (pack: Message) => { - this.response(from, id, pack); - }, - peer: this.peer(from, true) - }; - this.peer(from, true).emit('request', scope); - this.peer('me').emit('request', scope); - }) - this.EventPooling.signal('pack/room',(payload : {from:string,pack:any,sender:string}) => { - if(this.readable) - { - let {from,pack,sender} = payload; - this.room(from).emit('message', pack, this.peer(sender)); - } - }) - this.EventPooling.signal('room/joined',(payload : {id:string,roomid:any,ownerid:string}) => { - let {id,roomid} = payload; - let room = this.room(roomid); - let peer = this.peer(id, true); - room.peers.set(peer.socketId as string, peer); - room.emit('join', peer); - }) - this.EventPooling.signal('room/info',(payload : {roomId:string,value:any,name:string}) => { - let {roomId,name,value} = payload; - this.room(roomId).emit('updateinfo', name,value); - }) - this.EventPooling.signal('room/ejected',(payload : {id:string,roomid:any,ownerid:string}) => { - let {id,roomid} = payload; - let room = this.room(roomid); - let peer = this.peer(id, true); - room.peers.delete(peer.socketId as string); - room.emit('eject', peer); - }) - this.EventPooling.signal('room/closed',(payload : {roomid:any}) => { - let {roomid} = payload; - let room = this.room(roomid); - room.peers.clear(); - room.emit('close'); - this.rooms.delete(roomid); - }) - this.EventPooling.signal("pair/info", (payload : {from : string,name: string, value: string | number | boolean}) => { - let {from, name, value} = payload; - let peer = this.peer(from, true); - peer.info.info[name] = value; - peer.emit("info", name, value); - }) - this.EventPooling.signal("request/pair", (payload : {from : string,info: any}) => { - let {from, info} = payload; - let peer = this.peer(from, true); - peer.info.info = info; - peer.emit("request/pair", peer); - this.peer('me').emit('request/pair', peer); - }) - this.EventPooling.signal("peer/disconnect", (payload : {id : string}) => { - let {id} = payload; - let peer = this.peer(id, true); - peer.emit("disconnect", peer); - }) - this.EventPooling.signal("accepted/pair", (payload : {from : string,info: any}) => { - let {from, info} = payload; - let peer = this.peer(from, true); - peer.info.info = info; - peer.emit("accepted/pair", peer); - this.peer('me').emit('accepted/pair', peer); - }) - this.EventPooling.signal("end/pair", (payload : {from : string,info: any}) => { - let {from, info} = payload; - let peer = this.peer(from, true); - peer.emit("end/pair", info); - this.peer('me').emit('end/pair', from, info); - }) - } - public room(options: IRoomOptions | string) : Room - { - if(typeof options == "string") - { - if(this.rooms.has(options)) - { - return this.rooms.get(options) as Room - } - } - let room = new Room(this); - room.setRoomOptions(options); - this.emit('room'); - return room; - } - public peer(options: string | IRoomOptions, isActive = false) : Peer - { - if(typeof options == "string") - { - if(this.peers.has(options)) - { - return this.peers.get(options) as Peer - } - if(this.pairs.has(options)) - { - return this.pairs.get(options) as Peer - } - } - let peer = new Peer(this); - peer.setPeerOptions(options); - peer.active = isActive; - this.peers.set(peer.socketId as string, peer); - this.emit('peer', peer); - return peer; - } -}; - -declare global { - interface Window { - MWSE: any; - } -} - -window.MWSE = MWSE; \ No newline at end of file diff --git a/index.js b/index.js deleted file mode 100644 index 95d25f6..0000000 --- a/index.js +++ /dev/null @@ -1,14 +0,0 @@ -require("./Source/index"); - -process.on('unhandledRejection',(reason, promise)=>{ - console.log("Process unhandledRejection",{reason, promise}) -}); -process.on('rejectionHandled',(promise)=>{ - console.log("Process rejectionHandled",{promise}) -}); -process.on('multipleResolves',(type, promise, value)=>{ - console.log("Process multipleResolves",{type, promise, value}) -}); -process.on('warning',(err)=>{ - console.log("Process warning", err) -}); diff --git a/internal/config/config.go b/internal/config/config.go index eba4316..88f7e01 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -14,9 +14,8 @@ type Config struct { Host string // bind address, e.g. "0.0.0.0" Port int // listen port, default 7707 - PublicDir string // static assets directory (default "./public") - ScriptDir string // legacy compiled SDK bundle directory (default "./script") - SDKDir string // ES-module SDK directory (default "./sdk") + PublicDir string // static assets served at / (default "./public") + SDKDir string // ES-module SDK files served at /sdk/ (default "./sdk") ReadHeaderTimeout time.Duration // HTTP read-header timeout ShutdownTimeout time.Duration // grace period for in-flight work on shutdown @@ -55,17 +54,15 @@ type ConnConfig struct { WriteWait time.Duration // deadline for a single socket write } -// Load reads configuration from the environment, applying defaults that match the -// original server. Recognised variables: +// Load reads configuration from the environment. Recognised variables: // -// MWSE_HOST, MWSE_PORT, MWSE_PUBLIC_DIR, MWSE_SCRIPT_DIR, +// MWSE_HOST, MWSE_PORT, MWSE_PUBLIC_DIR, MWSE_SDK_DIR, // MWSE_SHUTDOWN_TIMEOUT (seconds), MWSE_TERM_OUTPUT (1/true) func Load() Config { return Config{ Host: env("MWSE_HOST", "0.0.0.0"), Port: envInt("MWSE_PORT", 7707), PublicDir: env("MWSE_PUBLIC_DIR", "./public"), - ScriptDir: env("MWSE_SCRIPT_DIR", "./script"), SDKDir: env("MWSE_SDK_DIR", "./sdk"), ReadHeaderTimeout: 10 * time.Second, ShutdownTimeout: time.Duration(envInt("MWSE_SHUTDOWN_TIMEOUT", 10)) * time.Second, diff --git a/internal/httpserver/contract_test.go b/internal/httpserver/contract_test.go index 7e7a11e..f811197 100644 --- a/internal/httpserver/contract_test.go +++ b/internal/httpserver/contract_test.go @@ -29,7 +29,7 @@ func testEngine(t *testing.T) string { cfg := config.Load() cfg.Conn.PingInterval = 80 * time.Millisecond - cfg.ScriptDir = t.TempDir() // static routes are irrelevant here + cfg.SDKDir = t.TempDir() // static routes are irrelevant here cfg.PublicDir = t.TempDir() srv := httptest.NewServer(New(hub, cfg).Handler) diff --git a/internal/httpserver/httpserver.go b/internal/httpserver/httpserver.go index c5c3a67..b31dc53 100644 --- a/internal/httpserver/httpserver.go +++ b/internal/httpserver/httpserver.go @@ -1,7 +1,6 @@ // Package httpserver assembles the HTTP surface of the engine: the WebSocket -// upgrade endpoint, the static asset routes (the built SDK and the public files), -// and the /api control plane. It mirrors the routing of the original -// HTTPServer.js while adding timeouts and graceful shutdown (#25). +// upgrade endpoint, the ES-module SDK routes, the public asset directory, and +// the /api control plane. package httpserver import ( @@ -27,10 +26,8 @@ type ServerOptions struct { Approver ws.Approver } -// New builds the *http.Server. WebSocket upgrades are detected on ANY path and -// routed to the engine (the SDK derives its endpoint from wherever the script was -// served, so the upgrade may arrive at "/" or "/script/"). All other requests go -// through the static/API mux. +// New builds the *http.Server. WebSocket upgrades are detected on any path and +// routed to the engine; all other requests go through the static/API mux. func New(hub *ws.Hub, cfg config.Config, srvOpts ...ServerOptions) *http.Server { var so ServerOptions if len(srvOpts) > 0 { @@ -68,32 +65,24 @@ func New(hub *ws.Hub, cfg config.Config, srvOpts ...ServerOptions) *http.Server // registerStatic wires the asset routes: // -// - /sdk.js -> redirect to /sdk/index.js (so import.meta.url resolves correctly) -// - /sdk/ -> ES-module SDK files (sdk/EventTarget.js, etc.) -// - /script -> legacy compiled SDK entry (script/index.js) -// - /script/ -> files under the script directory -// - / -> the SDK entry (so a bare visit returns the script) -// - / -> a matching file under the public directory -// - anything else -> the status document (status.xml) +// - /sdk.js -> 301 /sdk/index.js (import.meta.url resolves correctly for relative imports) +// - /sdk/ -> ES-module SDK files served from cfg.SDKDir +// - / -> /sdk/index.js redirect (bare URL returns the SDK entry) +// - / -> matching file under cfg.PublicDir +// - anything -> public/status.xml fallback func registerStatic(mux *http.ServeMux, cfg config.Config) { - scriptIndex := filepath.Join(cfg.ScriptDir, "index.js") - statusDoc := filepath.Join(cfg.ScriptDir, "status.xml") + statusDoc := filepath.Join(cfg.PublicDir, "status.xml") - // ES-module SDK: redirect /sdk.js → /sdk/index.js so that import.meta.url - // resolves to /sdk/index.js and all relative imports go to /sdk/*. + // /sdk.js → /sdk/index.js: keeps import.meta.url = /sdk/index.js so that + // ./EventTarget.js etc. resolve to /sdk/EventTarget.js (same origin). mux.HandleFunc("/sdk.js", func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/sdk/index.js", http.StatusMovedPermanently) }) mux.Handle("/sdk/", http.StripPrefix("/sdk/", http.FileServer(http.Dir(cfg.SDKDir)))) - mux.HandleFunc("/script", func(w http.ResponseWriter, r *http.Request) { - http.ServeFile(w, r, scriptIndex) - }) - mux.Handle("/script/", http.StripPrefix("/script/", http.FileServer(http.Dir(cfg.ScriptDir)))) - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/" { - http.ServeFile(w, r, scriptIndex) + http.Redirect(w, r, "/sdk/index.js", http.StatusFound) return } if f, ok := safePublicFile(cfg.PublicDir, r.URL.Path); ok { diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 515501d..0000000 --- a/package-lock.json +++ /dev/null @@ -1,3824 +0,0 @@ -{ - "name": "mwse", - "version": "0.1.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "mwse", - "version": "0.1.0", - "license": "MIT", - "dependencies": { - "compression": "^1.7.4", - "express": "^4.18.2", - "express-basic-auth": "^1.2.1", - "fflate": "^0.8.1", - "joi": "^17.11.0", - "knex": "^3.0.1", - "sqlite3": "^5.1.6", - "systemjs": "^6.14.2", - "terminal": "^0.1.4", - "terminal-kit": "^3.0.0", - "typescript": "^5.2.2", - "webrtc-adapter": "^8.2.3", - "websocket": "^1.0.34" - }, - "devDependencies": { - "@parcel/packager-ts": "^2.7.0", - "@parcel/transformer-typescript-types": "^2.7.0", - "tslib": "^2.4.1" - } - }, - "node_modules/@cronvel/get-pixels": { - "version": "3.4.1", - "resolved": "https://registry.npmjs.org/@cronvel/get-pixels/-/get-pixels-3.4.1.tgz", - "integrity": "sha512-gB5C5nDIacLUdsMuW8YsM9SzK3vaFANe4J11CVXpovpy7bZUGrcJKmc6m/0gWG789pKr6XSZY2aEetjFvSRw5g==", - "dependencies": { - "jpeg-js": "^0.4.4", - "ndarray": "^1.0.19", - "ndarray-pack": "^1.1.1", - "node-bitmap": "0.0.1", - "omggif": "^1.0.10", - "pngjs": "^6.0.0" - } - }, - "node_modules/@gar/promisify": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", - "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", - "optional": true - }, - "node_modules/@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==" - }, - "node_modules/@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@lezer/common": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@lezer/common/-/common-1.1.0.tgz", - "integrity": "sha512-XPIN3cYDXsoJI/oDWoR2tD++juVrhgIago9xyKhZ7IhGlzdDM9QgC8D8saKNCz5pindGcznFr2HBSsEQSWnSjw==", - "dev": true - }, - "node_modules/@lezer/lr": { - "version": "1.3.14", - "resolved": "https://registry.npmjs.org/@lezer/lr/-/lr-1.3.14.tgz", - "integrity": "sha512-z5mY4LStlA3yL7aHT/rqgG614cfcvklS+8oFRFBYrs4YaWLJyKKM4+nN6KopToX0o9Hj6zmH6M5kinOYuy06ug==", - "dev": true, - "dependencies": { - "@lezer/common": "^1.0.0" - } - }, - "node_modules/@lmdb/lmdb-darwin-arm64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-2.8.5.tgz", - "integrity": "sha512-KPDeVScZgA1oq0CiPBcOa3kHIqU+pTOwRFDIhxvmf8CTNvqdZQYp5cCKW0bUk69VygB2PuTiINFWbY78aR2pQw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@lmdb/lmdb-darwin-x64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-2.8.5.tgz", - "integrity": "sha512-w/sLhN4T7MW1nB3R/U8WK5BgQLz904wh+/SmA2jD8NnF7BLLoUgflCNxOeSPOWp8geP6nP/+VjWzZVip7rZ1ug==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@lmdb/lmdb-linux-arm": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-2.8.5.tgz", - "integrity": "sha512-c0TGMbm2M55pwTDIfkDLB6BpIsgxV4PjYck2HiOX+cy/JWiBXz32lYbarPqejKs9Flm7YVAKSILUducU9g2RVg==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@lmdb/lmdb-linux-arm64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-2.8.5.tgz", - "integrity": "sha512-vtbZRHH5UDlL01TT5jB576Zox3+hdyogvpcbvVJlmU5PdL3c5V7cj1EODdh1CHPksRl+cws/58ugEHi8bcj4Ww==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@lmdb/lmdb-linux-x64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-2.8.5.tgz", - "integrity": "sha512-Xkc8IUx9aEhP0zvgeKy7IQ3ReX2N8N1L0WPcQwnZweWmOuKfwpS3GRIYqLtK5za/w3E60zhFfNdS+3pBZPytqQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@lmdb/lmdb-win32-x64": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-2.8.5.tgz", - "integrity": "sha512-4wvrf5BgnR8RpogHhtpCPJMKBmvyZPhhUtEwMJbXh0ni2BucpfF07jlmyM11zRqQ2XIq6PbC2j7W7UCCcm1rRQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@mapbox/node-pre-gyp": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz", - "integrity": "sha512-Yhlar6v9WQgUp/He7BdgzOz8lqMQ8sU+jkCq7Wx8Myc5YFJLbEe7lgui/V7G1qB1DJykHSGwreceSaD60Y0PUQ==", - "dependencies": { - "detect-libc": "^2.0.0", - "https-proxy-agent": "^5.0.0", - "make-dir": "^3.1.0", - "node-fetch": "^2.6.7", - "nopt": "^5.0.0", - "npmlog": "^5.0.1", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.11" - }, - "bin": { - "node-pre-gyp": "bin/node-pre-gyp" - } - }, - "node_modules/@mapbox/node-pre-gyp/node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/@mischnic/json-sourcemap": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@mischnic/json-sourcemap/-/json-sourcemap-0.1.1.tgz", - "integrity": "sha512-iA7+tyVqfrATAIsIRWQG+a7ZLLD0VaOCKV2Wd/v4mqIU3J9c4jx9p7S0nw1XH3gJCKNBOOwACOPYYSUu9pgT+w==", - "dev": true, - "dependencies": { - "@lezer/common": "^1.0.0", - "@lezer/lr": "^1.0.0", - "json5": "^2.2.1" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/@msgpackr-extract/msgpackr-extract-darwin-arm64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-3.0.2.tgz", - "integrity": "sha512-9bfjwDxIDWmmOKusUcqdS4Rw+SETlp9Dy39Xui9BEGEk19dDwH0jhipwFzEff/pFg95NKymc6TOTbRKcWeRqyQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-darwin-x64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-darwin-x64/-/msgpackr-extract-darwin-x64-3.0.2.tgz", - "integrity": "sha512-lwriRAHm1Yg4iDf23Oxm9n/t5Zpw1lVnxYU3HnJPTi2lJRkKTrps1KVgvL6m7WvmhYVt/FIsssWay+k45QHeuw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm/-/msgpackr-extract-linux-arm-3.0.2.tgz", - "integrity": "sha512-MOI9Dlfrpi2Cuc7i5dXdxPbFIgbDBGgKR5F2yWEa6FVEtSWncfVNKW5AKjImAQ6CZlBK9tympdsZJ2xThBiWWA==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-linux-arm64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-arm64/-/msgpackr-extract-linux-arm64-3.0.2.tgz", - "integrity": "sha512-FU20Bo66/f7He9Fp9sP2zaJ1Q8L9uLPZQDub/WlUip78JlPeMbVL8546HbZfcW9LNciEXc8d+tThSJjSC+tmsg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-linux-x64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-linux-x64/-/msgpackr-extract-linux-x64-3.0.2.tgz", - "integrity": "sha512-gsWNDCklNy7Ajk0vBBf9jEx04RUxuDQfBse918Ww+Qb9HCPoGzS+XJTLe96iN3BVK7grnLiYghP/M4L8VsaHeA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@msgpackr-extract/msgpackr-extract-win32-x64": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@msgpackr-extract/msgpackr-extract-win32-x64/-/msgpackr-extract-win32-x64-3.0.2.tgz", - "integrity": "sha512-O+6Gs8UeDbyFpbSh2CPEz/UOrrdWPTBYNblZK5CxxLisYt4kGX3Sc+czffFonyjiGSq3jWLwJS/CCJc7tBr4sQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@npmcli/fs": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", - "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", - "optional": true, - "dependencies": { - "@gar/promisify": "^1.0.1", - "semver": "^7.3.5" - } - }, - "node_modules/@npmcli/move-file": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", - "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", - "deprecated": "This functionality has been moved to @npmcli/fs", - "optional": true, - "dependencies": { - "mkdirp": "^1.0.4", - "rimraf": "^3.0.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@parcel/cache": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/cache/-/cache-2.10.2.tgz", - "integrity": "sha512-B69e5n+bBzYoaJdUOviYeUT7N1iXI3IC5G8dAxKNZ9Zgn+pjZ5BwltbfmP47+NTfQ7LqM8Ea4UJxysQsLdwb+Q==", - "dev": true, - "dependencies": { - "@parcel/fs": "2.10.2", - "@parcel/logger": "2.10.2", - "@parcel/utils": "2.10.2", - "lmdb": "2.8.5" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "peerDependencies": { - "@parcel/core": "^2.10.2" - } - }, - "node_modules/@parcel/codeframe": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/codeframe/-/codeframe-2.10.2.tgz", - "integrity": "sha512-EZrYSIlVg4qiBLHRRqC/BGN2MLG0SKnw4u7kpviwz63I+v36ghqmHGOomwfn4x13nDL+EgOFz4/+Q7QpbMTKug==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/core": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/core/-/core-2.10.2.tgz", - "integrity": "sha512-c6hh13oYk9w5creiQ9yCz9GLQ17ZRMonULhJ46J0yoFArynVhNTJ9B5xVst7rS/chOTY8jU0jSdJuxQCR4fjkg==", - "dev": true, - "peer": true, - "dependencies": { - "@mischnic/json-sourcemap": "^0.1.0", - "@parcel/cache": "2.10.2", - "@parcel/diagnostic": "2.10.2", - "@parcel/events": "2.10.2", - "@parcel/fs": "2.10.2", - "@parcel/graph": "3.0.2", - "@parcel/logger": "2.10.2", - "@parcel/package-manager": "2.10.2", - "@parcel/plugin": "2.10.2", - "@parcel/profiler": "2.10.2", - "@parcel/rust": "2.10.2", - "@parcel/source-map": "^2.1.1", - "@parcel/types": "2.10.2", - "@parcel/utils": "2.10.2", - "@parcel/workers": "2.10.2", - "abortcontroller-polyfill": "^1.1.9", - "base-x": "^3.0.8", - "browserslist": "^4.6.6", - "clone": "^2.1.1", - "dotenv": "^7.0.0", - "dotenv-expand": "^5.1.0", - "json5": "^2.2.0", - "msgpackr": "^1.5.4", - "nullthrows": "^1.1.1", - "semver": "^7.5.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/diagnostic": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/diagnostic/-/diagnostic-2.10.2.tgz", - "integrity": "sha512-FwtphyiV/TJEiYIRYXBOloXp7XhTW37ifRSLr7RdLbDVyn/P9q/7l0+ORlnOL+WuKwbDQtY+dXYLh/ijTsq7qQ==", - "dev": true, - "dependencies": { - "@mischnic/json-sourcemap": "^0.1.0", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/events": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/events/-/events-2.10.2.tgz", - "integrity": "sha512-Dp8Oqh5UvSuIASfiHP8jrEtdtzzmTKiOG/RkSL3mtp2tK3mu6dZLJZbcdJXrvBTg7smtRiznkrIOJCawALC7AQ==", - "dev": true, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/fs": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/fs/-/fs-2.10.2.tgz", - "integrity": "sha512-80SXdFGDJtil9tTbWrYiZRfQ5ehMAT/dq6eY4EYcFg+MvSiwBL/4GfYMfqXn6AamuSVeQlsFCPpunFLNl9YDDA==", - "dev": true, - "dependencies": { - "@parcel/rust": "2.10.2", - "@parcel/types": "2.10.2", - "@parcel/utils": "2.10.2", - "@parcel/watcher": "^2.0.7", - "@parcel/workers": "2.10.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "peerDependencies": { - "@parcel/core": "^2.10.2" - } - }, - "node_modules/@parcel/graph": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@parcel/graph/-/graph-3.0.2.tgz", - "integrity": "sha512-cPxCN3+QF+5l4BJ0wnLeb3DPJarWQoD3W984CfuEYy/8Zgo2oayd31soZzkevyTYtp7H4tJKo+I79i2TJdNq5Q==", - "dev": true, - "peer": true, - "dependencies": { - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/logger": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/logger/-/logger-2.10.2.tgz", - "integrity": "sha512-5lufBuBnXDs3hjAaptmeEAxpH0eHe0+2hJvlVv5lE/RwHR7vDjh+FDwzPfCLWNM3TQhPQdZPdHcDsuA539GHcw==", - "dev": true, - "dependencies": { - "@parcel/diagnostic": "2.10.2", - "@parcel/events": "2.10.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/markdown-ansi": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/markdown-ansi/-/markdown-ansi-2.10.2.tgz", - "integrity": "sha512-uZrysHjJ+0vbQNK2bhKy8yoVso8KnoW6O/SW8MiGQ4lpDJdqHShkW08wZUKr4sjl7h/WVFdNsDdgvi2/ANwoRQ==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/node-resolver-core": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@parcel/node-resolver-core/-/node-resolver-core-3.1.2.tgz", - "integrity": "sha512-xvIBgYBRQGmCkfwK/yxVSDtPEvWDVH9poQcGpKHT1jqstYju5crXro0acni5nYF0hWZu7Kttrp9G9fXJQWBksw==", - "dev": true, - "dependencies": { - "@mischnic/json-sourcemap": "^0.1.0", - "@parcel/diagnostic": "2.10.2", - "@parcel/fs": "2.10.2", - "@parcel/rust": "2.10.2", - "@parcel/utils": "2.10.2", - "nullthrows": "^1.1.1", - "semver": "^7.5.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/package-manager": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/package-manager/-/package-manager-2.10.2.tgz", - "integrity": "sha512-c91YYsIxjX3YhMvtPT7v2MpDOn/Qyw13bi1+0Ftd2JNjUZPlm8+xKizlmgvdi75dgs7dGIUVpvrGLU9LoKthCA==", - "dev": true, - "dependencies": { - "@parcel/diagnostic": "2.10.2", - "@parcel/fs": "2.10.2", - "@parcel/logger": "2.10.2", - "@parcel/node-resolver-core": "3.1.2", - "@parcel/types": "2.10.2", - "@parcel/utils": "2.10.2", - "@parcel/workers": "2.10.2", - "semver": "^7.5.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "peerDependencies": { - "@parcel/core": "^2.10.2" - } - }, - "node_modules/@parcel/packager-ts": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/packager-ts/-/packager-ts-2.10.2.tgz", - "integrity": "sha512-0HhQWFraUnDgD5gzH7ru2fVEwDakKstjaBf6hTmqo7TAvO7Xj2UPXY4rkr5B1RpQFsnkSzd4Ll98+SMI2xN8mg==", - "dev": true, - "dependencies": { - "@parcel/plugin": "2.10.2" - }, - "engines": { - "node": ">= 12.0.0", - "parcel": "^2.10.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/plugin": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/plugin/-/plugin-2.10.2.tgz", - "integrity": "sha512-1u+GJhuqqlYjMAQLBbMExfFCbsbtuSAm6wXmMmTse5cBpFqxgsMumMeztAhcTy0oMnMhbZg2AKZV0XVSMrIgng==", - "dev": true, - "dependencies": { - "@parcel/types": "2.10.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/profiler": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/profiler/-/profiler-2.10.2.tgz", - "integrity": "sha512-YQugGhf12u83O0RJLWbhkPV772nePPxNZjvFJmV++7buPUpgJW2m1lVOrut/s/8ZZIPqcxJe8dyxSSOtvdG7OQ==", - "dev": true, - "dependencies": { - "@parcel/diagnostic": "2.10.2", - "@parcel/events": "2.10.2", - "chrome-trace-event": "^1.0.2" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/rust": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/rust/-/rust-2.10.2.tgz", - "integrity": "sha512-v/Cyf3iXlzSc6vgvPiEZzqdKAZ1jJ/aZX7y1YSupDh3RoqJI2bZ93kAOyEi+S7P3kshJkQM0px3YveJFOAMUOA==", - "dev": true, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/source-map": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@parcel/source-map/-/source-map-2.1.1.tgz", - "integrity": "sha512-Ejx1P/mj+kMjQb8/y5XxDUn4reGdr+WyKYloBljpppUy8gs42T+BNoEOuRYqDVdgPc6NxduzIDoJS9pOFfV5Ew==", - "dev": true, - "dependencies": { - "detect-libc": "^1.0.3" - }, - "engines": { - "node": "^12.18.3 || >=14" - } - }, - "node_modules/@parcel/transformer-typescript-types": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/transformer-typescript-types/-/transformer-typescript-types-2.10.2.tgz", - "integrity": "sha512-CF/g1c1H7dhg+euKN1Or12uGYfKyAjjM2ao2XLh1hEFCxZyc9AtKbuyNk8EeAnR1PA/+hymPc5Rb325m6EHZpA==", - "dev": true, - "dependencies": { - "@parcel/diagnostic": "2.10.2", - "@parcel/plugin": "2.10.2", - "@parcel/source-map": "^2.1.1", - "@parcel/ts-utils": "2.10.2", - "@parcel/utils": "2.10.2", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">= 12.0.0", - "parcel": "^2.10.2" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "peerDependencies": { - "typescript": ">=3.0.0" - } - }, - "node_modules/@parcel/ts-utils": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/ts-utils/-/ts-utils-2.10.2.tgz", - "integrity": "sha512-66kCp0tUS+LvfC5EotWQsVvCD5cbUX4LrvKmRMW1qH7dkcq5rBtEV2iUbMdy8/JN2OR6p1KY+Mf+HOuVe169cw==", - "dev": true, - "dependencies": { - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "peerDependencies": { - "typescript": ">=3.0.0" - } - }, - "node_modules/@parcel/types": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/types/-/types-2.10.2.tgz", - "integrity": "sha512-fwHJu03ROcc4/Kr/00VfOQUD6aV+6FBLN5bDW1+Xblgrpkb1MSUGTWRuz0YH5X6xhkVigC1llCIR2uHSwA+YBg==", - "dev": true, - "dependencies": { - "@parcel/cache": "2.10.2", - "@parcel/diagnostic": "2.10.2", - "@parcel/fs": "2.10.2", - "@parcel/package-manager": "2.10.2", - "@parcel/source-map": "^2.1.1", - "@parcel/workers": "2.10.2", - "utility-types": "^3.10.0" - } - }, - "node_modules/@parcel/utils": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/utils/-/utils-2.10.2.tgz", - "integrity": "sha512-XLUhTh0UkPB5n8r7agX9iIz9f+3JsBIVsmqltsJYX7n/GAa6EQtqrIYyZu8cEFeZlZw3zaf7wTmf9xJppdlj7Q==", - "dev": true, - "dependencies": { - "@parcel/codeframe": "2.10.2", - "@parcel/diagnostic": "2.10.2", - "@parcel/logger": "2.10.2", - "@parcel/markdown-ansi": "2.10.2", - "@parcel/rust": "2.10.2", - "@parcel/source-map": "^2.1.1", - "chalk": "^4.1.0", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.3.0.tgz", - "integrity": "sha512-pW7QaFiL11O0BphO+bq3MgqeX/INAk9jgBldVDYjlQPO4VddoZnF22TcF9onMhnLVHuNqBJeRf+Fj7eezi/+rQ==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "detect-libc": "^1.0.3", - "is-glob": "^4.0.3", - "micromatch": "^4.0.5", - "node-addon-api": "^7.0.0" - }, - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "optionalDependencies": { - "@parcel/watcher-android-arm64": "2.3.0", - "@parcel/watcher-darwin-arm64": "2.3.0", - "@parcel/watcher-darwin-x64": "2.3.0", - "@parcel/watcher-freebsd-x64": "2.3.0", - "@parcel/watcher-linux-arm-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-glibc": "2.3.0", - "@parcel/watcher-linux-arm64-musl": "2.3.0", - "@parcel/watcher-linux-x64-glibc": "2.3.0", - "@parcel/watcher-linux-x64-musl": "2.3.0", - "@parcel/watcher-win32-arm64": "2.3.0", - "@parcel/watcher-win32-ia32": "2.3.0", - "@parcel/watcher-win32-x64": "2.3.0" - } - }, - "node_modules/@parcel/watcher-android-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.3.0.tgz", - "integrity": "sha512-f4o9eA3dgk0XRT3XhB0UWpWpLnKgrh1IwNJKJ7UJek7eTYccQ8LR7XUWFKqw6aEq5KUNlCcGvSzKqSX/vtWVVA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "android" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.3.0.tgz", - "integrity": "sha512-mKY+oijI4ahBMc/GygVGvEdOq0L4DxhYgwQqYAz/7yPzuGi79oXrZG52WdpGA1wLBPrYb0T8uBaGFo7I6rvSKw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-darwin-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.3.0.tgz", - "integrity": "sha512-20oBj8LcEOnLE3mgpy6zuOq8AplPu9NcSSSfyVKgfOhNAc4eF4ob3ldj0xWjGGbOF7Dcy1Tvm6ytvgdjlfUeow==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-freebsd-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.3.0.tgz", - "integrity": "sha512-7LftKlaHunueAEiojhCn+Ef2CTXWsLgTl4hq0pkhkTBFI3ssj2bJXmH2L67mKpiAD5dz66JYk4zS66qzdnIOgw==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "freebsd" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.3.0.tgz", - "integrity": "sha512-1apPw5cD2xBv1XIHPUlq0cO6iAaEUQ3BcY0ysSyD9Kuyw4MoWm1DV+W9mneWI+1g6OeP6dhikiFE6BlU+AToTQ==", - "cpu": [ - "arm" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.3.0.tgz", - "integrity": "sha512-mQ0gBSQEiq1k/MMkgcSB0Ic47UORZBmWoAWlMrTW6nbAGoLZP+h7AtUM7H3oDu34TBFFvjy4JCGP43JlylkTQA==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-arm64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.3.0.tgz", - "integrity": "sha512-LXZAExpepJew0Gp8ZkJ+xDZaTQjLHv48h0p0Vw2VMFQ8A+RKrAvpFuPVCVwKJCr5SE+zvaG+Etg56qXvTDIedw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-glibc": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.3.0.tgz", - "integrity": "sha512-P7Wo91lKSeSgMTtG7CnBS6WrA5otr1K7shhSjKHNePVmfBHDoAOHYRXgUmhiNfbcGk0uMCHVcdbfxtuiZCHVow==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-linux-x64-musl": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.3.0.tgz", - "integrity": "sha512-+kiRE1JIq8QdxzwoYY+wzBs9YbJ34guBweTK8nlzLKimn5EQ2b2FSC+tAOpq302BuIMjyuUGvBiUhEcLIGMQ5g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-arm64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.3.0.tgz", - "integrity": "sha512-35gXCnaz1AqIXpG42evcoP2+sNL62gZTMZne3IackM+6QlfMcJLy3DrjuL6Iks7Czpd3j4xRBzez3ADCj1l7Aw==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-ia32": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.3.0.tgz", - "integrity": "sha512-FJS/IBQHhRpZ6PiCjFt1UAcPr0YmCLHRbTc00IBTrelEjlmmgIVLeOx4MSXzx2HFEy5Jo5YdhGpxCuqCyDJ5ow==", - "cpu": [ - "ia32" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/watcher-win32-x64": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.3.0.tgz", - "integrity": "sha512-dLx+0XRdMnVI62kU3wbXvbIRhLck4aE28bIGKbRGS7BJNt54IIj9+c/Dkqb+7DJEbHUZAX1bwaoM8PqVlHJmCA==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">= 10.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - } - }, - "node_modules/@parcel/workers": { - "version": "2.10.2", - "resolved": "https://registry.npmjs.org/@parcel/workers/-/workers-2.10.2.tgz", - "integrity": "sha512-LvifdeORXKGGyhwOwnYxn1AsJ5u6Ihk2RJUxsVA4WYEjz2PSsmLAUDdp48ovssSMnTb9P2g4RrbEG1mJjYtBGA==", - "dev": true, - "dependencies": { - "@parcel/diagnostic": "2.10.2", - "@parcel/logger": "2.10.2", - "@parcel/profiler": "2.10.2", - "@parcel/types": "2.10.2", - "@parcel/utils": "2.10.2", - "nullthrows": "^1.1.1" - }, - "engines": { - "node": ">= 12.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/parcel" - }, - "peerDependencies": { - "@parcel/core": "^2.10.2" - } - }, - "node_modules/@sideway/address": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", - "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==" - }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" - }, - "node_modules/@tootallnate/once": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", - "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", - "optional": true, - "engines": { - "node": ">= 6" - } - }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==" - }, - "node_modules/abortcontroller-polyfill": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", - "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==", - "dev": true, - "peer": true - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "dependencies": { - "debug": "4" - }, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/agent-base/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/agent-base/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/agentkeepalive": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", - "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", - "optional": true, - "dependencies": { - "humanize-ms": "^1.2.1" - }, - "engines": { - "node": ">= 8.0.0" - } - }, - "node_modules/aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "optional": true, - "dependencies": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/aproba": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", - "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==" - }, - "node_modules/are-we-there-yet": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", - "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base-x": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.9.tgz", - "integrity": "sha512-H7JU6iBHTal1gp56aKoaa//YUxEaAOUiydvrV/pILqIHXTtqxSkATOnDA2u+jZ/61sD+L/412+7kzXRtWukhpQ==", - "dev": true, - "peer": true, - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/basic-auth": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz", - "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==", - "dependencies": { - "safe-buffer": "5.1.2" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/basic-auth/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/body-parser": { - "version": "1.20.1", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz", - "integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==", - "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "on-finished": "2.4.1", - "qs": "6.11.0", - "raw-body": "2.5.1", - "type-is": "~1.6.18", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/body-parser/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, - "dependencies": { - "fill-range": "^7.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.22.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", - "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "peer": true, - "dependencies": { - "caniuse-lite": "^1.0.30001541", - "electron-to-chromium": "^1.4.535", - "node-releases": "^2.0.13", - "update-browserslist-db": "^1.0.13" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/bufferutil": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", - "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/bytes": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", - "integrity": "sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/cacache": { - "version": "15.3.0", - "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", - "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", - "optional": true, - "dependencies": { - "@npmcli/fs": "^1.0.0", - "@npmcli/move-file": "^1.0.1", - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "glob": "^7.1.4", - "infer-owner": "^1.0.4", - "lru-cache": "^6.0.0", - "minipass": "^3.1.1", - "minipass-collect": "^1.0.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.2", - "mkdirp": "^1.0.3", - "p-map": "^4.0.0", - "promise-inflight": "^1.0.1", - "rimraf": "^3.0.2", - "ssri": "^8.0.1", - "tar": "^6.0.2", - "unique-filename": "^1.1.1" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/call-bind": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", - "integrity": "sha512-C3nQxfFZxFRVoJoGKKI8y3MOEo129NQ+FgQ08iye+Mk4zNZZGdjfs06bVTr+DBSlA66Q2VEcMki/cUCP4SercQ==", - "dependencies": { - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.1", - "set-function-length": "^1.1.1" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001561", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", - "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "peer": true - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "engines": { - "node": ">=10" - } - }, - "node_modules/chroma-js": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.4.2.tgz", - "integrity": "sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A==" - }, - "node_modules/chrome-trace-event": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.3.tgz", - "integrity": "sha512-p3KULyQg4S7NIHixdwbGX+nFHkoBiA4YQmyWtjb8XngSKV124nJmRysgAeujbUVb15vh+RvFUfCPqU7rXk+hZg==", - "dev": true, - "engines": { - "node": ">=6.0" - } - }, - "node_modules/clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==", - "dev": true, - "peer": true, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "bin": { - "color-support": "bin.js" - } - }, - "node_modules/colorette": { - "version": "2.0.19", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.19.tgz", - "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==" - }, - "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "engines": { - "node": ">=14" - } - }, - "node_modules/compressible": { - "version": "2.0.18", - "resolved": "https://registry.npmjs.org/compressible/-/compressible-2.0.18.tgz", - "integrity": "sha512-AF3r7P5dWxL8MxyITRMlORQNaOA2IkAFaTr4k7BUumjPtRpGDTZpl0Pb1XCO6JeDCBdp126Cgs9sMxqSjgYyRg==", - "dependencies": { - "mime-db": ">= 1.43.0 < 2" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/compression": { - "version": "1.7.4", - "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.4.tgz", - "integrity": "sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==", - "dependencies": { - "accepts": "~1.3.5", - "bytes": "3.0.0", - "compressible": "~2.0.16", - "debug": "2.6.9", - "on-headers": "~1.0.2", - "safe-buffer": "5.1.2", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/compression/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" - }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==" - }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/content-type": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", - "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz", - "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" - }, - "node_modules/cwise-compiler": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/cwise-compiler/-/cwise-compiler-1.1.3.tgz", - "integrity": "sha512-WXlK/m+Di8DMMcCjcWr4i+XzcQra9eCdXIJrgh4TUgh0pIS/yJduLxS9JgefsHJ/YVLdgPtXm9r62W92MvanEQ==", - "dependencies": { - "uniq": "^1.0.0" - } - }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, - "node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/define-data-property": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.1.tgz", - "integrity": "sha512-E7uGkTzkk1d0ByLeSc6ZsFS79Axg+m1P/VsgYsxHgiuc3tFSj+MjMIwe90FC4lOAZzNBdY7kkO2P2wKdsQ1vgQ==", - "dependencies": { - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==" - }, - "node_modules/depd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", - "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/destroy": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", - "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", - "engines": { - "node": ">= 0.8", - "npm": "1.2.8000 || >= 1.4.16" - } - }, - "node_modules/detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", - "dev": true, - "bin": { - "detect-libc": "bin/detect-libc.js" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/dotenv": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-7.0.0.tgz", - "integrity": "sha512-M3NhsLbV1i6HuGzBUH8vXrtxOk+tWmzWKDMbAVSUp3Zsjm7ywFeuwrUXhmhQyRK1q5B5GGy7hcXPbj3bnfZg2g==", - "dev": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/dotenv-expand": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-5.1.0.tgz", - "integrity": "sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==", - "dev": true, - "peer": true - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" - }, - "node_modules/electron-to-chromium": { - "version": "1.4.576", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.576.tgz", - "integrity": "sha512-yXsZyXJfAqzWk1WKryr0Wl0MN2D47xodPvEEwlVePBnhU5E7raevLQR+E6b9JAD3GfL/7MbAL9ZtWQQPcLx7wA==", - "dev": true, - "peer": true - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/encoding": { - "version": "0.1.13", - "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", - "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", - "optional": true, - "dependencies": { - "iconv-lite": "^0.6.2" - } - }, - "node_modules/encoding/node_modules/iconv-lite": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", - "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", - "optional": true, - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/err-code": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", - "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", - "optional": true - }, - "node_modules/es5-ext": { - "version": "0.10.62", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz", - "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==", - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" - }, - "node_modules/esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/express": { - "version": "4.18.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz", - "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==", - "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.20.1", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.5.0", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "2.0.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "1.2.0", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.11.0", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" - } - }, - "node_modules/express-basic-auth": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/express-basic-auth/-/express-basic-auth-1.2.1.tgz", - "integrity": "sha512-L6YQ1wQ/mNjVLAmK3AG1RK6VkokA1BIY6wmiH304Xtt/cLTps40EusZsU1Uop+v9lTDPxdtzbFmdXfFO3KEnwA==", - "dependencies": { - "basic-auth": "^2.0.1" - } - }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, - "node_modules/fflate": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.1.tgz", - "integrity": "sha512-/exOvEuc+/iaUm105QIiOt4LpBdMTWsXxqR0HDF35vx3fmaKzw7354gTilCh5rkzEt8WYyG//ku3h3nRmd7CHQ==" - }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/finalhandler": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", - "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", - "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "2.4.1", - "parseurl": "~1.3.3", - "statuses": "2.0.1", - "unpipe": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/gauge": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", - "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.2", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.1", - "object-assign": "^4.1.1", - "signal-exit": "^3.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", - "integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", - "dependencies": { - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/get-package-type": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/getopts": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/getopts/-/getopts-2.3.0.tgz", - "integrity": "sha512-5eDf9fuSXwxBL6q5HX+dhDj+dslFGWzU5thZ9kNKUkcPtaPdatmUFKwHFrLb/uf/WpA4BHET+AX3Scl56cAjpA==" - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", - "optional": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.1.tgz", - "integrity": "sha512-VsX8eaIewvas0xnvinAe9bw4WfIeODpGYikiWYLH+dma0Jw6KHYqWiWfhQlgOVK8D6PvjubK5Uc4P0iIhIcNVg==", - "dependencies": { - "get-intrinsic": "^1.2.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", - "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==" - }, - "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", - "optional": true - }, - "node_modules/http-errors": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", - "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", - "dependencies": { - "depd": "2.0.0", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": "2.0.1", - "toidentifier": "1.0.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/http-proxy-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", - "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", - "optional": true, - "dependencies": { - "@tootallnate/once": "1", - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/http-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/http-proxy-agent/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==", - "optional": true - }, - "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", - "dependencies": { - "agent-base": "6", - "debug": "4" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/https-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/https-proxy-agent/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/humanize-ms": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", - "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", - "optional": true, - "dependencies": { - "ms": "^2.0.0" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "optional": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "optional": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/infer-owner": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", - "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", - "optional": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/interpret": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", - "integrity": "sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/iota-array": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/iota-array/-/iota-array-1.0.0.tgz", - "integrity": "sha512-pZ2xT+LOHckCatGQ3DcG/a+QuEqvoxqkiL7tvE8nn3uuu+f6i1TtpB5/FtWFbxUuVr5PZCx8KskuGatbJDXOWA==" - }, - "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", - "optional": true - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", - "dependencies": { - "hasown": "^2.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-lambda": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", - "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", - "optional": true - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "optional": true - }, - "node_modules/joi": { - "version": "17.11.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.11.0.tgz", - "integrity": "sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==", - "dependencies": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", - "@sideway/formula": "^3.0.1", - "@sideway/pinpoint": "^2.0.0" - } - }, - "node_modules/jpeg-js": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.4.tgz", - "integrity": "sha512-WZzeDOEtTOBK4Mdsar0IqEU5sMr3vSV2RqkAIzUEV2BHnUfKGyswWFPFwK5EeDo93K3FohSHbLAjj0s1Wzd+dg==" - }, - "node_modules/json5": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", - "dev": true, - "bin": { - "json5": "lib/cli.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/knex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/knex/-/knex-3.0.1.tgz", - "integrity": "sha512-ruASxC6xPyDklRdrcDy6a9iqK+R9cGK214aiQa+D9gX2ZnHZKv6o6JC9ZfgxILxVAul4bZ13c3tgOAHSuQ7/9g==", - "dependencies": { - "colorette": "2.0.19", - "commander": "^10.0.0", - "debug": "4.3.4", - "escalade": "^3.1.1", - "esm": "^3.2.25", - "get-package-type": "^0.1.0", - "getopts": "2.3.0", - "interpret": "^2.2.0", - "lodash": "^4.17.21", - "pg-connection-string": "2.6.1", - "rechoir": "^0.8.0", - "resolve-from": "^5.0.0", - "tarn": "^3.0.2", - "tildify": "2.0.0" - }, - "bin": { - "knex": "bin/cli.js" - }, - "engines": { - "node": ">=16" - }, - "peerDependenciesMeta": { - "better-sqlite3": { - "optional": true - }, - "mysql": { - "optional": true - }, - "mysql2": { - "optional": true - }, - "pg": { - "optional": true - }, - "pg-native": { - "optional": true - }, - "sqlite3": { - "optional": true - }, - "tedious": { - "optional": true - } - } - }, - "node_modules/knex/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/knex/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/lazyness": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/lazyness/-/lazyness-1.2.0.tgz", - "integrity": "sha512-KenL6EFbwxBwRxG93t0gcUyi0Nw0Ub31FJKN1laA4UscdkL1K1AxUd0gYZdcLU3v+x+wcFi4uQKS5hL+fk500g==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/lmdb": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/lmdb/-/lmdb-2.8.5.tgz", - "integrity": "sha512-9bMdFfc80S+vSldBmG3HOuLVHnxRdNTlpzR6QDnzqCQtCzGUEAGTzBKYMeIM+I/sU4oZfgbcbS7X7F65/z/oxQ==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "msgpackr": "^1.9.5", - "node-addon-api": "^6.1.0", - "node-gyp-build-optional-packages": "5.1.1", - "ordered-binary": "^1.4.1", - "weak-lru-cache": "^1.2.2" - }, - "bin": { - "download-lmdb-prebuilds": "bin/download-prebuilds.js" - }, - "optionalDependencies": { - "@lmdb/lmdb-darwin-arm64": "2.8.5", - "@lmdb/lmdb-darwin-x64": "2.8.5", - "@lmdb/lmdb-linux-arm": "2.8.5", - "@lmdb/lmdb-linux-arm64": "2.8.5", - "@lmdb/lmdb-linux-x64": "2.8.5", - "@lmdb/lmdb-win32-x64": "2.8.5" - } - }, - "node_modules/lmdb/node_modules/node-addon-api": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz", - "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==", - "dev": true - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dependencies": { - "semver": "^6.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/make-fetch-happen": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", - "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", - "optional": true, - "dependencies": { - "agentkeepalive": "^4.1.3", - "cacache": "^15.2.0", - "http-cache-semantics": "^4.1.0", - "http-proxy-agent": "^4.0.1", - "https-proxy-agent": "^5.0.0", - "is-lambda": "^1.0.1", - "lru-cache": "^6.0.0", - "minipass": "^3.1.3", - "minipass-collect": "^1.0.2", - "minipass-fetch": "^1.3.2", - "minipass-flush": "^1.0.5", - "minipass-pipeline": "^1.2.4", - "negotiator": "^0.6.2", - "promise-retry": "^2.0.1", - "socks-proxy-agent": "^6.0.0", - "ssri": "^8.0.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, - "dependencies": { - "braces": "^3.0.2", - "picomatch": "^2.3.1" - }, - "engines": { - "node": ">=8.6" - } - }, - "node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minipass": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", - "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-collect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", - "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-fetch": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", - "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", - "optional": true, - "dependencies": { - "minipass": "^3.1.0", - "minipass-sized": "^1.0.3", - "minizlib": "^2.0.0" - }, - "engines": { - "node": ">=8" - }, - "optionalDependencies": { - "encoding": "^0.1.12" - } - }, - "node_modules/minipass-flush": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", - "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/minipass-pipeline": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", - "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minipass-sized": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", - "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, - "node_modules/msgpackr": { - "version": "1.9.9", - "resolved": "https://registry.npmjs.org/msgpackr/-/msgpackr-1.9.9.tgz", - "integrity": "sha512-sbn6mioS2w0lq1O6PpGtsv6Gy8roWM+o3o4Sqjd6DudrL/nOugY+KyJUimoWzHnf9OkO0T6broHFnYE/R05t9A==", - "dev": true, - "optionalDependencies": { - "msgpackr-extract": "^3.0.2" - } - }, - "node_modules/msgpackr-extract": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/msgpackr-extract/-/msgpackr-extract-3.0.2.tgz", - "integrity": "sha512-SdzXp4kD/Qf8agZ9+iTu6eql0m3kWm1A2y1hkpTeVNENutaB0BwHlSvAIaMxwntmRUAUjon2V4L8Z/njd0Ct8A==", - "dev": true, - "hasInstallScript": true, - "optional": true, - "dependencies": { - "node-gyp-build-optional-packages": "5.0.7" - }, - "bin": { - "download-msgpackr-prebuilds": "bin/download-prebuilds.js" - }, - "optionalDependencies": { - "@msgpackr-extract/msgpackr-extract-darwin-arm64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-darwin-x64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-linux-arm": "3.0.2", - "@msgpackr-extract/msgpackr-extract-linux-arm64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-linux-x64": "3.0.2", - "@msgpackr-extract/msgpackr-extract-win32-x64": "3.0.2" - } - }, - "node_modules/msgpackr-extract/node_modules/node-gyp-build-optional-packages": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.0.7.tgz", - "integrity": "sha512-YlCCc6Wffkx0kHkmam79GKvDQ6x+QZkMjFGrIMxgFNILFvGSbCp2fCBC55pGTT9gVaz8Na5CLmxt/urtzRv36w==", - "dev": true, - "optional": true, - "bin": { - "node-gyp-build-optional-packages": "bin.js", - "node-gyp-build-optional-packages-optional": "optional.js", - "node-gyp-build-optional-packages-test": "build-test.js" - } - }, - "node_modules/ndarray": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/ndarray/-/ndarray-1.0.19.tgz", - "integrity": "sha512-B4JHA4vdyZU30ELBw3g7/p9bZupyew5a7tX1Y/gGeF2hafrPaQZhgrGQfsvgfYbgdFZjYwuEcnaobeM/WMW+HQ==", - "dependencies": { - "iota-array": "^1.0.0", - "is-buffer": "^1.0.2" - } - }, - "node_modules/ndarray-pack": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ndarray-pack/-/ndarray-pack-1.2.1.tgz", - "integrity": "sha512-51cECUJMT0rUZNQa09EoKsnFeDL4x2dHRT0VR5U2H5ZgEcm95ZDWcMA5JShroXjHOejmAD/fg8+H+OvUnVXz2g==", - "dependencies": { - "cwise-compiler": "^1.1.2", - "ndarray": "^1.0.13" - } - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, - "node_modules/nextgen-events": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/nextgen-events/-/nextgen-events-1.5.3.tgz", - "integrity": "sha512-P6qw6kenNXP+J9XlKJNi/MNHUQ+Lx5K8FEcSfX7/w8KJdZan5+BB5MKzuNgL2RTjHG1Svg8SehfseVEp8zAqwA==", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/node-addon-api": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", - "integrity": "sha512-vgbBJTS4m5/KkE16t5Ly0WW9hz46swAstv0hYYwMtbG7AznRhNyfLRe8HZAiWIpcHzoO7HxhLuBQj9rJ/Ho0ZA==", - "dev": true - }, - "node_modules/node-bitmap": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/node-bitmap/-/node-bitmap-0.0.1.tgz", - "integrity": "sha512-Jx5lPaaLdIaOsj2mVLWMWulXF6GQVdyLvNSxmiYCvZ8Ma2hfKX0POoR2kgKOqz+oFsRreq0yYZjQ2wjE9VNzCA==", - "engines": { - "node": ">=v0.6.5" - } - }, - "node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/node-gyp": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", - "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", - "optional": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.6", - "make-fetch-happen": "^9.1.0", - "nopt": "^5.0.0", - "npmlog": "^6.0.0", - "rimraf": "^3.0.2", - "semver": "^7.3.5", - "tar": "^6.1.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } - }, - "node_modules/node-gyp-build": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", - "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/node-gyp-build-optional-packages": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/node-gyp-build-optional-packages/-/node-gyp-build-optional-packages-5.1.1.tgz", - "integrity": "sha512-+P72GAjVAbTxjjwUmwjVrqrdZROD4nf8KgpBoDxqXXTiYZZt/ud60dE5yvCSr9lRO8e8yv6kgJIC0K0PfZFVQw==", - "dev": true, - "dependencies": { - "detect-libc": "^2.0.1" - }, - "bin": { - "node-gyp-build-optional-packages": "bin.js", - "node-gyp-build-optional-packages-optional": "optional.js", - "node-gyp-build-optional-packages-test": "build-test.js" - } - }, - "node_modules/node-gyp-build-optional-packages/node_modules/detect-libc": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.2.tgz", - "integrity": "sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/node-gyp/node_modules/are-we-there-yet": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", - "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "optional": true, - "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-gyp/node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "optional": true, - "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/node-releases": { - "version": "2.0.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", - "dev": true, - "peer": true - }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/npmlog": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", - "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", - "dependencies": { - "are-we-there-yet": "^2.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^3.0.0", - "set-blocking": "^2.0.0" - } - }, - "node_modules/nullthrows": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/nullthrows/-/nullthrows-1.1.1.tgz", - "integrity": "sha512-2vPPEi+Z7WqML2jZYddDIfy5Dqb0r2fze2zTxNNknZaFpVHU3mFB3R+DWeJWGVx0ecvttSGlJTI+WG+8Z4cDWw==", - "dev": true - }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/omggif": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz", - "integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==" - }, - "node_modules/on-finished": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", - "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", - "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/on-headers": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", - "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/ordered-binary": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/ordered-binary/-/ordered-binary-1.4.1.tgz", - "integrity": "sha512-9LtiGlPy982CsgxZvJGNNp2/NnrgEr6EAyN3iIEP3/8vd3YLgAZQHbQ75ZrkfBRGrNg37Dk3U6tuVb+B4Xfslg==", - "dev": true - }, - "node_modules/p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "optional": true, - "dependencies": { - "aggregate-error": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-parse": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" - }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" - }, - "node_modules/pg-connection-string": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.1.tgz", - "integrity": "sha512-w6ZzNu6oMmIzEAYVw+RLK0+nqHPt8K3ZnknKi+g48Ak2pr3dtljJW3o+D/n2zzCG07Zoe9VOX3aiKpj+BN0pjg==" - }, - "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true, - "peer": true - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "dev": true, - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pngjs": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-6.0.0.tgz", - "integrity": "sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg==", - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", - "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", - "optional": true - }, - "node_modules/promise-retry": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", - "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", - "optional": true, - "dependencies": { - "err-code": "^2.0.2", - "retry": "^0.12.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" - }, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", - "dependencies": { - "side-channel": "^1.0.4" - }, - "engines": { - "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/raw-body": { - "version": "2.5.1", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz", - "integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==", - "dependencies": { - "bytes": "3.1.2", - "http-errors": "2.0.0", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/raw-body/node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/rechoir": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", - "dependencies": { - "resolve": "^1.20.0" - }, - "engines": { - "node": ">= 10.13.0" - } - }, - "node_modules/resolve": { - "version": "1.22.8", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", - "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/resolve-from": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/retry": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", - "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", - "optional": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "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/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" - }, - "node_modules/sdp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/sdp/-/sdp-3.2.0.tgz", - "integrity": "sha512-d7wDPgDV3DDiqulJjKiV2865wKsJ34YI+NDREbm+FySq6WuKOikwyNQcm+doLAZ1O6ltdO0SeKle2xMpN3Brgw==" - }, - "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", - "dependencies": { - "debug": "2.6.9", - "depd": "2.0.0", - "destroy": "1.2.0", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "2.0.0", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "2.4.1", - "range-parser": "~1.2.1", - "statuses": "2.0.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", - "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.18.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==" - }, - "node_modules/set-function-length": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.1.1.tgz", - "integrity": "sha512-VoaqjbBJKiWtg4yRcKBQ7g7wnGnLV3M8oLvVWwOk2PdYY6PEFegR1vezXR0tw6fZGF9csVakIRjrJiy2veSBFQ==", - "dependencies": { - "define-data-property": "^1.1.1", - "get-intrinsic": "^1.2.1", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" - }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" - }, - "node_modules/seventh": { - "version": "0.9.2", - "resolved": "https://registry.npmjs.org/seventh/-/seventh-0.9.2.tgz", - "integrity": "sha512-C+dnbBXIEycnrN6/CpFt/Rt8ccMzAX3wbwJU61RTfC8lYPMzSkKkAVWnUEMTZDHdvtlrTupZeCUK4G+uP4TmRQ==", - "dependencies": { - "setimmediate": "^1.0.5" - }, - "engines": { - "node": ">=16.13.0" - } - }, - "node_modules/side-channel": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", - "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", - "dependencies": { - "call-bind": "^1.0.0", - "get-intrinsic": "^1.0.2", - "object-inspect": "^1.9.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" - }, - "node_modules/smart-buffer": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", - "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", - "optional": true, - "engines": { - "node": ">= 6.0.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", - "optional": true, - "dependencies": { - "ip": "^2.0.0", - "smart-buffer": "^4.2.0" - }, - "engines": { - "node": ">= 10.13.0", - "npm": ">= 3.0.0" - } - }, - "node_modules/socks-proxy-agent": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", - "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", - "optional": true, - "dependencies": { - "agent-base": "^6.0.2", - "debug": "^4.3.3", - "socks": "^2.6.2" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/socks-proxy-agent/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "optional": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/socks-proxy-agent/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==", - "optional": true - }, - "node_modules/sprintf": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz", - "integrity": "sha512-4X5KsuXFQ7f+d7Y+bi4qSb6eI+YoifDTGr0MQJXRoYO7BO7evfRCjds6kk3z7l5CiJYxgDN1x5Er4WiyCt+zTQ==", - "deprecated": "The sprintf package is deprecated in favor of sprintf-js.", - "engines": { - "node": ">=0.2.4" - } - }, - "node_modules/sqlite3": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.6.tgz", - "integrity": "sha512-olYkWoKFVNSSSQNvxVUfjiVbz3YtBwTJj+mfV5zpHmqW3sELx2Cf4QCdirMelhM5Zh+KDVaKgQHqCxrqiWHybw==", - "hasInstallScript": true, - "dependencies": { - "@mapbox/node-pre-gyp": "^1.0.0", - "node-addon-api": "^4.2.0", - "tar": "^6.1.11" - }, - "optionalDependencies": { - "node-gyp": "8.x" - }, - "peerDependencies": { - "node-gyp": "8.x" - }, - "peerDependenciesMeta": { - "node-gyp": { - "optional": true - } - } - }, - "node_modules/sqlite3/node_modules/node-addon-api": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.3.0.tgz", - "integrity": "sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ==" - }, - "node_modules/ssri": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", - "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", - "optional": true, - "dependencies": { - "minipass": "^3.1.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/statuses": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", - "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-kit": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/string-kit/-/string-kit-0.17.10.tgz", - "integrity": "sha512-n3/2BeEJrlzztoxeBTt9DVh0dfHordBuZoFsSJs59tk1JoPVvtvNsvAgqu0Nlpj5Y/qoQbnT8jCnfuoHcsfGnw==", - "engines": { - "node": ">=14.15.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-preserve-symlinks-flag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/systemjs": { - "version": "6.14.2", - "resolved": "https://registry.npmjs.org/systemjs/-/systemjs-6.14.2.tgz", - "integrity": "sha512-1TlOwvKWdXxAY9vba+huLu99zrQURDWA8pUTYsRIYDZYQbGyK+pyEP4h4dlySsqo7ozyJBmYD20F+iUHhAltEg==" - }, - "node_modules/tar": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz", - "integrity": "sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ==", - "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^5.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/tar/node_modules/minipass": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", - "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/tarn": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tarn/-/tarn-3.0.2.tgz", - "integrity": "sha512-51LAVKUSZSVfI05vjPESNc5vwqqZpbXCsU+/+wxlOrUjk2SnFTt97v9ZgQrD4YmxYW1Px6w2KjaDitCfkvgxMQ==", - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/terminal": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/terminal/-/terminal-0.1.4.tgz", - "integrity": "sha512-w6OAFpUO+TimZUdQ46dK3fYYOCCBIsS2QUfIEkzX21oJ8tvJOJvJkcmrbleLH5KG02SNohYFDj81bL3VPaULsQ==", - "dependencies": { - "sprintf": ">= 0.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/terminal-kit": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/terminal-kit/-/terminal-kit-3.0.1.tgz", - "integrity": "sha512-KvscEh/893Qza4+1wW9BOYAYFFS3uy8JfuMpyxNS1Rw+bw2Qx33RjVkjzPkfY2hfzAcTEw9KGko4XZuX2scsQw==", - "dependencies": { - "@cronvel/get-pixels": "^3.4.1", - "chroma-js": "^2.4.2", - "lazyness": "^1.2.0", - "ndarray": "^1.0.19", - "nextgen-events": "^1.5.3", - "seventh": "^0.9.2", - "string-kit": "^0.17.10", - "tree-kit": "^0.8.1" - }, - "engines": { - "node": ">=16.13.0" - } - }, - "node_modules/tildify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/tildify/-/tildify-2.0.0.tgz", - "integrity": "sha512-Cc+OraorugtXNfs50hU9KS369rFXCfgGLpfCfvlc+Ud5u6VWmUQsOAa9HbTvheQdYnrdJqqv1e5oIqXppMYnSw==", - "engines": { - "node": ">=8" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", - "engines": { - "node": ">=0.6" - } - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==" - }, - "node_modules/tree-kit": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/tree-kit/-/tree-kit-0.8.1.tgz", - "integrity": "sha512-z29rTLxHce770M/3PzKkBqiIANg+YQwdtdcuYHP9qcgI1ZSaL9LBStWpxY1F/3BmFMqm+1OYdkIdbD45tUgO3Q==", - "engines": { - "node": ">=16.13.0" - } - }, - "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, - "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, - "node_modules/uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", - "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==" - }, - "node_modules/unique-filename": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", - "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", - "optional": true, - "dependencies": { - "unique-slug": "^2.0.0" - } - }, - "node_modules/unique-slug": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", - "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", - "optional": true, - "dependencies": { - "imurmurhash": "^0.1.4" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "peer": true, - "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/utf-8-validate": { - "version": "5.0.10", - "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", - "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", - "hasInstallScript": true, - "dependencies": { - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=6.14.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "node_modules/utility-types": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.10.0.tgz", - "integrity": "sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", - "engines": { - "node": ">= 0.4.0" - } - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/weak-lru-cache": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/weak-lru-cache/-/weak-lru-cache-1.2.2.tgz", - "integrity": "sha512-DEAoo25RfSYMuTGc9vPJzZcZullwIqRDSI9LOy+fkCJPi6hykCnfKaXTuPBDuXAUcqHXyOgFtHNp/kB2FjYHbw==", - "dev": true - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" - }, - "node_modules/webrtc-adapter": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/webrtc-adapter/-/webrtc-adapter-8.2.3.tgz", - "integrity": "sha512-gnmRz++suzmvxtp3ehQts6s2JtAGPuDPjA1F3a9ckNpG1kYdYuHWYpazoAnL9FS5/B21tKlhkorbdCXat0+4xQ==", - "dependencies": { - "sdp": "^3.2.0" - }, - "engines": { - "node": ">=6.0.0", - "npm": ">=3.10.0" - } - }, - "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "optional": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", - "engines": { - "node": ">=0.10.32" - } - }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - } - } -} diff --git a/package.json b/package.json deleted file mode 100644 index b141f5d..0000000 --- a/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "mwse", - "version": "0.1.0", - "description": "Mikro WebSocket Engine", - "scripts": { - "compile": "parcel watch --no-hmr", - "build": "parcel build --no-optimize" - }, - "source": "./frontend/index.ts", - "targets": { - "default": { - "distDir": "./script/", - "publicUrl": "./", - "sourceMap": true, - "outputFormat": "global", - "optimize": true, - "context": "browser", - "engines": { - "chrome": "65", - "android": "4.4.3", - "edge": "16", - "firefox": "59", - "ie": "10", - "ios": "10", - "safari": "10" - } - } - }, - "repository": { - "type": "git", - "url": "http://git.saqut.com/saqut/MWSE" - }, - "keywords": [ - "WebSocket", - "server", - "microservice", - "ws" - ], - "author": "Abdussamed ULUTAŞ ", - "license": "MIT", - "dependencies": { - "compression": "^1.7.4", - "express": "^4.18.2", - "express-basic-auth": "^1.2.1", - "fflate": "^0.8.1", - "joi": "^17.11.0", - "knex": "^3.0.1", - "sqlite3": "^5.1.6", - "systemjs": "^6.14.2", - "terminal": "^0.1.4", - "terminal-kit": "^3.0.0", - "typescript": "^5.2.2", - "webrtc-adapter": "^8.2.3", - "websocket": "^1.0.34" - }, - "devDependencies": { - "@parcel/packager-ts": "^2.7.0", - "@parcel/transformer-typescript-types": "^2.7.0", - "tslib": "^2.4.1" - } -} diff --git a/script/status.xml b/public/status.xml similarity index 100% rename from script/status.xml rename to public/status.xml diff --git a/script/index.js b/script/index.js deleted file mode 100644 index e135477..0000000 --- a/script/index.js +++ /dev/null @@ -1,1672 +0,0 @@ -// modules are defined as an array -// [ module function, map of requires ] -// -// map of requires is short require name -> numeric require -// -// anything defined in a previous bundle is accessed via the -// orig method which is the require for previous bundles - -(function ( - modules, - entry, - mainEntry, - parcelRequireName, - externals, - distDir, - publicUrl, - devServer -) { - /* eslint-disable no-undef */ - var globalObject = - typeof globalThis !== 'undefined' - ? globalThis - : typeof self !== 'undefined' - ? self - : typeof window !== 'undefined' - ? window - : typeof global !== 'undefined' - ? global - : {}; - /* eslint-enable no-undef */ - - // Save the require from previous bundle to this closure if any - var previousRequire = - typeof globalObject[parcelRequireName] === 'function' && - globalObject[parcelRequireName]; - - var importMap = previousRequire.i || {}; - var cache = previousRequire.cache || {}; - // Do not use `require` to prevent Webpack from trying to bundle this call - var nodeRequire = - typeof module !== 'undefined' && - typeof module.require === 'function' && - module.require.bind(module); - - function newRequire(name, jumped) { - if (!cache[name]) { - if (!modules[name]) { - if (externals[name]) { - return externals[name]; - } - // if we cannot find the module within our internal map or - // cache jump to the current global require ie. the last bundle - // that was added to the page. - var currentRequire = - typeof globalObject[parcelRequireName] === 'function' && - globalObject[parcelRequireName]; - if (!jumped && currentRequire) { - return currentRequire(name, true); - } - - // If there are other bundles on this page the require from the - // previous one is saved to 'previousRequire'. Repeat this as - // many times as there are bundles until the module is found or - // we exhaust the require chain. - if (previousRequire) { - return previousRequire(name, true); - } - - // Try the node require function if it exists. - if (nodeRequire && typeof name === 'string') { - return nodeRequire(name); - } - - var err = new Error("Cannot find module '" + name + "'"); - err.code = 'MODULE_NOT_FOUND'; - throw err; - } - - localRequire.resolve = resolve; - localRequire.cache = {}; - - var module = (cache[name] = new newRequire.Module(name)); - - modules[name][0].call( - module.exports, - localRequire, - module, - module.exports, - globalObject - ); - } - - return cache[name].exports; - - function localRequire(x) { - var res = localRequire.resolve(x); - return res === false ? {} : newRequire(res); - } - - function resolve(x) { - var id = modules[name][1][x]; - return id != null ? id : x; - } - } - - function Module(moduleName) { - this.id = moduleName; - this.bundle = newRequire; - this.require = nodeRequire; - this.exports = {}; - } - - newRequire.isParcelRequire = true; - newRequire.Module = Module; - newRequire.modules = modules; - newRequire.cache = cache; - newRequire.parent = previousRequire; - newRequire.distDir = distDir; - newRequire.publicUrl = publicUrl; - newRequire.devServer = devServer; - newRequire.i = importMap; - newRequire.register = function (id, exports) { - modules[id] = [ - function (require, module) { - module.exports = exports; - }, - {}, - ]; - }; - - // Only insert newRequire.load when it is actually used. - // The code in this file is linted against ES5, so dynamic import is not allowed. - // INSERT_LOAD_HERE - - Object.defineProperty(newRequire, 'root', { - get: function () { - return globalObject[parcelRequireName]; - }, - }); - - globalObject[parcelRequireName] = newRequire; - - for (var i = 0; i < entry.length; i++) { - newRequire(entry[i]); - } - - if (mainEntry) { - // Expose entry point to Node, AMD or browser globals - // Based on https://github.com/ForbesLindesay/umd/blob/master/template.js - var mainExports = newRequire(mainEntry); - - // CommonJS - if (typeof exports === 'object' && typeof module !== 'undefined') { - module.exports = mainExports; - - // RequireJS - } else if (typeof define === 'function' && define.amd) { - define(function () { - return mainExports; - }); - } - } -})({"3FuxY":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -var _connection = require("./Connection"); -var _eventPool = require("./EventPool"); -var _eventPoolDefault = parcelHelpers.interopDefault(_eventPool); -var _eventTarget = require("./EventTarget"); -var _eventTargetDefault = parcelHelpers.interopDefault(_eventTarget); -var _ippressure = require("./IPPressure"); -var _peer = require("./Peer"); -var _peerDefault = parcelHelpers.interopDefault(_peer); -var _room = require("./Room"); -var _roomDefault = parcelHelpers.interopDefault(_room); -var _wstsprotocol = require("./WSTSProtocol"); -var _wstsprotocolDefault = parcelHelpers.interopDefault(_wstsprotocol); -class MWSE extends (0, _eventTargetDefault.default) { - /*public static compress(message:string, callback:(e:any) => any) - { - let u : any= []; - let C = new Gzip({ - level: 9, - mem: 12 - },(stream,isLast) => { - u.push(stream); - if(isLast) - { - callback(u); - } - }); - C.push(new TextEncoder().encode(message), true); - }*/ constructor(options){ - super(), this.rooms = new Map(), this.pairs = new Map(), this.peers = new Map(), this.writable = 1, this.readable = 1; - MWSE.rtc = MWSE; - this.server = new (0, _connection.Connection)(this, options); - this.WSTSProtocol = new (0, _wstsprotocolDefault.default)(this); - this.EventPooling = new (0, _eventPoolDefault.default)(this); - this.virtualPressure = new (0, _ippressure.IPPressure)(this); - this.server.connect(); - this.me = new (0, _peerDefault.default)(this); - this.me.scope(()=>{ - this.peers.set('me', this.me); - this.peers.set(this.me.socketId, this.me); - }); - this.server.onActive(async ()=>{ - this.me.setSocketId('me'); - await this.me.metadata(); - this.emit('scope'); - this.activeScope = true; - }); - this.server.onPassive(async ()=>{ - this.emit('close'); - }); - this.packMessagingSystem(); - } - destroy() { - this.server.disconnect(); - } - enableRecaiveData() { - this.WSTSProtocol.SendOnly({ - type: 'connection/packrecaive', - value: 1 - }); - this.readable = 1; - } - disableRecaiveData() { - this.WSTSProtocol.SendOnly({ - type: 'connection/packrecaive', - value: 0 - }); - this.readable = 0; - } - enableSendData() { - this.WSTSProtocol.SendOnly({ - type: 'connection/packsending', - value: 1 - }); - this.writable = 1; - } - disableSendData() { - this.WSTSProtocol.SendOnly({ - type: 'connection/packsending', - value: 0 - }); - this.writable = 0; - } - enableNotifyRoomInfo() { - this.WSTSProtocol.SendOnly({ - type: 'connection/roominfo', - value: 1 - }); - } - disableNotifyRoomInfo() { - this.WSTSProtocol.SendOnly({ - type: 'connection/roominfo', - value: 0 - }); - } - async request(peerId, pack) { - let { pack: answer } = await this.EventPooling.request({ - type: 'request/to', - to: peerId, - pack - }); - return answer; - } - async response(peerId, requestId, pack) { - this.WSTSProtocol.SendOnly({ - type: 'response/to', - to: peerId, - pack, - id: requestId - }); - } - packMessagingSystem() { - this.EventPooling.signal('pack', (payload)=>{ - if (this.readable) { - let { from, pack } = payload; - this.peer(from, true).emit('pack', pack); - } - }); - this.EventPooling.signal('request', (payload)=>{ - let { from, pack, id } = payload; - let scope = { - body: pack, - response: (pack)=>{ - this.response(from, id, pack); - }, - peer: this.peer(from, true) - }; - this.peer(from, true).emit('request', scope); - this.peer('me').emit('request', scope); - }); - this.EventPooling.signal('pack/room', (payload)=>{ - if (this.readable) { - let { from, pack, sender } = payload; - this.room(from).emit('message', pack, this.peer(sender)); - } - }); - this.EventPooling.signal('room/joined', (payload)=>{ - let { id, roomid } = payload; - let room = this.room(roomid); - let peer = this.peer(id, true); - room.peers.set(peer.socketId, peer); - room.emit('join', peer); - }); - this.EventPooling.signal('room/info', (payload)=>{ - let { roomId, name, value } = payload; - this.room(roomId).emit('updateinfo', name, value); - }); - this.EventPooling.signal('room/ejected', (payload)=>{ - let { id, roomid } = payload; - let room = this.room(roomid); - let peer = this.peer(id, true); - room.peers.delete(peer.socketId); - room.emit('eject', peer); - }); - this.EventPooling.signal('room/closed', (payload)=>{ - let { roomid } = payload; - let room = this.room(roomid); - room.peers.clear(); - room.emit('close'); - this.rooms.delete(roomid); - }); - this.EventPooling.signal("pair/info", (payload)=>{ - let { from, name, value } = payload; - let peer = this.peer(from, true); - peer.info.info[name] = value; - peer.emit("info", name, value); - }); - this.EventPooling.signal("request/pair", (payload)=>{ - let { from, info } = payload; - let peer = this.peer(from, true); - peer.info.info = info; - peer.emit("request/pair", peer); - this.peer('me').emit('request/pair', peer); - }); - this.EventPooling.signal("peer/disconnect", (payload)=>{ - let { id } = payload; - let peer = this.peer(id, true); - peer.emit("disconnect", peer); - }); - this.EventPooling.signal("accepted/pair", (payload)=>{ - let { from, info } = payload; - let peer = this.peer(from, true); - peer.info.info = info; - peer.emit("accepted/pair", peer); - this.peer('me').emit('accepted/pairr', peer); - }); - this.EventPooling.signal("end/pair", (payload)=>{ - let { from, info } = payload; - let peer = this.peer(from, true); - peer.emit("endPair", info); - this.peer('me').emit('endPair', from, info); - }); - } - room(options) { - if (typeof options == "string") { - if (this.rooms.has(options)) return this.rooms.get(options); - } - let room = new (0, _roomDefault.default)(this); - room.setRoomOptions(options); - this.emit('room'); - return room; - } - peer(options, isActive = false) { - if (typeof options == "string") { - if (this.peers.has(options)) return this.peers.get(options); - if (this.pairs.has(options)) return this.pairs.get(options); - } - let peer = new (0, _peerDefault.default)(this); - peer.setPeerOptions(options); - peer.active = isActive; - this.peers.set(peer.socketId, peer); - this.emit('peer', peer); - return peer; - } -} -exports.default = MWSE; -window.MWSE = MWSE; - -},{"./Connection":"1vUh4","./EventPool":"602qx","./EventTarget":"faGYI","./IPPressure":"l0Hru","./Peer":"imPsO","./Room":"7JoU4","./WSTSProtocol":"i9gBw","@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"1vUh4":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "Connection", ()=>Connection); -class Connection { - constructor(mwse, options){ - this.autoPair = false; - this.connected = false; - this.autoReconnect = true; - this.autoReconnectTimeout = 3000; - this.recaivePackEvent = []; - this.activeConnectionEvent = []; - this.passiveConnectionEvent = []; - if (options.endpoint == "auto") { - const RootURL = document.currentScript.src; - let scriptPath = new URL(RootURL); - let isSecurity = scriptPath.protocol == "https:"; - let dumeUrl = scriptPath.pathname.split('/').slice(0, -1).join('/') + '/'; - let wsSocket = new URL(dumeUrl, scriptPath); - wsSocket.protocol = isSecurity ? 'wss:' : 'ws:'; - this.endpoint = new URL(wsSocket.href); - } else try { - // Testing - this.endpoint = new URL(options.endpoint); - } catch { - throw new Error("endpoint is required"); - } - if (typeof options.autoReconnect == "boolean") this.autoReconnect = true; - else if (options.autoReconnect) { - this.autoReconnect = true; - this.autoReconnectTimeout = options.autoReconnect.timeout; - } - } - connect() { - if (this.autoReconnectTimer) clearTimeout(this.autoReconnectTimer); - this.ws = new WebSocket(this.endpoint.href); - this.addWSEvents(); - } - disconnect() { - /** - * Eğer bilinerek elle kapatıldıysa otomatik tekrar bağlanmasının - * önüne geçmek için autoReconnect bayrağını her zaman kapalı tutmak gerekir - */ this.autoReconnect = false; - this.ws.close(); - } - addWSEvents() { - this.ws.addEventListener("open", ()=>this.eventOpen()); - this.ws.addEventListener("close", ()=>this.eventClose()); - this.ws.addEventListener("error", ()=>this.eventError()); - this.ws.addEventListener("message", ({ data })=>this.eventMessage(data)); - } - eventOpen() { - this.connected = true; - for (const callback of this.activeConnectionEvent)callback(void 0); - } - eventClose() { - for (const callback of this.passiveConnectionEvent)callback(void 0); - this.connected = false; - if (this.autoReconnect) this.autoReconnectTimer = setTimeout(()=>this.connect(), this.autoReconnectTimeout); - } - eventError() { - this.connected = false; - } - onRecaivePack(func) { - this.recaivePackEvent.push(func); - } - onActive(func) { - if (this.connected) func(); - else this.activeConnectionEvent.push(func); - } - onPassive(func) { - if (!this.connected) func(); - else this.passiveConnectionEvent.push(func); - } - eventMessage(data) { - if (typeof data == "string") { - let $data = JSON.parse(data); - for (const callback of this.recaivePackEvent)callback($data); - } - } - tranferToServer(data) { - if (this.connected) this.ws.send(JSON.stringify(data)); - } -} - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"4KC4J":[function(require,module,exports,__globalThis) { -exports.interopDefault = function(a) { - return a && a.__esModule ? a : { - default: a - }; -}; -exports.defineInteropFlag = function(a) { - Object.defineProperty(a, '__esModule', { - value: true - }); -}; -exports.exportAll = function(source, dest) { - Object.keys(source).forEach(function(key) { - if (key === 'default' || key === '__esModule' || Object.prototype.hasOwnProperty.call(dest, key)) return; - Object.defineProperty(dest, key, { - enumerable: true, - get: function() { - return source[key]; - } - }); - }); - return dest; -}; -exports.export = function(dest, destName, get) { - Object.defineProperty(dest, destName, { - enumerable: true, - get: get - }); -}; - -},{}],"602qx":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -class EventPool { - constructor(wsts){ - this.events = new Map(); - this.signals = new Map(); - this.requests = new Map(); - this.count = 0; - this.wsts = wsts; - } - request(msg) { - return new Promise((ok, rej)=>{ - let id = ++this.count; - this.events.set(id, [ - (data)=>{ - ok(data); - }, - (data)=>{ - rej(data); - } - ]); - this.wsts.WSTSProtocol.SendRequest(msg, id); - }); - } - stream(msg, callback) { - let id = ++this.count; - this.wsts.WSTSProtocol.StartStream(msg, id); - this.events.set(id, [ - (data)=>{ - callback(data); - }, - ()=>{} - ]); - } - signal(event, callback) { - let T = this.signals.get(event); - if (!T) this.signals.set(event, [ - callback - ]); - else T.push(callback); - } -} -exports.default = EventPool; - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"faGYI":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -class EventTarget { - emit(eventName, ...args) { - if (this.events[eventName]) for (const callback of this.events[eventName])callback(...args); - } - on(eventName, callback) { - if (this.events[eventName]) this.events[eventName].push(callback); - else this.events[eventName] = [ - callback - ]; - } - scope(f) { - if (this.activeScope) f(); - else this.on('scope', f); - } - constructor(){ - this.events = {}; - this.activeScope = false; - } -} -exports.default = EventTarget; - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"l0Hru":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "IPPressure", ()=>IPPressure); -class IPPressure { - constructor(mwse){ - this.mwse = mwse; - } - async allocAPIPAddress() { - let { status, ip } = await this.mwse.EventPooling.request({ - type: 'alloc/APIPAddress' - }); - if (status == 'success') { - this.APIPAddress = ip; - return ip; - } else throw new Error("Error Allocated Access Point IP Address"); - } - async allocAPNumber() { - let { status, number } = await this.mwse.EventPooling.request({ - type: 'alloc/APNumber' - }); - if (status == 'success') { - this.APNumber = number; - return number; - } else throw new Error("Error Allocated Access Point Number"); - } - async allocAPShortCode() { - let { status, code } = await this.mwse.EventPooling.request({ - type: 'alloc/APShortCode' - }); - if (status == 'success') { - this.APShortCode = code; - return code; - } else throw new Error("Error Allocated Access Point Short Code"); - } - async reallocAPIPAddress() { - let { status, ip } = await this.mwse.EventPooling.request({ - type: 'realloc/APIPAddress' - }); - if (status == 'success') { - this.APIPAddress = ip; - return ip; - } else throw new Error("Error Reallocated Access Point IP Address"); - } - async reallocAPNumber() { - let { status, number } = await this.mwse.EventPooling.request({ - type: 'realloc/APNumber' - }); - if (status == 'success') { - this.APNumber = number; - return number; - } else throw new Error("Error Reallocated Access Point Number"); - } - async reallocAPShortCode() { - let { status, code } = await this.mwse.EventPooling.request({ - type: 'realloc/APShortCode' - }); - if (status == 'success') { - this.APShortCode = code; - return code; - } else throw new Error("Error Reallocated Access Point Short Code"); - } - async releaseAPIPAddress() { - let { status } = await this.mwse.EventPooling.request({ - type: 'release/APIPAddress' - }); - if (status == 'success') this.APIPAddress = undefined; - else throw new Error("Error release Access Point IP Address"); - } - async releaseAPNumber() { - let { status } = await this.mwse.EventPooling.request({ - type: 'release/APNumber' - }); - if (status == 'success') this.APNumber = undefined; - else throw new Error("Error release Access Point Number"); - } - async releaseAPShortCode() { - let { status } = await this.mwse.EventPooling.request({ - type: 'release/APShortCode' - }); - if (status == 'success') this.APShortCode = undefined; - else throw new Error("Error release Access Point Short Code"); - } - async queryAPIPAddress(ip) { - let { status, socket } = await this.mwse.EventPooling.request({ - type: 'whois/APIPAddress', - whois: ip - }); - if (status == "success") return socket; - else return null; - } - async queryAPNumber(number) { - let { status, socket } = await this.mwse.EventPooling.request({ - type: 'whois/APNumber', - whois: number - }); - if (status == "success") return socket; - else return null; - } - async queryAPShortCode(code) { - let { status, socket } = await this.mwse.EventPooling.request({ - type: 'whois/APShortCode', - whois: code - }); - if (status == "success") return socket; - else return null; - } -} - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"imPsO":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -var _eventTarget = require("./EventTarget"); -var _eventTargetDefault = parcelHelpers.interopDefault(_eventTarget); -var _peerInfo = require("./PeerInfo"); -var _webRTC = require("./WebRTC"); -var _webRTCDefault = parcelHelpers.interopDefault(_webRTC); -var IMessageSymbase = /*#__PURE__*/ function(IMessageSymbase) { - IMessageSymbase[IMessageSymbase["PayloadMessagePack"] = -12873.54] = "PayloadMessagePack"; - IMessageSymbase[IMessageSymbase["PayloadRTCBasePack"] = -12884.54] = "PayloadRTCBasePack"; - return IMessageSymbase; -}(IMessageSymbase || {}); -class Peer extends (0, _eventTargetDefault.default) { - constructor(wsts){ - super(), this.options = {}, this.selfSocket = false, this.active = false, this.peerConnection = false, this.primaryChannel = "datachannel"; - this.mwse = wsts; - this.rtc = this.createRTC(); - this.info = new (0, _peerInfo.PeerInfo)(this); - this.on('pack', (data)=>{ - if (data.type == ':rtcpack:') return this.rtc.emit("input", data.payload); - this.emit("message", data); - }); - } - createRTC(rtcConfig, rtcServers) { - this.rtc = new (0, _webRTCDefault.default)(rtcConfig, rtcServers); - this.rtc.peer = this; - this.rtc.on("connected", ()=>{ - this.peerConnection = true; - }); - this.rtc.on('disconnected', ()=>{ - this.peerConnection = false; - }); - this.rtc.on("output", (payload)=>{ - this.send({ - type: ':rtcpack:', - payload: payload - }); - }); - this.rtc.on("message", (payload)=>{ - this.emit("pack", payload); - }); - return this.rtc; - } - setPeerOptions(options) { - if (typeof options == "string") this.setSocketId(options); - else this.options = options; - } - setSocketId(uuid) { - this.socketId = uuid; - } - async metadata() { - if (this.socketId == 'me') { - let result = await this.mwse.EventPooling.request({ - type: 'my/socketid' - }); - this.selfSocket = true; - this.active ||= true; - this.socketId = result; - this.emit('scope'); - this.activeScope = true; - return result; - } - } - async request(pack) { - if (this.active) return await this.mwse.request(this.socketId, pack); - } - equalTo(peer) { - return this.socketId == peer.socketId; - } - async isReachable() { - return await this.mwse.EventPooling.request({ - type: 'is/reachable', - to: this.socketId - }); - } - async enablePairAuth() { - await this.mwse.EventPooling.request({ - type: 'auth/pair-system', - value: 'everybody' - }); - } - async disablePairAuth() { - await this.mwse.EventPooling.request({ - type: 'auth/pair-system', - value: 'disable' - }); - } - async enablePairInfo() { - await this.mwse.EventPooling.request({ - type: 'connection/pairinfo', - value: true - }); - } - async disablePairInfo() { - await this.mwse.EventPooling.request({ - type: 'connection/pairinfo', - value: false - }); - } - async requestPair() { - let { message, status } = await this.mwse.EventPooling.request({ - type: 'request/pair', - to: this.socketId - }); - if (message == "ALREADY-PAIRED" || message == "ALREADY-REQUESTED") console.warn("Already paired or pair requested"); - if (status == "fail") { - console.error("Request Pair Error", status, message); - return false; - } - return true; - } - async endPair() { - await this.mwse.EventPooling.request({ - type: 'end/pair', - to: this.socketId - }); - this.forget(); - } - async acceptPair() { - let { message, status } = await this.mwse.EventPooling.request({ - type: 'accept/pair', - to: this.socketId - }); - if (status == "fail") { - console.error("Pair Error", status, message); - return false; - } - return true; - } - async rejectPair() { - let { message, status } = await this.mwse.EventPooling.request({ - type: 'reject/pair', - to: this.socketId - }); - if (status == "fail") { - console.error("Pair Error", status, message); - return false; - } - return true; - } - async getPairedList() { - let { value } = await this.mwse.EventPooling.request({ - type: 'pair/list', - to: this.socketId - }); - return value; - } - async send(pack) { - let isOpenedP2P = this.peerConnection && this.rtc?.active; - let isOpenedServer = this.mwse.server.connected; - let sendChannel; - if (isOpenedP2P && isOpenedServer) { - if (this.primaryChannel == "websocket") sendChannel = "websocket"; - else sendChannel = "datachannel"; - } else if (isOpenedServer) sendChannel = "websocket"; - else sendChannel = "datachannel"; - if (sendChannel == "websocket") { - if (!this.mwse.writable) return console.warn("Socket is not writable"); - await this.mwse.EventPooling.request({ - type: 'pack/to', - pack, - to: this.socketId - }); - } else { - if (pack.type != ':rtcpack:') this.rtc?.sendMessage(pack); - else return console.warn("Socket is not writable"); - } - } - async forget() { - this.mwse.peers.delete(this.socketId); - this.mwse.pairs.delete(this.socketId); - } -} -exports.default = Peer; - -},{"./EventTarget":"faGYI","./PeerInfo":"4gWZ7","./WebRTC":"buLge","@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"4gWZ7":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "PeerInfo", ()=>PeerInfo); -class PeerInfo { - constructor(mwse){ - this.info = {}; - this.peer = mwse; - } - async fetch(name) { - if (name) { - let rinfo = await this.peer.mwse.EventPooling.request({ - type: "peer/info", - peer: this.peer.socketId, - name - }); - if (rinfo.status == "success") this.info = rinfo.info; - else console.warn(rinfo.message); - } else { - let rinfo = await this.peer.mwse.EventPooling.request({ - type: "peer/info", - peer: this.peer.socketId - }); - if (rinfo.status == "success") this.info = rinfo.info; - else console.warn(rinfo.message); - } - return this.info; - } - set(name, value) { - this.info[name] = value; - this.peer.mwse.WSTSProtocol.SendOnly({ - type: "auth/info", - name, - value - }); - } - get(name) { - return name ? this.info[name] : this.info; - } -} - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"buLge":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -var _p2PfileSender = require("./P2PFileSender"); -var _p2PfileSenderDefault = parcelHelpers.interopDefault(_p2PfileSender); -class WebRTC { - static{ - this.channels = new Map(); - } - static{ - this.requireGC = false; - } - static{ - this.defaultRTCConfig = { - iceCandidatePoolSize: 0, - iceTransportPolicy: "all", - rtcpMuxPolicy: "require" - }; - } - isPolite() { - let myId = this.peer?.mwse.peer('me').socketId; - let peerId = this.peer?.socketId; - return myId < peerId; - } - static{ - this.defaultICEServers = [ - { - urls: "stun:stun.l.google.com:19302" - }, - { - urls: "stun:stun1.l.google.com:19302" - }, - { - urls: "stun:stun2.l.google.com:19302" - }, - { - urls: "stun:stun3.l.google.com:19302" - }, - { - urls: "stun:stun4.l.google.com:19302" - } - ]; - } - constructor(rtcConfig, rtcServers){ - this.active = false; - this.connectionStatus = "new"; - this.iceStatus = "new"; - this.gatheringStatus = "new"; - this.signalingStatus = ""; - this.recaivingStream = new Map(); - this.sendingStream = new Map(); - this.events = {}; - this.makingOffer = false; - this.ignoreOffer = false; - this.isSettingRemoteAnswerPending = false; - this.candicatePack = []; - let config = {}; - if (rtcConfig) Object.assign(config, WebRTC.defaultRTCConfig, rtcConfig); - else Object.assign(config, WebRTC.defaultRTCConfig); - config.iceServers = rtcServers || WebRTC.defaultICEServers; - this.rtc = new RTCPeerConnection(config); - this.rtc.addEventListener("connectionstatechange", ()=>{ - this.eventConnectionState(); - }); - this.rtc.addEventListener("icecandidate", (...args)=>{ - this.eventIcecandidate(...args); - }); - this.rtc.addEventListener("iceconnectionstatechange", ()=>{ - this.eventICEConnectionState(); - }); - this.rtc.addEventListener("icegatheringstatechange", ()=>{ - this.eventICEGatherinState(); - }); - this.rtc.addEventListener("negotiationneeded", ()=>{ - this.eventNogationNeeded(); - }); - this.rtc.addEventListener("signalingstatechange", ()=>{ - this.eventSignalingState(); - }); - this.rtc.addEventListener("track", (...args)=>{ - this.eventTrack(...args); - }); - this.rtc.addEventListener("datachannel", (...args)=>{ - this.eventDatachannel(...args); - }); - this.on('input', async (data)=>{ - switch(data.type){ - case "icecandidate": - try { - if (this.rtc.remoteDescription) await this.rtc.addIceCandidate(new RTCIceCandidate(data.value)); - else this.candicatePack.push(new RTCIceCandidate(data.value)); - } catch (error) { - debugger; - } finally{ - console.log("ICE Canbet"); - } - break; - case "offer": - { - let readyForOffer = !this.makingOffer && (this.rtc.signalingState == "stable" || this.isSettingRemoteAnswerPending); - const offerCollision = !readyForOffer; - this.ignoreOffer = !this.isPolite() && offerCollision; - if (this.ignoreOffer) return; - this.isSettingRemoteAnswerPending = false; - await this.rtc.setRemoteDescription(new RTCSessionDescription(data.value)); - this.isSettingRemoteAnswerPending = false; - for (const candidate of this.candicatePack)await this.rtc.addIceCandidate(candidate); - let answer = await this.rtc.createAnswer({ - offerToReceiveAudio: true, - offerToReceiveVideo: true - }); - await this.rtc.setLocalDescription(answer); - this.send({ - type: 'answer', - value: answer - }); - break; - } - case "answer": - await this.rtc.setRemoteDescription(new RTCSessionDescription(data.value)); - for (const candidate of this.candicatePack)await this.rtc.addIceCandidate(candidate); - break; - case "streamInfo": - { - let { id, value } = data; - let streamInfo = this.recaivingStream.get(id); - if (!streamInfo) this.recaivingStream.set(id, value); - else this.recaivingStream.set(id, { - ...streamInfo, - ...value - }); - this.send({ - type: 'streamAccept', - id - }); - break; - } - case "streamRemoved": - { - let { id } = data; - this.emit('stream:stopped', this.recaivingStream.get(id)); - this.recaivingStream.delete(id); - break; - } - case "streamAccept": - { - let { id } = data; - let sendingStream = this.sendingStream.get(id); - let senders = []; - if (sendingStream && sendingStream.stream) { - for (const track of sendingStream.stream.getTracks())senders.push(this.rtc.addTrack(track, sendingStream.stream)); - sendingStream.senders = senders; - } - this.emit('stream:accepted', sendingStream); - break; - } - case "message": - this.emit('message', data.payload); - break; - } - }); - } - addEventListener(event, callback) { - (this.events[event] || (this.events[event] = [])).push(callback); - } - on(event, callback) { - this.addEventListener(event, callback); - } - async dispatch(event, ...args) { - if (this.events[event]) for (const callback of this.events[event])await callback(...args); - } - async emit(event, ...args) { - await this.dispatch(event, ...args); - } - connect() { - if (!this.channel) this.createDefaultDataChannel(); - } - sendMessage(data) { - if (data.type == ':rtcpack:') throw "WebRTC Kanal\u0131nda S\u0131zma"; - this.send({ - type: 'message', - payload: data - }); - } - createDefaultDataChannel() { - let dt = this.rtc.createDataChannel(':default:', { - ordered: true - }); - dt.addEventListener("open", ()=>{ - this.channel = dt; - WebRTC.channels.set(this.id, this); - this.active = true; - }); - dt.addEventListener("message", ({ data })=>{ - let pack = JSON.parse(data); - this.emit('input', pack); - }); - dt.addEventListener("close", ()=>{ - this.channel = undefined; - this.active = false; - }); - } - destroy() { - this.active = false; - if (this.channel) { - this.channel.close(); - this.channel = undefined; - } - if (this.rtc) this.rtc.close(); - this.emit('disconnected'); - WebRTC.channels.delete(this.id); - } - eventDatachannel(event) { - if (event.channel.label == ':default:') { - WebRTC.channels.set(this.id, this); - this.channel = event.channel; - this.active = true; - event.channel.addEventListener("message", ({ data })=>{ - let pack = JSON.parse(data); - this.emit('input', pack); - }); - event.channel.addEventListener("close", ()=>{ - this.channel = undefined; - WebRTC.channels.delete(this.id); - WebRTC.requireGC = true; - this.active = false; - }); - } else this.emit('datachannel', event.channel); - } - send(data) { - if (this.channel?.readyState == "open") this.channel.send(JSON.stringify(data)); - else this.emit('output', data); - } - eventConnectionState() { - this.connectionStatus = this.rtc.connectionState; - if (this.connectionStatus == 'connected') { - if (this.active == false) this.emit('connected'); - } - if (this.connectionStatus == 'failed') this.rtc.restartIce(); - if (this.connectionStatus == "closed") { - if (this.active) this.destroy(); - } - } - eventIcecandidate(event) { - if (event.candidate) this.send({ - type: 'icecandidate', - value: event.candidate - }); - } - eventICEConnectionState() { - this.iceStatus = this.rtc.iceConnectionState; - } - eventICEGatherinState() { - this.gatheringStatus = this.rtc.iceGatheringState; - } - async eventNogationNeeded() { - try { - this.makingOffer = true; - let offer = await this.rtc.createOffer({ - iceRestart: true, - offerToReceiveAudio: true, - offerToReceiveVideo: true - }); - await this.rtc.setLocalDescription(offer); - this.send({ - type: 'offer', - value: offer - }); - } catch (error) { - console.error(`Nogation Error:`, error); - } finally{ - this.makingOffer = false; - } - } - eventSignalingState() { - this.signalingStatus = this.rtc.signalingState; - } - eventTrack(event) { - let rtpRecaiver = event.receiver; - if (event.streams.length) for (const stream of event.streams){ - let streamInfo = this.recaivingStream.get(stream.id); - (streamInfo.recaivers || (streamInfo.recaivers = [])).push(rtpRecaiver); - if (this.recaivingStream.get(stream.id).stream == null) { - streamInfo.stream = stream; - this.emit('stream:added', this.recaivingStream.get(stream.id)); - } else streamInfo.stream = stream; - } - } - sendStream(stream, name, info) { - this.send({ - type: 'streamInfo', - id: stream.id, - value: { - ...info, - name: name - } - }); - this.sendingStream.set(stream.id, { - ...info, - id: stream.id, - name: name, - stream - }); - } - stopStream(_stream) { - if (this.connectionStatus != 'connected') return; - if (this.sendingStream.has(_stream.id)) { - let { stream } = this.sendingStream.get(_stream.id); - for (const track of stream.getTracks()){ - for (const RTCPSender of this.rtc.getSenders())if (RTCPSender.track?.id == track.id) this.rtc.removeTrack(RTCPSender); - } - this.send({ - type: 'streamRemoved', - id: stream.id - }); - this.sendingStream.delete(_stream.id); - } - } - stopAllStreams() { - if (this.connectionStatus != 'connected') return; - for (const [, { stream }] of this.sendingStream){ - if (stream == undefined) continue; - for (const track of stream.getTracks()){ - for (const RTCPSender of this.rtc.getSenders())if (RTCPSender.track?.id == track.id) this.rtc.removeTrack(RTCPSender); - } - this.send({ - type: 'streamRemoved', - id: stream.id - }); - } - this.sendingStream.clear(); - } - async SendFile(file, meta) { - if (!this.peer) throw new Error("Peer is not ready"); - this.FileTransportChannel = new (0, _p2PfileSenderDefault.default)(this, this.peer); - await this.FileTransportChannel.SendFile(file, meta); - } - async RecaiveFile(chnlCount, filemeta, totalSize) { - if (!this.peer) throw new Error("Peer is not ready"); - this.FileTransportChannel = new (0, _p2PfileSenderDefault.default)(this, this.peer); - return await new Promise((recaivedFile)=>{ - if (this.FileTransportChannel) this.FileTransportChannel.RecaiveFile(this.rtc, filemeta, chnlCount, totalSize, (file)=>{ - recaivedFile(file); - }); - }); - } -} -exports.default = WebRTC; -WebRTC.requireGC = false; -setInterval(()=>{ - if (WebRTC.requireGC == false) return; - let img = document.createElement("img"); - img.src = window.URL.createObjectURL(new Blob([ - new ArrayBuffer(5e+7) - ])); - img.onerror = function() { - window.URL.revokeObjectURL(this.src); - }; - WebRTC.requireGC = false; -}, 3000); - -},{"./P2PFileSender":"ga16E","@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"ga16E":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -class P2PFileSender { - constructor(webrtc, peer){ - this.totalSize = 0; - this.isReady = false; - this.isStarted = false; - this.isSending = false; - this.isRecaiving = false; - this.processedSize = 0; - this.bufferSizePerChannel = 10e6; - this.bufferSizePerPack = 10e3; - this.safeBufferSizePerPack = 9999; - this.webrtc = webrtc; - this.rtc = webrtc.rtc; - this.peer = peer; - } - async RecaiveFile(_rtc, fileMetadata, channelCount, _totalSize, onEnded) { - //let totals = {}; - // let index = 0; - /*setChannelStatus(Array.from({length:channelCount}).map((e, index) => { - return { - name: `${index+1}. Kanal`, - current: 0, - currentTotal: 0, - total: 0 - } - }));*/ let parts = []; - this.webrtc.on('datachannel', (datachannel)=>{ - //let channelIndex = index++; - let current = 0; - let totalSize = 0; - let currentPart = 0; - let bufferAmount = []; - datachannel.onmessage = function({ data }) { - if (totalSize == 0) { - let { size, part } = JSON.parse(data); - totalSize = size; - currentPart = part; - /*updateChannelStatus(channelIndex, n => { - return { - ...n, - total: totalSize, - current: 0 - } - });*/ datachannel.send("READY"); - } else { - current += data.byteLength; - bufferAmount.push(data); - /*updateChannelStatus(channelIndex, n => { - return { - ...n, - current: data.byteLength + n.current, - currentTotal: data.byteLength + n.currentTotal, - } - }); - setProcessedSize(n => n + data.byteLength);*/ if (current == totalSize) { - parts[currentPart] = new Blob(bufferAmount); - bufferAmount = []; - //totals[datachannel.label] += totalSize; - totalSize = 0; - currentPart = 0; - current = 0; - datachannel.send("TOTAL_RECAIVED"); - } - } - }; - datachannel.onclose = ()=>{ - channelCount--; - if (channelCount == 0) { - let file = new File(parts, fileMetadata.name, { - type: fileMetadata.type, - lastModified: +new Date - }); - onEnded(file); - } - }; - }); - } - async SendFile(file, metadata) { - this.isSending = true; - this.isStarted = true; - let buffer = await file.arrayBuffer(); - let partCount = Math.ceil(buffer.byteLength / 10e6); - let channelCount = Math.min(5, partCount); - if (this.webrtc.iceStatus != "connected") throw new Error("WebRTC is a not ready"); - this.peer.send({ - type: 'file', - name: file.name, - size: file.size, - mimetype: file.type, - partCount, - channelCount, - metadata: metadata - }); - let channels = []; - for(let channelIndex = 0; channelIndex < channelCount; channelIndex++){ - let channel = this.rtc.createDataChannel("\\?\\file_" + channelIndex); - channel.binaryType = "arraybuffer"; - await new Promise((ok)=>{ - channel.onopen = ()=>{ - ok(void 0); - }; - }); - channels.push(channel); - } - let currentPart = 0; - let next = ()=>{ - if (currentPart < partCount) { - let bufferPart = buffer.slice(currentPart * 10e6, currentPart * 10e6 + 10e6); - currentPart++; - return [ - bufferPart, - currentPart - 1 - ]; - } - return [ - false, - 0 - ]; - }; - let spyChannelIndex = channels.length; - await new Promise((ok)=>{ - for(let channelIndex = 0; channelIndex < channels.length; channelIndex++)this.sendPartition(channels[channelIndex], next, channelIndex, ()=>{ - spyChannelIndex--; - if (spyChannelIndex == 0) { - this.isSending = false; - this.isStarted = false; - ok(undefined); - } - }); - }); - } - sendPartition(channel, nextblob10mb, _channelIndex, onEnded) { - let [currentBuffer, currentPartition] = nextblob10mb(); - let currentPart = 0; - let next = ()=>{ - if (!(currentBuffer instanceof ArrayBuffer)) return; - let bufferPart = currentBuffer.slice(currentPart * 16e3, currentPart * 16e3 + 16e3); - currentPart++; - if (bufferPart.byteLength != 0) /* - updateChannelStatus(channelIndex, n => { - return { - ...n, - current: bufferPart.byteLength + n.current, - currentTotal: bufferPart.byteLength + n.currentTotal - } - }); - setProcessedSize(n => n + bufferPart.byteLength); - */ return bufferPart; - }; - channel.addEventListener("message", ({ data })=>{ - if (data == "READY") this.sendFileChannel(channel, next); - if (data == "TOTAL_RECAIVED") { - [currentBuffer, currentPartition] = nextblob10mb(); - currentPart = 0; - if (currentBuffer != false) /*updateChannelStatus(channelIndex, n => { - return { - ...n, - total: currentBuffer.byteLength, - current: 0, - } - });*/ channel.send(JSON.stringify({ - size: currentBuffer.byteLength, - part: currentPartition - })); - else { - channel.close(); - onEnded(); - } - } - }); - channel.send(JSON.stringify({ - size: currentBuffer.byteLength, - part: currentPartition - })); - } - sendFileChannel(channel, getNextBlob) { - channel.addEventListener("bufferedamountlow", function() { - let buffer = getNextBlob(); - if (buffer) channel.send(buffer); - }); - channel.bufferedAmountLowThreshold = 15999; - let c = getNextBlob(); - c && channel.send(c); - } -} -exports.default = P2PFileSender; - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"7JoU4":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -var _eventTarget = require("./EventTarget"); -var _eventTargetDefault = parcelHelpers.interopDefault(_eventTarget); -var _roomInfo = require("./RoomInfo"); -class Room extends (0, _eventTargetDefault.default) { - constructor(wsts){ - super(), this.peers = new Map(); - this.mwse = wsts; - this.info = new (0, _roomInfo.RoomInfo)(this); - } - setRoomOptions(options) { - if (typeof options == "string") this.roomId = options; - else { - let defaultOptions = { - joinType: "free", - ifexistsJoin: true, - accessType: "private", - notifyActionInvite: true, - notifyActionJoined: true, - notifyActionEjected: true, - autoFetchInfo: true - }; - Object.assign(defaultOptions, options); - this.config = defaultOptions; - } - } - setRoomId(uuid) { - this.roomId = uuid; - } - async createRoom(roomOptions) { - let config = this.config || roomOptions; - let result = await this.mwse.EventPooling.request({ - type: 'create-room', - ...config - }); - if (result.status == 'fail') { - if (result.message == "ALREADY-EXISTS" && this.config.ifexistsJoin) return this.join(); - throw new Error(result.message || result.messages); - } else { - this.options = { - ...this.config, - ...result.room - }; - this.roomId = result.room.id; - this.mwse.rooms.set(this.roomId, this); - } - } - async join() { - let result = await this.mwse.EventPooling.request({ - type: 'joinroom', - name: this.config.name, - credential: this.config.credential, - autoFetchInfo: this.config.autoFetchInfo || false - }); - if (result.status == 'fail') throw new Error(result.message); - else { - this.options = { - ...this.config, - ...result.room - }; - if (result.info) this.info.info = result.info; - this.roomId = result.room.id; - this.mwse.rooms.set(this.roomId, this); - } - } - async eject() { - let { type } = await this.mwse.EventPooling.request({ - type: 'ejectroom', - roomId: this.roomId - }); - this.peers.clear(); - if (type == 'success') this.mwse.rooms.delete(this.roomId); - } - async send(pack, wom = false, handshake = false) { - if (!this.mwse.writable) return console.warn("Socket is not writable"); - if (handshake) { - let { type } = await this.mwse.EventPooling.request({ - type: 'pack/room', - pack, - to: this.roomId, - wom, - handshake - }); - if (type == "fail") throw new Error("Cant send message to room"); - } else await this.mwse.EventPooling.request({ - type: 'pack/room', - pack, - to: this.roomId, - wom, - handshake - }); - } - async fetchPeers(filter, onlyNumber = false) { - if (onlyNumber) { - let { count } = await this.mwse.EventPooling.request({ - type: 'room/peer-count', - roomId: this.roomId, - filter: filter || {} - }); - return count; - } else { - let { status, peers } = await this.mwse.EventPooling.request({ - type: 'room-peers', - roomId: this.roomId, - filter: filter || {} - }); - let cup = []; - if (status == 'fail') throw new Error("Cant using peers on room"); - else if (status == 'success') for (const peerid of peers){ - let peer = this.mwse.peer(peerid, true); - cup.push(peer); - this.peers.set(peerid, peer); - } - return cup; - } - } -} -exports.default = Room; - -},{"./EventTarget":"faGYI","./RoomInfo":"5x1BB","@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"5x1BB":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -parcelHelpers.export(exports, "RoomInfo", ()=>RoomInfo); -class RoomInfo { - constructor(room){ - this.info = {}; - this.room = room; - this.room.on('updateinfo', (name, value)=>{ - this.info[name] = value; - }); - } - async fetch(name) { - if (name) { - let rinfo = await this.room.mwse.EventPooling.request({ - type: "room/getinfo", - roomId: this.room.roomId, - name - }); - if (rinfo.status == "success") this.info = rinfo.value; - else console.warn(rinfo.message); - } else { - let rinfo = await this.room.mwse.EventPooling.request({ - type: "room/info", - roomId: this.room.roomId - }); - if (rinfo.status == "success") this.info = rinfo.value; - else console.warn(rinfo.message); - } - return this.info; - } - set(name, value) { - this.info[name] = value; - this.room.mwse.WSTSProtocol.SendOnly({ - type: "room/setinfo", - roomId: this.room.roomId, - name, - value - }); - } - get(name) { - return name ? this.info[name] : this.info; - } -} - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}],"i9gBw":[function(require,module,exports,__globalThis) { -var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js"); -parcelHelpers.defineInteropFlag(exports); -class WSTSProtocol { - constructor(wsts){ - this.mwse = wsts; - this.addListener(); - } - addListener() { - this.mwse.server?.onRecaivePack((pack)=>{ - this.PackAnalyze(pack); - }); - } - SendRaw(pack) { - this.mwse.server.tranferToServer(pack); - } - SendOnly(pack) { - this.mwse.server.tranferToServer([ - pack, - 'R' - ]); - } - SendRequest(pack, id) { - this.mwse.server.tranferToServer([ - pack, - id, - 'R' - ]); - } - StartStream(pack, id) { - this.mwse.server.tranferToServer([ - pack, - id, - 'S' - ]); - } - PackAnalyze(data) { - let [payload, id, action] = data; - if (typeof id === 'number') { - let callback = this.mwse.EventPooling.events.get(id); - if (callback) { - callback[0](payload, action); - switch(action){ - case 'E': - this.mwse.EventPooling.events.delete(id); - break; - case 'S': - default: - break; - } - } else console.warn("Missing event sended from server"); - } else { - let signals = this.mwse.EventPooling.signals.get(id); - if (signals) for (const callback of signals)callback(payload); - else console.warn("Missing event sended from server"); - } - } -} -exports.default = WSTSProtocol; - -},{"@parcel/transformer-js/src/esmodule-helpers.js":"4KC4J"}]},["3FuxY"], "3FuxY", "parcelRequiref9d4", {}) - -//# sourceMappingURL=index.js.map diff --git a/script/index.js.map b/script/index.js.map deleted file mode 100644 index b42e80d..0000000 --- a/script/index.js.map +++ /dev/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,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,CAAC;YACjD,IAAG,UACH;gBACI,QAAQ,CAAC,EAAE,CAAC,SAAS;gBACrB,OAAO;oBAEH,KAAK;wBACD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC;wBACrC;oBAEJ,KAAK;oBACL;wBACI;gBAER;YACJ,OAAM,QAAQ,IAAI,CAAC;QACvB,OAAK;YACD,IAAI,UAAU,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC;YACjD,IAAG,SAEC,KAAK,MAAM,YAAY,QACnB,SAAS;iBAEX,QAAQ,IAAI,CAAC;QACvB;IACJ;AACJ;kBA5DqB","sources":["frontend/index.ts","frontend/Connection.ts","../../../../../usr/lib/node_modules/parcel/node_modules/@parcel/transformer-js/src/esmodule-helpers.js","frontend/EventPool.ts","frontend/EventTarget.ts","frontend/IPPressure.ts","frontend/Peer.ts","frontend/PeerInfo.ts","frontend/WebRTC.ts","frontend/P2PFileSender.ts","frontend/Room.ts","frontend/RoomInfo.ts","frontend/WSTSProtocol.ts"],"sourcesContent":["import {Connection,IConnection} from \"./Connection\";\nimport EventPool from \"./EventPool\";\nimport EventTarget from \"./EventTarget\";\nimport { IPPressure } from \"./IPPressure\";\nimport Peer from \"./Peer\";\nimport Room, { IRoomOptions } from \"./Room\";\nimport WSTSProtocol, { Message } from \"./WSTSProtocol\";\nimport WebRTC from \"./WebRTC\";\n//import {Gzip} from \"fflate\";\nexport default class MWSE extends EventTarget {\n public static rtc : WebRTC;\n public server! : Connection;\n public WSTSProtocol! : WSTSProtocol;\n public EventPooling! : EventPool;\n public rooms : Map = new Map();\n public pairs : Map = new Map();\n public peers : Map = new Map();\n public virtualPressure : IPPressure;\n public me! : Peer;\n /*public static compress(message:string, callback:(e:any) => any)\n {\n let u : any= [];\n let C = new Gzip({\n level: 9,\n mem: 12\n },(stream,isLast) => {\n u.push(stream);\n if(isLast)\n {\n callback(u);\n }\n });\n C.push(new TextEncoder().encode(message), true);\n }*/\n constructor(options: IConnection){\n super();\n MWSE.rtc = MWSE as unknown as WebRTC;\n this.server = new Connection(this,options);\n this.WSTSProtocol = new WSTSProtocol(this);\n this.EventPooling = new EventPool(this);\n this.virtualPressure = new IPPressure(this);\n this.server.connect();\n this.me = new Peer(this);\n this.me.scope(()=>{\n this.peers.set('me', this.me);\n this.peers.set(this.me.socketId as string, this.me);\n })\n this.server.onActive(async ()=>{\n this.me.setSocketId('me');\n await this.me.metadata();\n this.emit('scope');\n this.activeScope = true;\n });\n this.server.onPassive(async ()=>{\n this.emit('close');\n });\n this.packMessagingSystem();\n }\n\n public writable = 1;\n public readable = 1;\n\n public destroy()\n {\n this.server.disconnect();\n }\n\n public enableRecaiveData(){\n this.WSTSProtocol.SendOnly({ type: 'connection/packrecaive', value: 1 })\n this.readable = 1\n }\n public disableRecaiveData(){\n this.WSTSProtocol.SendOnly({ type: 'connection/packrecaive', value: 0 })\n this.readable = 0\n }\n\n public enableSendData(){\n this.WSTSProtocol.SendOnly({ type: 'connection/packsending', value: 1 })\n this.writable = 1\n }\n public disableSendData(){\n this.WSTSProtocol.SendOnly({ type: 'connection/packsending', value: 0 })\n this.writable = 0\n }\n\n public enableNotifyRoomInfo(){\n this.WSTSProtocol.SendOnly({ type: 'connection/roominfo', value: 1 })\n }\n public disableNotifyRoomInfo(){\n this.WSTSProtocol.SendOnly({ type: 'connection/roominfo', value: 0 })\n }\n\n public async request(peerId: string, pack:Message)\n {\n let {pack:answer} = await this.EventPooling.request({\n type: 'request/to',\n to: peerId,\n pack\n });\n return answer;\n }\n public async response(peerId: string, requestId:number, pack:Message)\n {\n this.WSTSProtocol.SendOnly({\n type: 'response/to',\n to: peerId,\n pack,\n id: requestId\n })\n }\n private packMessagingSystem()\n {\n this.EventPooling.signal('pack',(payload : {from:string,pack:any}) => {\n if(this.readable)\n {\n let {from,pack} = payload;\n this.peer(from, true).emit('pack', pack);\n }\n })\n this.EventPooling.signal('request',(payload : {from:string,pack:any,id:number}) => {\n let {from,pack, id} = payload;\n let scope = {\n body: pack,\n response: (pack: Message) => {\n this.response(from, id, pack);\n },\n peer: this.peer(from, true)\n };\n this.peer(from, true).emit('request', scope);\n this.peer('me').emit('request', scope);\n })\n this.EventPooling.signal('pack/room',(payload : {from:string,pack:any,sender:string}) => {\n if(this.readable)\n {\n let {from,pack,sender} = payload;\n this.room(from).emit('message', pack, this.peer(sender));\n }\n })\n this.EventPooling.signal('room/joined',(payload : {id:string,roomid:any,ownerid:string}) => {\n let {id,roomid} = payload;\n let room = this.room(roomid);\n let peer = this.peer(id, true);\n room.peers.set(peer.socketId as string, peer);\n room.emit('join', peer);\n })\n this.EventPooling.signal('room/info',(payload : {roomId:string,value:any,name:string}) => {\n let {roomId,name,value} = payload;\n this.room(roomId).emit('updateinfo', name,value);\n })\n this.EventPooling.signal('room/ejected',(payload : {id:string,roomid:any,ownerid:string}) => {\n let {id,roomid} = payload;\n let room = this.room(roomid);\n let peer = this.peer(id, true);\n room.peers.delete(peer.socketId as string);\n room.emit('eject', peer);\n })\n this.EventPooling.signal('room/closed',(payload : {roomid:any}) => {\n let {roomid} = payload;\n let room = this.room(roomid);\n room.peers.clear();\n room.emit('close');\n this.rooms.delete(roomid);\n })\n this.EventPooling.signal(\"pair/info\", (payload : {from : string,name: string, value: string | number | boolean}) => {\n let {from, name, value} = payload;\n let peer = this.peer(from, true);\n peer.info.info[name] = value;\n peer.emit(\"info\", name, value);\n })\n this.EventPooling.signal(\"request/pair\", (payload : {from : string,info: any}) => {\n let {from, info} = payload;\n let peer = this.peer(from, true);\n peer.info.info = info;\n peer.emit(\"request/pair\", peer);\n this.peer('me').emit('request/pair', peer);\n })\n this.EventPooling.signal(\"peer/disconnect\", (payload : {id : string}) => {\n let {id} = payload;\n let peer = this.peer(id, true);\n peer.emit(\"disconnect\", peer);\n })\n this.EventPooling.signal(\"accepted/pair\", (payload : {from : string,info: any}) => {\n let {from, info} = payload;\n let peer = this.peer(from, true);\n peer.info.info = info;\n peer.emit(\"accepted/pair\", peer);\n this.peer('me').emit('accepted/pairr', peer);\n })\n this.EventPooling.signal(\"end/pair\", (payload : {from : string,info: any}) => {\n let {from, info} = payload;\n let peer = this.peer(from, true);\n peer.emit(\"endPair\", info);\n this.peer('me').emit('endPair', from, info);\n })\n }\n public room(options: IRoomOptions | string) : Room\n {\n if(typeof options == \"string\")\n {\n if(this.rooms.has(options))\n {\n return this.rooms.get(options) as Room\n }\n }\n let room = new Room(this);\n room.setRoomOptions(options);\n this.emit('room');\n return room;\n }\n public peer(options: string | IRoomOptions, isActive = false) : Peer\n {\n if(typeof options == \"string\")\n {\n if(this.peers.has(options))\n {\n return this.peers.get(options) as Peer\n }\n if(this.pairs.has(options))\n {\n return this.pairs.get(options) as Peer\n }\n }\n let peer = new Peer(this);\n peer.setPeerOptions(options);\n peer.active = isActive;\n this.peers.set(peer.socketId as string, peer);\n this.emit('peer', peer);\n return peer;\n }\n};\n\ndeclare global {\n interface Window {\n MWSE: any;\n }\n}\n\nwindow.MWSE = MWSE;","import MWSE from \"frontend\";\n\nexport interface IConnection{\n endpoint: string;\n autoReconnect?: boolean | {\n timeout: number;\n }\n}\nexport class Connection\n{\n public ws! : WebSocket;\n public endpoint : URL;\n public autoPair : boolean = false;\n public connected : boolean = false;\n\n public autoReconnect : boolean = true;\n public autoReconnectTimeout : number = 3000;\n public autoReconnectTimer? : number;\n constructor(mwse:MWSE, options: IConnection){\n\n if(options.endpoint == \"auto\")\n {\n const RootURL : string = ( document.currentScript).src\n let scriptPath = new URL(RootURL);\n let isSecurity = scriptPath.protocol == \"https:\";\n let dumeUrl = scriptPath.pathname.split('/').slice(0,-1).join('/') + '/';\n let wsSocket = new URL(dumeUrl, scriptPath);\n wsSocket.protocol = isSecurity ? 'wss:' : 'ws:';\n this.endpoint = new URL(wsSocket.href);\n }else{\n try{\n // Testing\n this.endpoint = new URL(options.endpoint);\n }catch{\n throw new Error(\"endpoint is required\")\n }\n }\n if(typeof options.autoReconnect == \"boolean\")\n {\n this.autoReconnect = true;\n }else if(options.autoReconnect)\n {\n this.autoReconnect = true;\n this.autoReconnectTimeout = options.autoReconnect.timeout;\n }\n }\n public connect()\n {\n if(this.autoReconnectTimer)\n {\n clearTimeout(this.autoReconnectTimer)\n };\n this.ws = new WebSocket(this.endpoint.href);\n this.addWSEvents();\n }\n public disconnect()\n {\n /**\n * Eğer bilinerek elle kapatıldıysa otomatik tekrar bağlanmasının\n * önüne geçmek için autoReconnect bayrağını her zaman kapalı tutmak gerekir\n */\n this.autoReconnect = false;\n this.ws.close();\n }\n public addWSEvents()\n {\n this.ws.addEventListener(\"open\", () => this.eventOpen());\n this.ws.addEventListener(\"close\", () => this.eventClose());\n this.ws.addEventListener(\"error\", () => this.eventError());\n this.ws.addEventListener(\"message\", ({data}) => this.eventMessage(data as string | ArrayBuffer));\n }\n private eventOpen()\n {\n this.connected = true;\n for (const callback of this.activeConnectionEvent) {\n callback(void 0);\n }\n }\n private eventClose()\n {\n for (const callback of this.passiveConnectionEvent) {\n callback(void 0);\n }\n this.connected = false;\n if(this.autoReconnect)\n {\n this.autoReconnectTimer = setTimeout(() => this.connect(), this.autoReconnectTimeout) as unknown as number;\n }\n }\n private eventError()\n {\n this.connected = false;\n }\n private recaivePackEvent : ((data:any) => any)[] = [];\n public onRecaivePack(func:(data:any) => any)\n {\n this.recaivePackEvent.push(func);\n }\n private activeConnectionEvent : Function[] = [];\n public onActive(func:Function)\n {\n if(this.connected)\n {\n func()\n }else{\n this.activeConnectionEvent.push(func);\n }\n }\n private passiveConnectionEvent : Function[] = [];\n public onPassive(func:Function)\n {\n if(!this.connected)\n {\n func()\n }else{\n this.passiveConnectionEvent.push(func);\n }\n }\n private eventMessage(data: string | ArrayBuffer)\n {\n if(typeof data == \"string\")\n {\n let $data = JSON.parse(data);\n for (const callback of this.recaivePackEvent) {\n callback($data);\n }\n }\n }\n public tranferToServer(data:any)\n {\n if(this.connected)\n {\n this.ws.send(JSON.stringify(data));\n }\n }\n}","exports.interopDefault = function (a) {\n return a && a.__esModule ? a : {default: a};\n};\n\nexports.defineInteropFlag = function (a) {\n Object.defineProperty(a, '__esModule', {value: true});\n};\n\nexports.exportAll = function (source, dest) {\n Object.keys(source).forEach(function (key) {\n if (\n key === 'default' ||\n key === '__esModule' ||\n Object.prototype.hasOwnProperty.call(dest, key)\n ) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function () {\n return source[key];\n },\n });\n });\n\n return dest;\n};\n\nexports.export = function (dest, destName, get) {\n Object.defineProperty(dest, destName, {\n enumerable: true,\n get: get,\n });\n};\n","import MWSE from \"./index\";\nimport { Message } from \"./WSTSProtocol\";\n\nexport default class EventPool\n{\n public wsts : MWSE;\n public events : Map = new Map();\n public signals : Map = new Map();\n\n public requests : Map = new Map();\n\n public count = 0;\n constructor(wsts:MWSE){\n this.wsts = wsts;\n }\n public request(msg: Message) : Promise\n {\n return new Promise((ok,rej) => {\n let id = ++this.count;\n this.events.set(id,[\n (data:any) => {\n ok(data);\n },\n (data:any) => {\n rej(data);\n }\n ]);\n this.wsts.WSTSProtocol.SendRequest(msg, id);\n })\n }\n public stream(msg: Message, callback: Function)\n {\n let id = ++this.count;\n this.wsts.WSTSProtocol.StartStream(msg, id);\n this.events.set(id,[\n (data:any) => {\n callback(data);\n },\n () => { }\n ]);\n }\n public signal(event: string, callback: Function)\n {\n let T = this.signals.get(event);\n if(!T)\n {\n this.signals.set(event, [callback]);\n }else{\n T.push(callback);\n }\n }\n}","export default class EventTarget\n{\n private events : {[key:string]:Function[]} = {};\n public emit(eventName :string, ...args:any[])\n {\n if(this.events[eventName])\n {\n for (const callback of this.events[eventName]) {\n callback(...args);\n }\n }\n }\n public on(eventName :string, callback:Function)\n {\n if(this.events[eventName])\n {\n this.events[eventName].push(callback)\n }else{\n this.events[eventName] = [callback];\n }\n }\n public activeScope : boolean = false;\n scope(f:Function)\n {\n if(this.activeScope)\n {\n f()\n }else{\n this.on('scope', f)\n }\n }\n}","import MWSE from \"frontend\";\n\nexport class IPPressure\n{\n public mwse : MWSE;\n public APNumber? : number;\n public APShortCode? : string;\n public APIPAddress? : string;\n constructor(mwse : MWSE){\n this.mwse = mwse;\n };\n public async allocAPIPAddress()\n {\n let {status,ip} = await this.mwse.EventPooling.request({\n type: 'alloc/APIPAddress'\n }) as {\n status:\"fail\"|\"success\",\n ip?:string\n };\n if(status == 'success')\n {\n this.APIPAddress = ip;\n return ip;\n }else{\n throw new Error(\"Error Allocated Access Point IP Address\");\n }\n }\n public async allocAPNumber()\n {\n let {status,number} = await this.mwse.EventPooling.request({\n type: 'alloc/APNumber'\n }) as {\n status:\"fail\"|\"success\",\n number?:number\n };\n if(status == 'success')\n {\n this.APNumber = number;\n return number;\n }else{\n throw new Error(\"Error Allocated Access Point Number\");\n }\n }\n public async allocAPShortCode()\n {\n let {status,code} = await this.mwse.EventPooling.request({\n type: 'alloc/APShortCode'\n }) as {\n status:\"fail\"|\"success\",\n code?:string\n };\n if(status == 'success')\n {\n this.APShortCode = code;\n return code;\n }else{\n throw new Error(\"Error Allocated Access Point Short Code\");\n }\n }\n public async reallocAPIPAddress()\n {\n let {status,ip} = await this.mwse.EventPooling.request({\n type: 'realloc/APIPAddress'\n }) as {\n status:\"fail\"|\"success\",\n ip?:string\n };\n if(status == 'success')\n {\n this.APIPAddress = ip;\n return ip;\n }else{\n throw new Error(\"Error Reallocated Access Point IP Address\");\n }\n }\n public async reallocAPNumber()\n {\n let {status,number} = await this.mwse.EventPooling.request({\n type: 'realloc/APNumber'\n }) as {\n status:\"fail\"|\"success\",\n number?:number\n };\n if(status == 'success')\n {\n this.APNumber = number;\n return number;\n }else{\n throw new Error(\"Error Reallocated Access Point Number\");\n }\n }\n public async reallocAPShortCode()\n {\n let {status,code} = await this.mwse.EventPooling.request({\n type: 'realloc/APShortCode'\n }) as {\n status:\"fail\"|\"success\",\n code?:string\n };\n if(status == 'success')\n {\n this.APShortCode = code;\n return code;\n }else{\n throw new Error(\"Error Reallocated Access Point Short Code\");\n }\n }\n public async releaseAPIPAddress()\n {\n let {status} = await this.mwse.EventPooling.request({\n type: 'release/APIPAddress'\n }) as {\n status:\"fail\"|\"success\",\n };\n if(status == 'success')\n {\n this.APIPAddress = undefined;\n }else{\n throw new Error(\"Error release Access Point IP Address\");\n }\n }\n public async releaseAPNumber()\n {\n let {status} = await this.mwse.EventPooling.request({\n type: 'release/APNumber'\n }) as {\n status:\"fail\"|\"success\",\n };\n if(status == 'success')\n {\n this.APNumber = undefined;\n }else{\n throw new Error(\"Error release Access Point Number\");\n }\n }\n public async releaseAPShortCode()\n {\n let {status} = await this.mwse.EventPooling.request({\n type: 'release/APShortCode'\n }) as {\n status:string\n };\n if(status == 'success')\n {\n this.APShortCode = undefined;\n }else{\n throw new Error(\"Error release Access Point Short Code\");\n }\n }\n public async queryAPIPAddress(ip:string)\n {\n let {status,socket} = await this.mwse.EventPooling.request({\n type: 'whois/APIPAddress',\n whois: ip\n }) as {\n status:\"fail\"|\"success\",\n socket?:string\n };\n if(status == \"success\")\n {\n return socket;\n }else{\n return null;\n }\n }\n public async queryAPNumber(number:number)\n {\n let {status,socket} = await this.mwse.EventPooling.request({\n type: 'whois/APNumber',\n whois: number\n }) as {\n status:\"fail\"|\"success\",\n socket?:string\n };\n if(status == \"success\")\n {\n return socket;\n }else{\n return null;\n }\n }\n public async queryAPShortCode(code:string)\n {\n let {status,socket} = await this.mwse.EventPooling.request({\n type: 'whois/APShortCode',\n whois: code\n }) as {\n status:\"fail\"|\"success\",\n socket?:string\n };\n if(status == \"success\")\n {\n return socket;\n }else{\n return null;\n }\n }\n}","import EventTarget from \"./EventTarget\";\nimport { PeerInfo } from \"./PeerInfo\";\nimport WebRTC from \"./WebRTC\";\nimport MWSE from \"./index\";\n\ninterface IPeerOptions{\n\n};\n\nenum IMessageSymbase\n{\n PayloadMessagePack = -12873.54,\n PayloadRTCBasePack = -12884.54\n}\n\n\nexport default class Peer extends EventTarget\n{\n public mwse : MWSE;\n public options : IPeerOptions = {};\n public socketId? : string;\n public selfSocket : boolean = false;\n public active : boolean = false;\n public info : PeerInfo;\n public rtc : WebRTC;\n public peerConnection : boolean = false;\n public primaryChannel : \"websocket\" | \"datachannel\" = \"datachannel\";\n constructor(wsts:MWSE){\n super();\n this.mwse = wsts;\n this.rtc = this.createRTC();\n this.info = new PeerInfo(this);\n this.on('pack',(data:{type?:string,action?:IMessageSymbase,payload?:any}) => {\n if(data.type == ':rtcpack:')\n {\n return this.rtc.emit(\"input\", data.payload)\n };\n this.emit(\"message\", data);\n });\n }\n public createRTC(rtcConfig?: RTCConfiguration | undefined, rtcServers?: RTCIceServer[] | undefined) : WebRTC\n {\n this.rtc = new WebRTC(rtcConfig,rtcServers);\n this.rtc.peer = this;\n this.rtc.on(\"connected\", () => {\n this.peerConnection = true;\n });\n this.rtc.on('disconnected', () => {\n this.peerConnection = false;\n })\n this.rtc.on(\"output\",(payload:object) => {\n this.send({\n type: ':rtcpack:',\n payload: payload\n })\n });\n this.rtc.on(\"message\",(payload:object) => {\n this.emit(\"pack\",payload);\n });\n return this.rtc;\n }\n public setPeerOptions(options: string | IPeerOptions){\n if(typeof options == \"string\")\n {\n this.setSocketId(options)\n }else{\n this.options = options;\n }\n }\n public setSocketId(uuid: string){\n this.socketId = uuid;\n }\n async metadata() : Promise\n {\n if(this.socketId == 'me')\n {\n let result = await this.mwse.EventPooling.request({\n type:'my/socketid'\n });\n this.selfSocket = true;\n this.active ||= true;\n this.socketId = result;\n this.emit('scope');\n this.activeScope = true;\n return result;\n }\n };\n \n async request(pack:any){\n if(this.active)\n {\n return await this.mwse.request(this.socketId as string, pack);\n }\n };\n equalTo(peer : Peer | {socketId: string})\n {\n return this.socketId == peer.socketId;\n }\n async isReachable()\n {\n return await this.mwse.EventPooling.request({\n type:'is/reachable',\n to: this.socketId\n });\n }\n async enablePairAuth(){\n await this.mwse.EventPooling.request({\n type:'auth/pair-system',\n value: 'everybody'\n });\n }\n async disablePairAuth(){\n await this.mwse.EventPooling.request({\n type:'auth/pair-system',\n value: 'disable'\n });\n }\n async enablePairInfo(){\n await this.mwse.EventPooling.request({\n type: 'connection/pairinfo',\n value: true\n });\n }\n async disablePairInfo(){\n await this.mwse.EventPooling.request({\n type: 'connection/pairinfo',\n value: false\n });\n }\n async requestPair()\n {\n let {message,status} = await this.mwse.EventPooling.request({\n type:'request/pair',\n to: this.socketId\n });\n if(\n message == \"ALREADY-PAIRED\" ||\n message == \"ALREADY-REQUESTED\"\n )\n {\n console.warn(\"Already paired or pair requested\")\n };\n if(status == \"fail\")\n {\n console.error(\"Request Pair Error\",status, message);\n return false;\n }\n return true;\n }\n async endPair()\n {\n await this.mwse.EventPooling.request({\n type:'end/pair',\n to: this.socketId\n });\n this.forget();\n }\n async acceptPair()\n {\n let {message,status} = await this.mwse.EventPooling.request({\n type:'accept/pair',\n to: this.socketId\n });\n if(status == \"fail\")\n {\n console.error(\"Pair Error\",status, message);\n return false;\n }\n return true;\n }\n async rejectPair()\n {\n let {message,status} = await this.mwse.EventPooling.request({\n type:'reject/pair',\n to: this.socketId\n });\n if(status == \"fail\")\n {\n console.error(\"Pair Error\",status, message);\n return false;\n }\n return true;\n }\n async getPairedList() : Promise\n {\n let {value} = await this.mwse.EventPooling.request({\n type:'pair/list',\n to: this.socketId\n });\n return value;\n }\n async send(pack: any){\n let isOpenedP2P = this.peerConnection && this.rtc?.active;\n let isOpenedServer = this.mwse.server.connected;\n let sendChannel : \"websocket\" | \"datachannel\";\n if(isOpenedP2P && isOpenedServer)\n {\n if(this.primaryChannel == \"websocket\")\n {\n sendChannel = \"websocket\"\n }else\n {\n sendChannel = \"datachannel\"\n }\n }else if(isOpenedServer){\n sendChannel = \"websocket\"\n }else{\n sendChannel = \"datachannel\"\n }\n\n if(sendChannel == \"websocket\")\n {\n if(!this.mwse.writable){\n return console.warn(\"Socket is not writable\");\n }\n await this.mwse.EventPooling.request({\n type:'pack/to',\n pack,\n to: this.socketId\n });\n }else{\n if(pack.type != ':rtcpack:')\n {\n this.rtc?.sendMessage(pack)\n }else{\n return console.warn(\"Socket is not writable\");\n }\n }\n }\n async forget(){\n this.mwse.peers.delete(this.socketId as string);\n this.mwse.pairs.delete(this.socketId as string);\n }\n} ","import Peer from \"./Peer\";\n\nexport class PeerInfo\n{\n public peer : Peer;\n public info : {[key:string]: any} = {};\n constructor(mwse : Peer){\n this.peer = mwse;\n };\n public async fetch(name?:string)\n {\n if(name)\n {\n let rinfo = await this.peer.mwse.EventPooling.request(({\n type: \"peer/info\",\n peer: this.peer.socketId,\n name\n }));\n if(rinfo.status == \"success\")\n {\n this.info = rinfo.info;\n }else console.warn(rinfo.message);\n }else{\n let rinfo = await this.peer.mwse.EventPooling.request(({\n type: \"peer/info\",\n peer: this.peer.socketId\n }));\n if(rinfo.status == \"success\")\n {\n this.info = rinfo.info;\n }else console.warn(rinfo.message);\n };\n return this.info;\n }\n public set(name: string, value: string | number)\n {\n this.info[name] = value;\n this.peer.mwse.WSTSProtocol.SendOnly({\n type: \"auth/info\",\n name,\n value\n });\n }\n public get(name?:string)\n {\n return name ? this.info[name] : this.info;\n }\n}","import P2PFileSender from \"./P2PFileSender\";\nimport Peer from \"./Peer\";\ninterface TransferStreamInfo\n{\n senders : RTCRtpSender[];\n recaivers : RTCRtpReceiver[];\n stream:MediaStream | undefined;\n id:string;\n name:string;\n}\n\nexport default class WebRTC\n{\n public static channels : Map = new Map();\n public static requireGC : boolean = false;\n public id : any;\n public active : boolean = false;\n public connectionStatus : \"closed\" | \"connected\" | \"connecting\" | \"disconnected\" | \"failed\" | \"new\" = \"new\";\n public iceStatus : \"checking\" | \"closed\" | \"completed\" | \"connected\" | \"disconnected\" | \"failed\" | \"new\" = \"new\";\n public gatheringStatus : \"complete\" | \"gathering\" | \"new\" = \"new\";\n public signalingStatus : \"\" | \"closed\" | \"have-local-offer\" | \"have-local-pranswer\" | \"have-remote-offer\" | \"have-remote-pranswer\" | \"stable\" = \"\"\n public rtc! : RTCPeerConnection;\n public recaivingStream : Map = new Map();\n public sendingStream : Map = new Map();\n public events : { [eventname:string]: Function[] } = {};\n public channel : RTCDataChannel | undefined;\n\n public static defaultRTCConfig : RTCConfiguration = {\n iceCandidatePoolSize: 0,\n iceTransportPolicy:\"all\",\n rtcpMuxPolicy:\"require\",\n };\n\n private isPolite() : boolean\n {\n let myId = this.peer?.mwse.peer('me').socketId as string;\n let peerId = this.peer?.socketId as string;\n return myId < peerId;\n }\n\n public static defaultICEServers : RTCIceServer[] = [{\n urls: \"stun:stun.l.google.com:19302\"\n },{\n urls: \"stun:stun1.l.google.com:19302\"\n },{\n urls: \"stun:stun2.l.google.com:19302\"\n },{\n urls: \"stun:stun3.l.google.com:19302\"\n },{\n urls: \"stun:stun4.l.google.com:19302\"\n }];\n\n public peer? : Peer;\n\n public FileTransportChannel? : P2PFileSender;\n\n public makingOffer = false;\n public ignoreOffer = false;\n public isSettingRemoteAnswerPending = false;\n\n candicatePack : RTCIceCandidate[] = [];\n\n\n constructor(\n rtcConfig?: RTCConfiguration,\n rtcServers?: RTCIceServer[]\n )\n {\n let config : any = {};\n\n if(rtcConfig)\n {\n Object.assign(\n config,\n WebRTC.defaultRTCConfig,\n rtcConfig\n )\n }else{\n Object.assign(\n config,\n WebRTC.defaultRTCConfig\n )\n }\n\n config.iceServers = rtcServers || WebRTC.defaultICEServers;\n\n this.rtc = new RTCPeerConnection(config as RTCConfiguration);\n this.rtc.addEventListener(\"connectionstatechange\",()=>{\n this.eventConnectionState();\n })\n this.rtc.addEventListener(\"icecandidate\",(...args)=>{\n this.eventIcecandidate(...args);\n })\n this.rtc.addEventListener(\"iceconnectionstatechange\",()=>{\n this.eventICEConnectionState();\n })\n this.rtc.addEventListener(\"icegatheringstatechange\",()=>{\n this.eventICEGatherinState();\n })\n this.rtc.addEventListener(\"negotiationneeded\",()=>{\n this.eventNogationNeeded();\n })\n this.rtc.addEventListener(\"signalingstatechange\",()=>{\n this.eventSignalingState();\n })\n this.rtc.addEventListener(\"track\",(...args)=>{\n this.eventTrack(...args);\n })\n this.rtc.addEventListener(\"datachannel\",(...args)=>{\n this.eventDatachannel(...args);\n })\n this.on('input',async (data:{[key:string]:any})=>{\n switch(data.type)\n {\n case \"icecandidate\":{\n try{\n if(this.rtc.remoteDescription){\n await this.rtc.addIceCandidate(new RTCIceCandidate(data.value));\n }else{\n this.candicatePack.push(new RTCIceCandidate(data.value))\n }\n }catch(error){\n debugger;\n }finally{\n console.log(\"ICE Canbet\")\n }\n break;\n }\n case \"offer\":{\n let readyForOffer = !this.makingOffer && (this.rtc.signalingState == \"stable\" || this.isSettingRemoteAnswerPending);\n\n const offerCollision = !readyForOffer;\n\n this.ignoreOffer = !this.isPolite() && offerCollision;\n\n if(this.ignoreOffer){\n return;\n }\n\n this.isSettingRemoteAnswerPending = false;\n\n await this.rtc.setRemoteDescription(new RTCSessionDescription(data.value));\n\n this.isSettingRemoteAnswerPending = false;\n\n for (const candidate of this.candicatePack) {\n await this.rtc.addIceCandidate(candidate);\n }\n\n let answer = await this.rtc.createAnswer({\n offerToReceiveAudio: true,\n offerToReceiveVideo: true\n })\n await this.rtc.setLocalDescription(answer);\n this.send({\n type: 'answer',\n value: answer\n });\n break;\n }\n case \"answer\":{\n await this.rtc.setRemoteDescription(new RTCSessionDescription(data.value))\n\n for (const candidate of this.candicatePack) {\n await this.rtc.addIceCandidate(candidate);\n }\n break;\n }\n case \"streamInfo\":{\n let {id,value} = data;\n let streamInfo = this.recaivingStream.get(id);\n if(!streamInfo)\n {\n this.recaivingStream.set(id,value as TransferStreamInfo);\n }else{\n this.recaivingStream.set(id,{\n ...streamInfo,\n ...value\n } as TransferStreamInfo);\n }\n this.send({\n type:'streamAccept',\n id\n })\n break;\n }\n case \"streamRemoved\":{\n let {id} = data;\n this.emit('stream:stopped', this.recaivingStream.get(id));\n this.recaivingStream.delete(id);\n break;\n }\n case \"streamAccept\":{\n let {id} = data;\n let sendingStream = this.sendingStream.get(id) as TransferStreamInfo;\n let senders = [];\n if(sendingStream && sendingStream.stream)\n {\n for (const track of sendingStream.stream.getTracks()) {\n senders.push(this.rtc.addTrack(track, sendingStream.stream));\n };\n sendingStream.senders = senders;\n }\n this.emit('stream:accepted', sendingStream);\n break;\n }\n case \"message\":{\n this.emit('message', data.payload);\n break;\n }\n }\n })\n }\n public addEventListener(event:string,callback: Function){\n (this.events[event] || (this.events[event]=[])).push(callback);\n };\n public on(event:string,callback: Function){\n this.addEventListener(event, callback)\n };\n public async dispatch(event:string,...args:any[]) : Promise {\n if(this.events[event])\n {\n for (const callback of this.events[event])\n {\n await callback(...args)\n }\n }\n }\n public async emit(event:string,...args:any[]) : Promise {\n await this.dispatch(event, ...args)\n }\n public connect()\n {\n if(!this.channel)\n {\n this.createDefaultDataChannel();\n }\n }\n public sendMessage(data: any)\n {\n if(data.type == ':rtcpack:')\n {\n throw \"WebRTC Kanalında Sızma\";\n }\n this.send({\n type: 'message',\n payload: data\n });\n }\n public createDefaultDataChannel()\n {\n let dt = this.rtc.createDataChannel(':default:',{\n ordered: true\n });\n dt.addEventListener(\"open\",()=>{\n this.channel = dt;\n WebRTC.channels.set(this.id, this);\n this.active = true;\n });\n dt.addEventListener(\"message\",({data})=>{\n let pack = JSON.parse(data);\n this.emit('input', pack);\n })\n dt.addEventListener(\"close\",()=>{\n this.channel = undefined;\n this.active = false;\n })\n }\n public destroy()\n {\n this.active = false;\n if(this.channel)\n {\n this.channel.close();\n this.channel = undefined;\n }\n if(this.rtc)\n {\n this.rtc.close();\n //this.rtc = undefined;\n };\n this.emit('disconnected');\n WebRTC.channels.delete(this.id);\n }\n public eventDatachannel(event: RTCDataChannelEvent)\n {\n if(event.channel.label == ':default:'){\n WebRTC.channels.set(this.id, this);\n this.channel = event.channel;\n this.active = true;\n event.channel.addEventListener(\"message\",({data})=>{\n let pack = JSON.parse(data);\n this.emit('input', pack);\n })\n event.channel.addEventListener(\"close\",()=>{\n this.channel = undefined;\n WebRTC.channels.delete(this.id);\n WebRTC.requireGC = true;\n this.active = false;\n })\n }else{\n this.emit('datachannel', event.channel);\n }\n }\n public send(data:object)\n {\n if(this.channel?.readyState == \"open\")\n {\n this.channel.send(JSON.stringify(data));\n }else{\n this.emit('output', data);\n }\n }\n public eventConnectionState()\n {\n this.connectionStatus = this.rtc.connectionState;\n if(this.connectionStatus == 'connected')\n {\n if(this.active == false)\n {\n this.emit('connected');\n }\n };\n\n if(this.connectionStatus == 'failed')\n {\n this.rtc.restartIce();\n };\n \n if(this.connectionStatus == \"closed\")\n {\n if(this.active)\n {\n this.destroy();\n }\n }\n }\n public eventIcecandidate(event: RTCPeerConnectionIceEvent)\n {\n if(event.candidate)\n {\n this.send({\n type:'icecandidate',\n value: event.candidate\n })\n }\n }\n public eventICEConnectionState()\n {\n this.iceStatus = this.rtc.iceConnectionState;\n }\n public eventICEGatherinState()\n {\n this.gatheringStatus = this.rtc.iceGatheringState;\n }\n public async eventNogationNeeded()\n {\n try{\n this.makingOffer = true;\n let offer = await this.rtc.createOffer({\n iceRestart: true,\n offerToReceiveAudio: true,\n offerToReceiveVideo: true\n });\n await this.rtc.setLocalDescription(offer);\n this.send({\n type: 'offer',\n value: offer\n });\n }catch(error){\n console.error(`Nogation Error:`, error)\n }\n finally{\n this.makingOffer = false;\n }\n }\n public eventSignalingState()\n {\n this.signalingStatus = this.rtc.signalingState;\n }\n public eventTrack(event: RTCTrackEvent)\n {\n let rtpRecaiver = event.receiver;\n if(event.streams.length)\n {\n for (const stream of event.streams) {\n let streamInfo = this.recaivingStream.get(stream.id) as TransferStreamInfo;\n (streamInfo.recaivers || (streamInfo.recaivers = [])).push(rtpRecaiver);\n if((this.recaivingStream.get(stream.id) as {stream : MediaStream | undefined}).stream == null)\n {\n streamInfo.stream = stream;\n this.emit('stream:added', this.recaivingStream.get(stream.id));\n }else{\n streamInfo.stream = stream;\n }\n }\n }\n }\n public sendStream(stream:MediaStream,name:string,info:{[key:string]:any}){\n this.send({\n type: 'streamInfo',\n id: stream.id,\n value: {\n ...info,\n name: name\n }\n });\n this.sendingStream.set(stream.id,{\n ...info,\n id:stream.id,\n name: name,\n stream\n } as TransferStreamInfo);\n };\n public stopStream(_stream:MediaStream){\n if(this.connectionStatus != 'connected'){\n return\n }\n if(this.sendingStream.has(_stream.id))\n {\n let {stream} = this.sendingStream.get(_stream.id) as {stream:MediaStream};\n \n for (const track of stream.getTracks()) {\n for (const RTCPSender of this.rtc.getSenders()) {\n if(RTCPSender.track?.id == track.id)\n {\n this.rtc.removeTrack(RTCPSender);\n }\n }\n }\n \n this.send({\n type: 'streamRemoved',\n id: stream.id\n });\n this.sendingStream.delete(_stream.id)\n }\n }\n public stopAllStreams()\n {\n if(this.connectionStatus != 'connected'){\n return\n }\n for (const [, {stream}] of this.sendingStream) {\n if(stream == undefined)\n {\n continue;\n }\n for (const track of stream.getTracks()) {\n for (const RTCPSender of this.rtc.getSenders()) {\n if(RTCPSender.track?.id == track.id)\n {\n this.rtc.removeTrack(RTCPSender);\n }\n }\n }\n this.send({\n type: 'streamRemoved',\n id: stream.id\n });\n };\n \n this.sendingStream.clear();\n }\n public async SendFile(file:File, meta: object)\n {\n if(!this.peer)\n {\n throw new Error(\"Peer is not ready\");\n }\n this.FileTransportChannel = new P2PFileSender(this, this.peer);\n\n await this.FileTransportChannel.SendFile(file, meta);\n }\n public async RecaiveFile(\n chnlCount:number,\n filemeta: {\n name: string;\n type: string;\n },\n totalSize: number\n ) : Promise\n {\n if(!this.peer)\n {\n throw new Error(\"Peer is not ready\");\n }\n this.FileTransportChannel = new P2PFileSender(this, this.peer);\n\n return await new Promise(recaivedFile => {\n if(this.FileTransportChannel)\n {\n this.FileTransportChannel.RecaiveFile(\n this.rtc,\n filemeta,\n chnlCount,\n totalSize,\n (file: File) => {\n recaivedFile(file)\n }\n );\n }\n })\n }\n}\n\nWebRTC.requireGC = false;\nsetInterval(()=>{\n if(WebRTC.requireGC == false) return;\n let img = document.createElement(\"img\");\n img.src = window.URL.createObjectURL(new Blob([new ArrayBuffer(5e+7)]));\n img.onerror = function() {\n window.URL.revokeObjectURL(this.src);\n };\n WebRTC.requireGC = false;\n}, 3000);\n\ndeclare global {\n interface MediaStream {\n senders : RTCRtpSender[];\n }\n}","import WebRTC from \"./WebRTC\";\nimport Peer from \"./Peer\";\n\n/**\n * Deneyseldir kullanılması önerilmez\n */\nexport default class P2PFileSender\n{\n public rtc : RTCPeerConnection;\n public peer : Peer;\n public webrtc : WebRTC;\n\n public totalSize : number = 0;\n public isReady : boolean = false;\n public isStarted : boolean = false;\n public isSending : boolean = false;\n public isRecaiving : boolean = false;\n public processedSize : number = 0;\n public recaivedFile? : File;\n\n public bufferSizePerChannel : number = 10e6;\n public bufferSizePerPack : number = 10e3;\n public safeBufferSizePerPack : number = 10e3 - 1;\n\n public constructor(webrtc : WebRTC, peer : Peer)\n {\n this.webrtc = webrtc;\n this.rtc = webrtc.rtc;\n this.peer = peer;\n }\n public async RecaiveFile(\n _rtc: RTCPeerConnection,\n fileMetadata: {name:string, type:string},\n channelCount: number,\n _totalSize: number,\n onEnded: Function\n )\n {\n //let totals = {};\n // let index = 0;\n /*setChannelStatus(Array.from({length:channelCount}).map((e, index) => {\n return {\n name: `${index+1}. Kanal`,\n current: 0,\n currentTotal: 0,\n total: 0\n }\n }));*/\n let parts : Blob[] = [];\n this.webrtc.on('datachannel',(datachannel:RTCDataChannel) => {\n //let channelIndex = index++;\n let current = 0;\n let totalSize = 0;\n let currentPart = 0;\n let bufferAmount : ArrayBuffer[] = [];\n datachannel.onmessage = function({data}){\n if(totalSize == 0)\n {\n let {\n size,\n part,\n } = JSON.parse(data);\n totalSize = size;\n currentPart = part;\n /*updateChannelStatus(channelIndex, n => {\n return {\n ...n,\n total: totalSize,\n current: 0\n }\n });*/\n datachannel.send(\"READY\");\n }else{\n current += data.byteLength;\n bufferAmount.push(data);\n /*updateChannelStatus(channelIndex, n => {\n return {\n ...n,\n current: data.byteLength + n.current,\n currentTotal: data.byteLength + n.currentTotal,\n }\n });\n setProcessedSize(n => n + data.byteLength);*/\n if(current == totalSize)\n {\n parts[currentPart] = new Blob(bufferAmount);\n bufferAmount = []; \n //totals[datachannel.label] += totalSize;\n totalSize = 0;\n currentPart = 0;\n current = 0;\n datachannel.send(\"TOTAL_RECAIVED\");\n }\n }\n };\n datachannel.onclose = () => {\n channelCount--;\n if(channelCount == 0)\n {\n let file = new File(parts, fileMetadata.name, {\n type: fileMetadata.type,\n lastModified: +new Date\n });\n onEnded(file);\n }\n };\n })\n }\n public async SendFile(\n file: File,\n metadata: object\n )\n {\n this.isSending = true;\n this.isStarted = true;\n\n\n let buffer = await file.arrayBuffer();\n let partCount = Math.ceil(buffer.byteLength / 10e6);\n let channelCount = Math.min(5, partCount);\n\n if(this.webrtc.iceStatus != \"connected\")\n {\n throw new Error(\"WebRTC is a not ready\")\n }\n\n this.peer.send({\n type: 'file',\n name: file.name,\n size: file.size,\n mimetype: file.type,\n partCount,\n channelCount,\n metadata: metadata\n });\n\n let channels : RTCDataChannel[] = [];\n\n for(let channelIndex = 0; channelIndex < channelCount; channelIndex++)\n {\n let channel = this.rtc.createDataChannel(\"\\\\?\\\\file_\" + channelIndex);\n channel.binaryType = \"arraybuffer\";\n await new Promise(ok => {\n channel.onopen = () => {\n ok(void 0);\n }\n });\n channels.push(channel);\n };\n\n let currentPart = 0;\n let next = () => {\n if(currentPart < partCount)\n {\n let bufferPart = buffer.slice(currentPart * 10e6, currentPart * 10e6 + 10e6)\n currentPart++;\n return [bufferPart, currentPart - 1];\n };\n return [false,0];\n };\n let spyChannelIndex = channels.length;\n await new Promise(ok => {\n for (let channelIndex = 0; channelIndex < channels.length; channelIndex++)\n {\n this.sendPartition(\n channels[channelIndex],\n next,\n channelIndex,\n () => {\n spyChannelIndex--;\n if(spyChannelIndex == 0)\n {\n this.isSending = false;\n this.isStarted = false;\n ok(undefined)\n }\n }\n );\n }\n })\n }\n protected sendPartition(\n channel: RTCDataChannel,\n nextblob10mb: () => (number | ArrayBuffer)[] | (number | boolean)[],\n _channelIndex: number,\n onEnded: Function\n )\n {\n let [currentBuffer,currentPartition] = nextblob10mb();\n let currentPart = 0;\n let next = () => {\n if(!(currentBuffer instanceof ArrayBuffer))\n {\n return;\n }\n let bufferPart = currentBuffer.slice(currentPart * 16e3, currentPart * 16e3 + 16e3)\n currentPart++;\n if(bufferPart.byteLength != 0)\n {\n /*\n updateChannelStatus(channelIndex, n => {\n return {\n ...n,\n current: bufferPart.byteLength + n.current,\n currentTotal: bufferPart.byteLength + n.currentTotal\n }\n });\n setProcessedSize(n => n + bufferPart.byteLength);\n */\n return bufferPart\n }\n };\n channel.addEventListener(\"message\",({data}) => {\n if(data == \"READY\")\n {\n this.sendFileChannel(channel, next)\n }\n if(data == \"TOTAL_RECAIVED\")\n {\n [currentBuffer,currentPartition] = nextblob10mb();\n currentPart = 0;\n if(currentBuffer != false)\n {\n /*updateChannelStatus(channelIndex, n => {\n return {\n ...n,\n total: currentBuffer.byteLength,\n current: 0,\n }\n });*/\n channel.send(JSON.stringify({\n size: (currentBuffer as ArrayBuffer).byteLength,\n part: currentPartition\n }))\n }else{\n channel.close();\n onEnded();\n }\n }\n });\n channel.send(JSON.stringify({\n size: (currentBuffer as ArrayBuffer).byteLength,\n part: currentPartition\n }))\n }\n protected sendFileChannel(\n channel: RTCDataChannel,\n getNextBlob: () => ArrayBuffer | undefined\n )\n {\n channel.addEventListener(\"bufferedamountlow\",function(){\n let buffer = getNextBlob();\n if(buffer)\n {\n channel.send(buffer);\n }\n });\n channel.bufferedAmountLowThreshold = 16e3 - 1;\n let c = getNextBlob();\n c && channel.send(c);\n }\n};","import EventTarget from \"./EventTarget\";\nimport MWSE from \"./index\";\nimport Peer from \"./Peer\";\nimport { RoomInfo } from \"./RoomInfo\";\n\nexport interface IRoomOptions\n{\n name: string;\n description?:string;\n joinType: \"free\"|\"invite\"|\"password\"|\"lock\";\n credential?: string;\n ifexistsJoin?: boolean;\n accessType?: \"public\"|\"private\";\n notifyActionInvite?: boolean;\n notifyActionJoined?: boolean;\n notifyActionEjected?: boolean;\n autoFetchInfo?:boolean\n}\n\n\nexport default class Room extends EventTarget\n{\n public mwse : MWSE;\n public options! : IRoomOptions;\n public config! : IRoomOptions;\n public roomId? : string;\n public accessType? : \"public\"|\"private\";\n public description? : string;\n public joinType? : \"free\"|\"invite\"|\"password\"|\"lock\";\n public name? : string;\n public owner? : string;\n public peers : Map = new Map();\n public info : RoomInfo;\n\n constructor(wsts:MWSE){\n super();\n this.mwse = wsts;\n this.info = new RoomInfo(this);\n }\n public setRoomOptions(options : IRoomOptions | string)\n {\n if(typeof options == \"string\")\n {\n this.roomId = options;\n }else{\n let defaultOptions = {\n joinType: \"free\",\n ifexistsJoin: true,\n accessType: \"private\",\n notifyActionInvite: true,\n notifyActionJoined: true,\n notifyActionEjected: true,\n autoFetchInfo: true\n };\n Object.assign(defaultOptions,options);\n this.config = defaultOptions as IRoomOptions;\n }\n }\n \n setRoomId(uuid: string){\n this.roomId = uuid;\n }\n async createRoom(roomOptions : IRoomOptions){\n let config = this.config || roomOptions;\n let result = await this.mwse.EventPooling.request({\n type:'create-room',\n ...config\n });\n if(result.status == 'fail')\n {\n if(result.message == \"ALREADY-EXISTS\" && this.config.ifexistsJoin)\n {\n return this.join();\n }\n throw new Error(result.message || result.messages);\n }else{\n this.options = {\n ...this.config,\n ...result.room\n };\n this.roomId = result.room.id;\n this.mwse.rooms.set(this.roomId as string, this);\n }\n }\n async join(){\n let result = await this.mwse.EventPooling.request({\n type:'joinroom',\n name: this.config.name,\n credential: this.config.credential,\n autoFetchInfo: this.config.autoFetchInfo || false\n });\n if(result.status == 'fail')\n {\n throw new Error(result.message);\n }else{\n this.options = {\n ...this.config,\n ...result.room\n };\n if(result.info)\n {\n this.info.info = result.info;\n };\n this.roomId = result.room.id;\n this.mwse.rooms.set(this.roomId as string, this);\n }\n }\n async eject(){\n let {type} = await this.mwse.EventPooling.request({\n type:'ejectroom',\n roomId: this.roomId\n });\n this.peers.clear();\n if(type == 'success')\n {\n this.mwse.rooms.delete(this.roomId as string);\n }\n }\n async send(pack: any, wom:boolean = false, handshake = false){\n if(!this.mwse.writable){\n return console.warn(\"Socket is not writable\");\n }\n if(handshake)\n {\n let {type} = await this.mwse.EventPooling.request({\n type:'pack/room',\n pack,\n to: this.roomId,\n wom,\n handshake\n }) as {\n type:\"success\"|\"fail\"\n };\n if(type == \"fail\"){\n throw new Error(\"Cant send message to room\")\n }\n }else{\n await this.mwse.EventPooling.request({\n type:'pack/room',\n pack,\n to: this.roomId,\n wom,\n handshake\n })\n }\n }\n async fetchPeers(filter?:{[key:string]:any}, onlyNumber:boolean = false) : Promise\n {\n if(onlyNumber)\n {\n let {count} = await this.mwse.EventPooling.request({\n type:'room/peer-count',\n roomId: this.roomId,\n filter: filter || {}\n }) as {count:Number};\n return count;\n }else{\n let {status, peers} = await this.mwse.EventPooling.request({\n type:'room-peers',\n roomId: this.roomId,\n filter: filter || {}\n }) as {status:\"success\"|\"fail\", peers: string[]};\n \n let cup : Peer[] = [];\n \n if(status == 'fail')\n {\n throw new Error(\"Cant using peers on room\")\n }else if(status == 'success'){\n for (const peerid of peers) {\n let peer = this.mwse.peer(peerid,true);\n cup.push(peer);\n this.peers.set(peerid, peer);\n }\n };\n return cup;\n }\n }\n}","import Room from \"./Room\";\n\nexport class RoomInfo\n{\n public room : Room;\n public info : {[key:string]: any} = {};\n constructor(room : Room){\n this.room = room;\n this.room.on('updateinfo',(name:string,value:any) => {\n this.info[name] = value;\n })\n };\n public async fetch(name?:string)\n {\n if(name)\n {\n let rinfo = await this.room.mwse.EventPooling.request(({\n type: \"room/getinfo\",\n roomId: this.room.roomId,\n name\n }));\n if(rinfo.status == \"success\")\n {\n this.info = rinfo.value;\n }else console.warn(rinfo.message);\n }else{\n let rinfo = await this.room.mwse.EventPooling.request(({\n type: \"room/info\",\n roomId: this.room.roomId\n }));\n if(rinfo.status == \"success\")\n {\n this.info = rinfo.value;\n }else console.warn(rinfo.message);\n };\n return this.info;\n }\n public set(name: string, value: string | number)\n {\n this.info[name] = value;\n this.room.mwse.WSTSProtocol.SendOnly({\n type: \"room/setinfo\",\n roomId: this.room.roomId,\n name,\n value\n });\n }\n public get(name?:string)\n {\n return name ? this.info[name] : this.info;\n }\n}","import MWSE from \"./index\";\n\nexport interface Message {\n [key:string|number]:any;\n}\nexport default class WSTSProtocol\n{\n public mwse : MWSE;\n constructor(wsts:MWSE){\n this.mwse = wsts;\n this.addListener();\n }\n public addListener()\n {\n this.mwse.server?.onRecaivePack((pack)=>{\n this.PackAnalyze(pack)\n })\n }\n public SendRaw(pack: Message)\n {\n this.mwse.server.tranferToServer(pack);\n }\n public SendOnly(pack: Message)\n {\n this.mwse.server.tranferToServer([pack,'R']);\n }\n public SendRequest(pack: Message, id: number)\n {\n this.mwse.server.tranferToServer([pack, id, 'R']);\n }\n public StartStream(pack: Message, id: number)\n {\n this.mwse.server.tranferToServer([pack, id, 'S']);\n }\n public PackAnalyze(data:any)\n {\n let [payload, id, action] = data;\n if(typeof id === 'number')\n {\n let callback = this.mwse.EventPooling.events.get(id);\n if(callback)\n {\n callback[0](payload, action);\n switch(action)\n {\n case 'E':{ // [E]ND flag\n this.mwse.EventPooling.events.delete(id);\n break;\n }\n case 'S': // [S]TREAM flag\n default:{\n break;\n }\n }\n }else console.warn(\"Missing event sended from server\");\n }else{\n let signals = this.mwse.EventPooling.signals.get(id);\n if(signals)\n {\n for (const callback of signals) {\n callback(payload);\n }\n }else console.warn(\"Missing event sended from server\");\n }\n }\n}"],"names":[],"version":3,"file":"index.js.map","sourceRoot":"../"} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json deleted file mode 100644 index c42a942..0000000 --- a/tsconfig.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "include": [ - "./frontend/**/*.ts", - "./frontend/*.ts" - ], - "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - "lib": ["DOM","ES6","ES2015.Promise"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "ES2015", /* Specify what module code is generated. */ - "rootDir": "./frontend", /* Specify the root folder within your source files. */ - "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ - "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ - "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "outFile": "./script", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./script", /* Specify an output folder for all emitted files. */ - "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - "importHelpers": false, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - //"inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - //"inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - "declarationDir": "./script", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ - - /* Type Checking */ - "strict": true, /* Enable all strict type-checking options. */ - "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - "allowUnusedLabels": false, /* Disable error reporting for unused labels. */ - "allowUnreachableCode": false, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -}