🎨 rewrite imports
This commit is contained in:
parent
16a3d1b334
commit
912d1c31d8
2705
api/package-lock.json
generated
2705
api/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -46,6 +46,7 @@
|
|||||||
"@types/express": "^4.17.9",
|
"@types/express": "^4.17.9",
|
||||||
"@types/i18next-node-fs-backend": "^2.1.0",
|
"@types/i18next-node-fs-backend": "^2.1.0",
|
||||||
"@types/jest": "^27.0.1",
|
"@types/jest": "^27.0.1",
|
||||||
|
"@types/jest-expect-message": "^1.0.3",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongodb": "^3.6.9",
|
"@types/mongodb": "^3.6.9",
|
||||||
"@types/mongoose": "^5.10.5",
|
"@types/mongoose": "^5.10.5",
|
||||||
@ -61,6 +62,8 @@
|
|||||||
"caxa": "^2.1.0",
|
"caxa": "^2.1.0",
|
||||||
"image-size": "^1.0.0",
|
"image-size": "^1.0.0",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
|
"jest-expect-message": "^1.0.2",
|
||||||
|
"jest-runtime": "^27.2.1",
|
||||||
"saslprep": "^1.0.3",
|
"saslprep": "^1.0.3",
|
||||||
"ts-node": "^9.1.1",
|
"ts-node": "^9.1.1",
|
||||||
"ts-node-dev": "^1.1.6",
|
"ts-node-dev": "^1.1.6",
|
||||||
@ -85,7 +88,7 @@
|
|||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-validator": "^6.9.2",
|
"express-validator": "^6.9.2",
|
||||||
"form-data": "^3.0.0",
|
"form-data": "^3.0.0",
|
||||||
"i18next": "^19.8.5",
|
"i18next": "^19.9.2",
|
||||||
"i18next-http-middleware": "^3.1.3",
|
"i18next-http-middleware": "^3.1.3",
|
||||||
"i18next-node-fs-backend": "^2.1.3",
|
"i18next-node-fs-backend": "^2.1.3",
|
||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
@ -106,6 +109,9 @@
|
|||||||
"setupFiles": [
|
"setupFiles": [
|
||||||
"<rootDir>/jest/setup.js"
|
"<rootDir>/jest/setup.js"
|
||||||
],
|
],
|
||||||
|
"setupFilesAfterEnv": [
|
||||||
|
"jest-expect-message"
|
||||||
|
],
|
||||||
"globalSetup": "<rootDir>/jest/globalSetup.js",
|
"globalSetup": "<rootDir>/jest/globalSetup.js",
|
||||||
"verbose": true
|
"verbose": true
|
||||||
}
|
}
|
||||||
|
138
bundle/package-lock.json
generated
138
bundle/package-lock.json
generated
@ -38,6 +38,7 @@
|
|||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^7.4.0",
|
||||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
|
"ts-patch": "^1.4.4",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.3.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -81,6 +82,9 @@
|
|||||||
"typeorm": "^0.2.37"
|
"typeorm": "^0.2.37"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.15.5",
|
||||||
|
"@babel/preset-env": "^7.15.6",
|
||||||
|
"@babel/preset-typescript": "^7.15.0",
|
||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/bcrypt": "^5.0.0",
|
"@types/bcrypt": "^5.0.0",
|
||||||
"@types/express": "^4.17.9",
|
"@types/express": "^4.17.9",
|
||||||
@ -94,8 +98,10 @@
|
|||||||
"@types/multer": "^1.4.5",
|
"@types/multer": "^1.4.5",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.7",
|
"@types/node-fetch": "^2.5.7",
|
||||||
|
"@types/supertest": "^2.0.11",
|
||||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"0x": "^4.10.2",
|
"0x": "^4.10.2",
|
||||||
|
"babel-jest": "^27.2.0",
|
||||||
"caxa": "^2.1.0",
|
"caxa": "^2.1.0",
|
||||||
"image-size": "^1.0.0",
|
"image-size": "^1.0.0",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
@ -198,6 +204,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lambert-server": "^1.2.10",
|
"lambert-server": "^1.2.10",
|
||||||
"missing-native-js-functions": "^1.2.15",
|
"missing-native-js-functions": "^1.2.15",
|
||||||
|
"multer": "^1.4.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.1",
|
||||||
@ -212,6 +219,7 @@
|
|||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongoose-autopopulate": "^0.10.1",
|
"@types/mongoose-autopopulate": "^0.10.1",
|
||||||
|
"@types/multer": "^1.4.7",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"jest": "^27.0.6"
|
"jest": "^27.0.6"
|
||||||
@ -565,6 +573,30 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"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==",
|
||||||
|
"dev": true,
|
||||||
|
"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/arg": {
|
"node_modules/arg": {
|
||||||
"version": "4.1.3",
|
"version": "4.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||||
@ -1121,6 +1153,15 @@
|
|||||||
"json5": "lib/cli.js"
|
"json5": "lib/cli.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/kind-of": {
|
||||||
|
"version": "6.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
|
||||||
|
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/make-error": {
|
"node_modules/make-error": {
|
||||||
"version": "1.3.6",
|
"version": "1.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
@ -1505,6 +1546,27 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ts-patch": {
|
||||||
|
"version": "1.4.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-patch/-/ts-patch-1.4.4.tgz",
|
||||||
|
"integrity": "sha512-b0CxxrkrCGsD22gl5BtSFlXzyTFP2mbOVffxMOWRrwdSh37sM01wzxSY4wlbBiHHHAJICmaaDgESzJ8lKkVoZA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"chalk": "^4.1.0",
|
||||||
|
"glob": "^7.1.7",
|
||||||
|
"global-prefix": "^3.0.0",
|
||||||
|
"minimist": "^1.2.5",
|
||||||
|
"resolve": "^1.20.0",
|
||||||
|
"shelljs": "^0.8.4",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"ts-patch": "bin/cli.js"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">2.7.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tsconfig-paths": {
|
"node_modules/tsconfig-paths": {
|
||||||
"version": "3.11.0",
|
"version": "3.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
||||||
@ -1565,6 +1627,24 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/which": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"which": "bin/which"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/yn": {
|
"node_modules/yn": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
@ -1603,6 +1683,9 @@
|
|||||||
"@fosscord/api": {
|
"@fosscord/api": {
|
||||||
"version": "file:../api",
|
"version": "file:../api",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@babel/core": "^7.15.5",
|
||||||
|
"@babel/preset-env": "^7.15.6",
|
||||||
|
"@babel/preset-typescript": "^7.15.0",
|
||||||
"@fosscord/util": "file:../util",
|
"@fosscord/util": "file:../util",
|
||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/bcrypt": "^5.0.0",
|
"@types/bcrypt": "^5.0.0",
|
||||||
@ -1618,6 +1701,7 @@
|
|||||||
"@types/multer": "^1.4.5",
|
"@types/multer": "^1.4.5",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.7",
|
"@types/node-fetch": "^2.5.7",
|
||||||
|
"@types/supertest": "^2.0.11",
|
||||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"0x": "^4.10.2",
|
"0x": "^4.10.2",
|
||||||
"ajv": "8.6.2",
|
"ajv": "8.6.2",
|
||||||
@ -1625,6 +1709,7 @@
|
|||||||
"amqplib": "^0.8.0",
|
"amqplib": "^0.8.0",
|
||||||
"assert": "^1.5.0",
|
"assert": "^1.5.0",
|
||||||
"atomically": "^1.7.0",
|
"atomically": "^1.7.0",
|
||||||
|
"babel-jest": "^27.2.0",
|
||||||
"bcrypt": "^5.0.1",
|
"bcrypt": "^5.0.1",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"caxa": "^2.1.0",
|
"caxa": "^2.1.0",
|
||||||
@ -1736,6 +1821,7 @@
|
|||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongoose-autopopulate": "^0.10.1",
|
"@types/mongoose-autopopulate": "^0.10.1",
|
||||||
|
"@types/multer": "^1.4.7",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"ajv": "^8.6.2",
|
"ajv": "^8.6.2",
|
||||||
@ -1747,6 +1833,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lambert-server": "^1.2.10",
|
"lambert-server": "^1.2.10",
|
||||||
"missing-native-js-functions": "^1.2.15",
|
"missing-native-js-functions": "^1.2.15",
|
||||||
|
"multer": "^1.4.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.1",
|
||||||
@ -2038,6 +2125,21 @@
|
|||||||
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
"integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"ansi-regex": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"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,
|
||||||
|
"requires": {
|
||||||
|
"color-convert": "^2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"arg": {
|
"arg": {
|
||||||
"version": "4.1.3",
|
"version": "4.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz",
|
||||||
@ -2456,6 +2558,12 @@
|
|||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"kind-of": {
|
||||||
|
"version": "6.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
|
||||||
|
"integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"make-error": {
|
"make-error": {
|
||||||
"version": "1.3.6",
|
"version": "1.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
|
||||||
@ -2740,6 +2848,21 @@
|
|||||||
"yn": "3.1.1"
|
"yn": "3.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ts-patch": {
|
||||||
|
"version": "1.4.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-patch/-/ts-patch-1.4.4.tgz",
|
||||||
|
"integrity": "sha512-b0CxxrkrCGsD22gl5BtSFlXzyTFP2mbOVffxMOWRrwdSh37sM01wzxSY4wlbBiHHHAJICmaaDgESzJ8lKkVoZA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"chalk": "^4.1.0",
|
||||||
|
"glob": "^7.1.7",
|
||||||
|
"global-prefix": "^3.0.0",
|
||||||
|
"minimist": "^1.2.5",
|
||||||
|
"resolve": "^1.20.0",
|
||||||
|
"shelljs": "^0.8.4",
|
||||||
|
"strip-ansi": "^6.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"tsconfig-paths": {
|
"tsconfig-paths": {
|
||||||
"version": "3.11.0",
|
"version": "3.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
|
||||||
@ -2781,6 +2904,21 @@
|
|||||||
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
|
||||||
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
|
||||||
},
|
},
|
||||||
|
"which": {
|
||||||
|
"version": "1.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||||
|
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"isexe": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"wrappy": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"yn": {
|
"yn": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz",
|
||||||
|
@ -45,6 +45,7 @@
|
|||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^7.4.0",
|
||||||
"@zerollup/ts-transform-paths": "^1.7.18",
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"ts-node": "^10.2.1",
|
"ts-node": "^10.2.1",
|
||||||
|
"ts-patch": "^1.4.4",
|
||||||
"typescript": "^4.3.5"
|
"typescript": "^4.3.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
47
cdn/package-lock.json
generated
47
cdn/package-lock.json
generated
@ -45,6 +45,7 @@
|
|||||||
"@types/node": "^14.17.0",
|
"@types/node": "^14.17.0",
|
||||||
"@types/node-fetch": "^2.5.7",
|
"@types/node-fetch": "^2.5.7",
|
||||||
"@types/uuid": "^8.3.0",
|
"@types/uuid": "^8.3.0",
|
||||||
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"ts-patch": "^1.4.4"
|
"ts-patch": "^1.4.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -62,6 +63,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lambert-server": "^1.2.10",
|
"lambert-server": "^1.2.10",
|
||||||
"missing-native-js-functions": "^1.2.15",
|
"missing-native-js-functions": "^1.2.15",
|
||||||
|
"multer": "^1.4.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.1",
|
||||||
@ -76,6 +78,7 @@
|
|||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongoose-autopopulate": "^0.10.1",
|
"@types/mongoose-autopopulate": "^0.10.1",
|
||||||
|
"@types/multer": "^1.4.7",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"jest": "^27.0.6"
|
"jest": "^27.0.6"
|
||||||
@ -1282,6 +1285,30 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
|
||||||
"integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="
|
"integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@zerollup/ts-helpers": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"resolve": "^1.12.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">=3.7.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@zerollup/ts-transform-paths": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@zerollup/ts-helpers": "^1.7.18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">=3.7.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/abab": {
|
"node_modules/abab": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
||||||
@ -6171,6 +6198,7 @@
|
|||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongoose-autopopulate": "^0.10.1",
|
"@types/mongoose-autopopulate": "^0.10.1",
|
||||||
|
"@types/multer": "^1.4.7",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"ajv": "^8.6.2",
|
"ajv": "^8.6.2",
|
||||||
@ -6182,6 +6210,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lambert-server": "^1.2.10",
|
"lambert-server": "^1.2.10",
|
||||||
"missing-native-js-functions": "^1.2.15",
|
"missing-native-js-functions": "^1.2.15",
|
||||||
|
"multer": "^1.4.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.1",
|
||||||
@ -6740,6 +6769,24 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.1.tgz",
|
||||||
"integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="
|
"integrity": "sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw=="
|
||||||
},
|
},
|
||||||
|
"@zerollup/ts-helpers": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"resolve": "^1.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@zerollup/ts-transform-paths": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@zerollup/ts-helpers": "^1.7.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"abab": {
|
"abab": {
|
||||||
"version": "2.0.5",
|
"version": "2.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
"@types/node": "^14.17.0",
|
"@types/node": "^14.17.0",
|
||||||
"@types/node-fetch": "^2.5.7",
|
"@types/node-fetch": "^2.5.7",
|
||||||
"@types/uuid": "^8.3.0",
|
"@types/uuid": "^8.3.0",
|
||||||
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"ts-patch": "^1.4.4"
|
"ts-patch": "^1.4.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
|
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@fosscord/cdn/": ["src/index.ts"],
|
"@fosscord/cdn/": ["src/index"],
|
||||||
"@fosscord/cdn/*": ["src/*"]
|
"@fosscord/cdn/*": ["src/*"]
|
||||||
},
|
},
|
||||||
"plugins": [{ "transform": "@zerollup/ts-transform-paths" }]
|
"plugins": [{ "transform": "@zerollup/ts-transform-paths" }]
|
||||||
|
47
gateway/package-lock.json
generated
47
gateway/package-lock.json
generated
@ -32,6 +32,7 @@
|
|||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"@types/uuid": "^8.3.0",
|
"@types/uuid": "^8.3.0",
|
||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^7.4.0",
|
||||||
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"ts-node-dev": "^1.1.6",
|
"ts-node-dev": "^1.1.6",
|
||||||
"ts-patch": "^1.4.4",
|
"ts-patch": "^1.4.4",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
@ -51,6 +52,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lambert-server": "^1.2.10",
|
"lambert-server": "^1.2.10",
|
||||||
"missing-native-js-functions": "^1.2.15",
|
"missing-native-js-functions": "^1.2.15",
|
||||||
|
"multer": "^1.4.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.1",
|
||||||
@ -65,6 +67,7 @@
|
|||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongoose-autopopulate": "^0.10.1",
|
"@types/mongoose-autopopulate": "^0.10.1",
|
||||||
|
"@types/multer": "^1.4.7",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"jest": "^27.0.6"
|
"jest": "^27.0.6"
|
||||||
@ -197,6 +200,30 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz",
|
||||||
"integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw=="
|
"integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@zerollup/ts-helpers": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"resolve": "^1.12.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">=3.7.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@zerollup/ts-transform-paths": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@zerollup/ts-helpers": "^1.7.18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"typescript": ">=3.7.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/accepts": {
|
"node_modules/accepts": {
|
||||||
"version": "1.3.7",
|
"version": "1.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
||||||
@ -2690,6 +2717,7 @@
|
|||||||
"@types/amqplib": "^0.8.1",
|
"@types/amqplib": "^0.8.1",
|
||||||
"@types/jsonwebtoken": "^8.5.0",
|
"@types/jsonwebtoken": "^8.5.0",
|
||||||
"@types/mongoose-autopopulate": "^0.10.1",
|
"@types/mongoose-autopopulate": "^0.10.1",
|
||||||
|
"@types/multer": "^1.4.7",
|
||||||
"@types/node": "^14.17.9",
|
"@types/node": "^14.17.9",
|
||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"ajv": "^8.6.2",
|
"ajv": "^8.6.2",
|
||||||
@ -2701,6 +2729,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1",
|
"jsonwebtoken": "^8.5.1",
|
||||||
"lambert-server": "^1.2.10",
|
"lambert-server": "^1.2.10",
|
||||||
"missing-native-js-functions": "^1.2.15",
|
"missing-native-js-functions": "^1.2.15",
|
||||||
|
"multer": "^1.4.3",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"patch-package": "^6.4.7",
|
"patch-package": "^6.4.7",
|
||||||
"pg": "^8.7.1",
|
"pg": "^8.7.1",
|
||||||
@ -2834,6 +2863,24 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.3.tgz",
|
||||||
"integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw=="
|
"integrity": "sha512-fbF6oTd4sGGy0xjHPKAt+eS2CrxJ3+6gQ3FGcBoIJR2TLAyCkCyI8JqZNy+FeON0AhVgNJoUumVoZQjBFUqHkw=="
|
||||||
},
|
},
|
||||||
|
"@zerollup/ts-helpers": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"resolve": "^1.12.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@zerollup/ts-transform-paths": {
|
||||||
|
"version": "1.7.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@zerollup/ts-transform-paths/-/ts-transform-paths-1.7.18.tgz",
|
||||||
|
"integrity": "sha512-YPVUxvWQVzRx1OBN0Pmkd58+R9FcfUJuwTaPUSoi5rKxuXMtxevTXdfi0w5mEaIH8b0DfL+wg0wFDHiJE+S2zA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@zerollup/ts-helpers": "^1.7.18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"accepts": {
|
"accepts": {
|
||||||
"version": "1.3.7",
|
"version": "1.3.7",
|
||||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
"@types/node-fetch": "^2.5.12",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"@types/uuid": "^8.3.0",
|
"@types/uuid": "^8.3.0",
|
||||||
"@types/ws": "^7.4.0",
|
"@types/ws": "^7.4.0",
|
||||||
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
||||||
"ts-node-dev": "^1.1.6",
|
"ts-node-dev": "^1.1.6",
|
||||||
"ts-patch": "^1.4.4",
|
"ts-patch": "^1.4.4",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
import { WebSocket } from "@fosscord/gateway";
|
||||||
import { Message } from "./Message";
|
import { Message } from "./Message";
|
||||||
import { Session } from "@fosscord/util";
|
import { Session } from "@fosscord/util";
|
||||||
|
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import WS from "ws";
|
import WS from "ws";
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
import {
|
||||||
|
setHeartbeat,
|
||||||
|
Send,
|
||||||
|
CLOSECODES,
|
||||||
|
OPCODES,
|
||||||
|
WebSocket,
|
||||||
|
} from "@fosscord/gateway";
|
||||||
import { IncomingMessage } from "http";
|
import { IncomingMessage } from "http";
|
||||||
import { Close } from "./Close";
|
import { Close } from "./Close";
|
||||||
import { Message } from "./Message";
|
import { Message } from "./Message";
|
||||||
import { setHeartbeat } from "@fosscord/gateway/util/setHeartbeat";
|
|
||||||
import { Send } from "@fosscord/gateway/util/Send";
|
|
||||||
import { CLOSECODES, OPCODES } from "@fosscord/gateway/util/Constants";
|
|
||||||
import { createDeflate } from "zlib";
|
import { createDeflate } from "zlib";
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
import { Session } from "@fosscord/util";
|
import { Session } from "@fosscord/util";
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
import { WebSocket, Payload, CLOSECODES, OPCODES } from "@fosscord/gateway";
|
||||||
var erlpack: any;
|
var erlpack: any;
|
||||||
try {
|
try {
|
||||||
erlpack = require("erlpack");
|
erlpack = require("erlpack");
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
import OPCodeHandlers from "../opcodes";
|
import OPCodeHandlers from "../opcodes";
|
||||||
import { Payload, CLOSECODES, OPCODES } from "@fosscord/gateway/util/Constants";
|
|
||||||
import { instanceOf, Tuple } from "lambert-server";
|
import { instanceOf, Tuple } from "lambert-server";
|
||||||
import { check } from "../opcodes/instanceOf";
|
import { check } from "../opcodes/instanceOf";
|
||||||
import WS from "ws";
|
import WS from "ws";
|
||||||
|
@ -9,12 +9,9 @@ import {
|
|||||||
ListenEventOpts,
|
ListenEventOpts,
|
||||||
Member,
|
Member,
|
||||||
} from "@fosscord/util";
|
} from "@fosscord/util";
|
||||||
import { OPCODES } from "@fosscord/gateway/util/Constants";
|
import { OPCODES, WebSocket, Send } from "@fosscord/gateway";
|
||||||
import { Send } from "@fosscord/gateway/util/Send";
|
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
import "missing-native-js-functions";
|
import "missing-native-js-functions";
|
||||||
import { Channel as AMQChannel } from "amqplib";
|
import { Channel as AMQChannel } from "amqplib";
|
||||||
import { In, Like } from "typeorm";
|
|
||||||
import { Recipient } from "@fosscord/util";
|
import { Recipient } from "@fosscord/util";
|
||||||
|
|
||||||
// TODO: close connection on Invalidated Token
|
// TODO: close connection on Invalidated Token
|
||||||
@ -116,7 +113,7 @@ async function consume(this: WebSocket, opts: EventOpts) {
|
|||||||
.has("VIEW_CHANNEL")
|
.has("VIEW_CHANNEL")
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
//No break needed here, we need to call the listenEvent function below
|
//No break needed here, we need to call the listenEvent function below
|
||||||
case "GUILD_CREATE":
|
case "GUILD_CREATE":
|
||||||
this.events[id] = await listenEvent(id, consumer, listenOpts);
|
this.events[id] = await listenEvent(id, consumer, listenOpts);
|
||||||
break;
|
break;
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
import { CLOSECODES, Payload } from "@fosscord/gateway/util/Constants";
|
import { Payload, Send, setHeartbeat, WebSocket } from "@fosscord/gateway";
|
||||||
import { Send } from "@fosscord/gateway/util/Send";
|
|
||||||
import { setHeartbeat } from "@fosscord/gateway/util/setHeartbeat";
|
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
|
|
||||||
export async function onHeartbeat(this: WebSocket, data: Payload) {
|
export async function onHeartbeat(this: WebSocket, data: Payload) {
|
||||||
// TODO: validate payload
|
// TODO: validate payload
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
import { CLOSECODES, Payload, OPCODES } from "@fosscord/gateway/util/Constants";
|
import {
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
WebSocket,
|
||||||
|
CLOSECODES,
|
||||||
|
Payload,
|
||||||
|
OPCODES,
|
||||||
|
genSessionId,
|
||||||
|
} from "@fosscord/gateway";
|
||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
checkToken,
|
checkToken,
|
||||||
@ -24,7 +29,6 @@ import { Send } from "@fosscord/gateway/util/Send";
|
|||||||
const experiments: any = [];
|
const experiments: any = [];
|
||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
import { Recipient } from "@fosscord/util";
|
import { Recipient } from "@fosscord/util";
|
||||||
import { genSessionId } from "@fosscord/gateway/util/SessionUtils";
|
|
||||||
|
|
||||||
// TODO: bot sharding
|
// TODO: bot sharding
|
||||||
// TODO: check priviliged intents
|
// TODO: check priviliged intents
|
||||||
@ -98,7 +102,9 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
//TODO is this needed? check if users in group dm that are not friends are sent in the READY event
|
//TODO is this needed? check if users in group dm that are not friends are sent in the READY event
|
||||||
//users = users.concat(x.channel.recipients);
|
//users = users.concat(x.channel.recipients);
|
||||||
if (x.channel.isDm()) {
|
if (x.channel.isDm()) {
|
||||||
x.channel.recipients = x.channel.recipients!.filter((x) => x.id !== this.user_id);
|
x.channel.recipients = x.channel.recipients!.filter(
|
||||||
|
(x) => x.id !== this.user_id
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return x.channel;
|
return x.channel;
|
||||||
});
|
});
|
||||||
@ -109,7 +115,7 @@ export async function onIdentify(this: WebSocket, data: Payload) {
|
|||||||
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
if (!user) return this.close(CLOSECODES.Authentication_failed);
|
||||||
|
|
||||||
for (let relation of user.relationships) {
|
for (let relation of user.relationships) {
|
||||||
const related_user = relation.to
|
const related_user = relation.to;
|
||||||
const public_related_user = {
|
const public_related_user = {
|
||||||
username: related_user.username,
|
username: related_user.username,
|
||||||
discriminator: related_user.discriminator,
|
discriminator: related_user.discriminator,
|
||||||
|
@ -2,13 +2,10 @@ import {
|
|||||||
getPermission,
|
getPermission,
|
||||||
Member,
|
Member,
|
||||||
PublicMemberProjection,
|
PublicMemberProjection,
|
||||||
PublicUserProjection,
|
|
||||||
Role,
|
Role,
|
||||||
} from "@fosscord/util";
|
} from "@fosscord/util";
|
||||||
import { LazyRequest } from "../schema/LazyRequest";
|
import { LazyRequest } from "../schema/LazyRequest";
|
||||||
import { OPCODES, Payload } from "@fosscord/gateway/util/Constants";
|
import { WebSocket, Send, OPCODES, Payload } from "@fosscord/gateway";
|
||||||
import { Send } from "@fosscord/gateway/util/Send";
|
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
import "missing-native-js-functions";
|
import "missing-native-js-functions";
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { CLOSECODES, Payload } from "@fosscord/gateway/util/Constants";
|
import { WebSocket, Payload } from "@fosscord/gateway";
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
|
|
||||||
export function onPresenceUpdate(this: WebSocket, data: Payload) {
|
export function onPresenceUpdate(this: WebSocket, data: Payload) {
|
||||||
// return this.close(CLOSECODES.Unknown_error);
|
// return this.close(CLOSECODES.Unknown_error);
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
import { CLOSECODES, Payload } from "@fosscord/gateway/util/Constants";
|
import { Payload, WebSocket } from "@fosscord/gateway";
|
||||||
|
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
|
|
||||||
export function onRequestGuildMembers(this: WebSocket, data: Payload) {
|
export function onRequestGuildMembers(this: WebSocket, data: Payload) {
|
||||||
// return this.close(CLOSECODES.Unknown_error);
|
// return this.close(CLOSECODES.Unknown_error);
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
import { CLOSECODES, Payload } from "@fosscord/gateway/util/Constants";
|
import { WebSocket, Payload, Send } from "@fosscord/gateway";
|
||||||
import { Send } from "@fosscord/gateway/util/Send";
|
|
||||||
|
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
|
|
||||||
export async function onResume(this: WebSocket, data: Payload) {
|
export async function onResume(this: WebSocket, data: Payload) {
|
||||||
console.log("Got Resume -> cancel not implemented");
|
console.log("Got Resume -> cancel not implemented");
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { VoiceStateUpdateSchema } from "../schema/VoiceStateUpdateSchema";
|
import { VoiceStateUpdateSchema } from "../schema/VoiceStateUpdateSchema";
|
||||||
import { Payload } from "@fosscord/gateway/util/Constants";
|
import { Payload, WebSocket, genVoiceToken } from "@fosscord/gateway";
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
import {
|
import {
|
||||||
Config,
|
Config,
|
||||||
@ -12,7 +11,6 @@ import {
|
|||||||
VoiceState,
|
VoiceState,
|
||||||
VoiceStateUpdateEvent,
|
VoiceStateUpdateEvent,
|
||||||
} from "@fosscord/util";
|
} from "@fosscord/util";
|
||||||
import { genVoiceToken } from "@fosscord/gateway/util/SessionUtils";
|
|
||||||
// TODO: check if a voice server is setup
|
// TODO: check if a voice server is setup
|
||||||
// Notice: Bot users respect the voice channel's user limit, if set. When the voice channel is full, you will not receive the Voice State Update or Voice Server Update events in response to your own Voice State Update. Having MANAGE_CHANNELS permission bypasses this limit and allows you to join regardless of the channel being full or not.
|
// Notice: Bot users respect the voice channel's user limit, if set. When the voice channel is full, you will not receive the Voice State Update or Voice Server Update events in response to your own Voice State Update. Having MANAGE_CHANNELS permission bypasses this limit and allows you to join regardless of the channel being full or not.
|
||||||
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
import { Payload } from "@fosscord/gateway/util/Constants";
|
import { WebSocket, Payload } from "@fosscord/gateway";
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
import { onHeartbeat } from "./Heartbeat";
|
import { onHeartbeat } from "./Heartbeat";
|
||||||
import { onIdentify } from "./Identify";
|
import { onIdentify } from "./Identify";
|
||||||
import { onLazyRequest } from "./LazyRequest";
|
import { onLazyRequest } from "./LazyRequest";
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import { instanceOf } from "lambert-server";
|
import { instanceOf } from "lambert-server";
|
||||||
import { CLOSECODES } from "@fosscord/gateway/util/Constants";
|
import { WebSocket, CLOSECODES } from "@fosscord/gateway";
|
||||||
import WebSocket from "@fosscord/gateway/util/WebSocket";
|
|
||||||
|
|
||||||
export function check(this: WebSocket, schema: any, data: any) {
|
export function check(this: WebSocket, schema: any, data: any) {
|
||||||
try {
|
try {
|
||||||
|
@ -2,9 +2,7 @@ var erlpack: any;
|
|||||||
try {
|
try {
|
||||||
erlpack = require("erlpack");
|
erlpack = require("erlpack");
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
import { Payload } from "@fosscord/gateway/util/Constants";
|
import { Payload, WebSocket } from "@fosscord/gateway";
|
||||||
|
|
||||||
import WebSocket from "./WebSocket";
|
|
||||||
|
|
||||||
export async function Send(socket: WebSocket, data: Payload) {
|
export async function Send(socket: WebSocket, data: Payload) {
|
||||||
let buffer: Buffer | string;
|
let buffer: Buffer | string;
|
||||||
@ -20,7 +18,7 @@ export async function Send(socket: WebSocket, data: Payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
socket.send(buffer, (err) => {
|
socket.send(buffer, (err: any) => {
|
||||||
if (err) return rej(err);
|
if (err) return rej(err);
|
||||||
return res(null);
|
return res(null);
|
||||||
});
|
});
|
||||||
|
@ -3,7 +3,7 @@ import WS from "ws";
|
|||||||
import { Deflate } from "zlib";
|
import { Deflate } from "zlib";
|
||||||
import { Channel } from "amqplib";
|
import { Channel } from "amqplib";
|
||||||
|
|
||||||
interface WebSocket extends WS {
|
export interface WebSocket extends WS {
|
||||||
version: number;
|
version: number;
|
||||||
user_id: string;
|
user_id: string;
|
||||||
session_id: string;
|
session_id: string;
|
||||||
@ -19,5 +19,3 @@ interface WebSocket extends WS {
|
|||||||
permissions: Record<string, Permissions>;
|
permissions: Record<string, Permissions>;
|
||||||
events: Record<string, Function>;
|
events: Record<string, Function>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default WebSocket;
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { CLOSECODES } from "./Constants";
|
import { CLOSECODES } from "./Constants";
|
||||||
import WebSocket from "./WebSocket";
|
import { WebSocket } from "./WebSocket";
|
||||||
|
|
||||||
// TODO: make heartbeat timeout configurable
|
// TODO: make heartbeat timeout configurable
|
||||||
export function setHeartbeat(socket: WebSocket) {
|
export function setHeartbeat(socket: WebSocket) {
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"@fosscord/gateway": ["src/index"],
|
||||||
"@fosscord/gateway/*": ["src/*"],
|
"@fosscord/gateway/*": ["src/*"],
|
||||||
"@fosscord/util/*": ["../util/src/*"]
|
"@fosscord/util/*": ["../util/src/*"]
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user