Merge branch 'staging' into dev/Maddy/fix/listeningAfterDb

This commit is contained in:
Madeline
2022-08-30 15:08:18 +10:00
756 changed files with 18633 additions and 22467 deletions
-1
View File
@@ -1 +0,0 @@
MONGO_URL=mongodb://db:27017/fosscord?readPreference=secondaryPreferred
+2 -2
View File
@@ -1,2 +1,2 @@
node_modules/
db/
node_modules
dist
+55
View File
@@ -0,0 +1,55 @@
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=$(git hash-object -t tree /dev/null)
fi
# If you want to allow non-ASCII filenames set this variable to true.
allownonascii=$(git config --type=bool hooks.allownonascii)
# Redirect output to stderr.
exec 1>&2
# Cross platform projects tend to avoid non-ASCII filenames; prevent
# them from being added to the repository. We exploit the fact that the
# printable range starts at the space character and ends with tilde.
if [ "$allownonascii" != "true" ] &&
# Note that the use of brackets around a tr range is ok here, (it's
# even required, for portability to Solaris 10's /usr/bin/tr), since
# the square bracket bytes happen to fall in the designated range.
test $(git diff --cached --name-only --diff-filter=A -z $against |
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
then
cat <<\EOF
Error: Attempt to add a non-ASCII file name.
This can cause problems if you want to work with people on other platforms.
To be portable it is advisable to rename the file.
If you know what you are doing you can disable this check using:
git config hooks.allownonascii true
EOF
exit 1
fi
rm -rf dist
#npx prettier -w .
npx --yes -p prettier@latest -p pretty-quick pretty-quick
git update-index --again
# If there are whitespace errors, print the offending file names and fail.
#exec git diff-index --check --cached $against --
+9 -9
View File
@@ -1,11 +1,11 @@
blank_issues_enabled: true
contact_links:
- name: Fosscord Documentation
url: https://docs.fosscord.com/
about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation.
- name: Discord's Developer Documentation
url: https://discord.com/developers/docs/intro
about: Need help with the Discord resources? Head here instead of asking on Fosscord!
- name: Fosscord' Official Discord server
url: https://discord.com/invite/Ms5Ev7S6bF
about: Need help with the server? Talk with us in our official server.
- name: Fosscord Documentation
url: https://docs.fosscord.com/
about: Need documentation and examples for the Fosscord? Head over to Fosscord's official documentation.
- name: Discord's Developer Documentation
url: https://discord.com/developers/docs/intro
about: Need help with the Discord resources? Head here instead of asking on Fosscord!
- name: Fosscord' Official Discord server
url: https://discord.com/invite/Ms5Ev7S6bF
about: Need help with the server? Talk with us in our official server.
+8 -4
View File
@@ -1,13 +1,17 @@
## Notes
## Additions
-
-
## Fixes
-
## Download
- [Windows]()
- [MacOS]()
- [Linux]()
- [Windows]()
- [MacOS]()
- [Linux]()
After (extracting) and starting the server executable you can access your own Fosscord server on http://localhost:3001/
+23 -1
View File
@@ -9,4 +9,26 @@ files/
config.json
.vscode/settings.json
api/assets/plugins/*.js
api/assets/plugins/*.js
.idea/
*.code-workspace
*.log
*.log.ansi
bundle/depclean.*
*.tmp
tmp/
assets/cache/
*.generated
initial.json
.yarn/cache
build.json
yarn.lock
.yarn/install-state.gz
dbconf.json
migrations.db
+3 -2
View File
@@ -3,5 +3,6 @@
"useTabs": true,
"printWidth": 140,
"trailingComma": "none",
"useTabs": true
}
"pluginSearchDirs": ["./node_modules"],
"plugins": ["prettier-plugin-organize-imports"]
}
+13
View File
@@ -0,0 +1,13 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": ["<node_internals>/**"],
"program": "${file}",
"outFiles": ["${workspaceFolder}/**/*.js"]
}
]
}
+783
View File
File diff suppressed because one or more lines are too long
+3
View File
@@ -0,0 +1,3 @@
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.2.2.cjs
+7 -25
View File
@@ -1,8 +1,6 @@
FROM node:alpine
# env vars
ENV WORK_DIR="/srv/fosscord-server"
ENV DEV_MODE=0
ENV HTTP_PORT=3001
ENV WS_PORT=3002
ENV CDN_PORT=3003
@@ -13,28 +11,12 @@ ENV ADMIN_PORT=3005
EXPOSE ${HTTP_PORT}/tcp ${WS_PORT}/tcp ${CDN_PORT}/tcp ${RTC_PORT}/tcp ${ADMIN_PORT}/tcp
# install required apps
RUN apk add --no-cache --update git python2 py-pip make build-base
RUN apk add --no-cache --update git python3 py-pip make build-base
RUN ln -s /usr/bin/python3 /usr/bin/python
# optionl: packages for debugging/development
RUN apk add --no-cache sqlite
# Run as non-root user
# RUN adduser -D fosscord
# USER fosscord
# download fosscord-server
WORKDIR $WORK_DIR/src
RUN git clone https://github.com/fosscord/fosscord-server.git .
# setup and run
WORKDIR $WORK_DIR/src/bundle
RUN npm run setup
RUN npm install @yukikaze-bot/erlpack
# RUN npm install mysql --save
# create update script
RUN printf '#!/bin/sh\n\ngit -C $WORK_DIR/src/ checkout master\ngit -C $WORK_DIR/src/ reset --hard HEAD\ngit -C $WORK_DIR/src/ pull\ncd $WORK_DIR/src/bundle/\nnpm run setup\n' > $WORK_DIR/update.sh
RUN chmod +x $WORK_DIR/update.sh
# configure entrypoint file
RUN printf '#!/bin/sh\n\nDEV_MODE=${DEV_MODE:-0}\n\nif [ "$DEV_MODE" -eq 1 ]; then\n tail -f /dev/null\nelse\n cd $WORK_DIR/src/bundle/\n npm run start:bundle\nfi\n' > $WORK_DIR/entrypoint.sh
RUN chmod +x $WORK_DIR/entrypoint.sh
WORKDIR $WORK_DIR
ENTRYPOINT ["./entrypoint.sh"]
WORKDIR /srv/fosscord-server/bundle
ENTRYPOINT ["npm", "run", "start:bundle"]
-2
View File
@@ -1,2 +0,0 @@
node_modules
dist
-8
View File
@@ -1,8 +0,0 @@
MONGO_URL=mongodb://localhost/fosscord
PORT=3001
PRODUCTION=TRUE
THREADS=# automatically use all available cores, only available if production = true
#LOG_REQUESTS=
# only log 200 and 204: LOG_REQUESTS=200 204
# log everything except 200 and 204: LOG_REQUESTS=-200 204
# log all requests: LOG_REQUESTS=-
-115
View File
@@ -1,115 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
.env
.env.test
# parcel-bundler cache (https://parceljs.org/)
.cache
# Next.js build output
.next
# Nuxt.js build / generate output
.nuxt
dist
build
# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# TernJS port file
.tern-port
.DS_STORE
src/ready.json
# Docker
.docker/config/*
!.docker/config/.keep
# fosscord
*.db
-1
View File
@@ -1 +0,0 @@
!dist/
-6
View File
@@ -1,6 +0,0 @@
{
"tabWidth": 4,
"useTabs": true,
"printWidth": 140,
"trailingComma": "none"
}
-25
View File
@@ -1,25 +0,0 @@
{
"API Router": {
"scope": "javascript,typescript",
"prefix": "router",
"body": [
"import { Router, Response, Request } from \"express\";",
"import { route } from \"@fosscord/api\";",
"",
"const router = Router();",
"",
"router.get(\"/\", route({}), (req: Request, res: Response) => {",
"\tres.json({});",
"});",
"",
"export default router;"
],
"description": "A basic API router setup for a blank route."
},
"Route": {
"scope": "typescript",
"prefix": "route",
"body": ["router.get(\"$1\", route({}), (req: Request, res: Response) => {", "\t$2", "});"],
"description": "An API endpoint"
}
}
-28
View File
@@ -1,28 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"sourceMaps": true,
"type": "node",
"request": "launch",
"name": "Launch Server",
"program": "${workspaceFolder}/dist/start.js",
"preLaunchTask": "tsc: build - tsconfig.json",
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"envFile": "${workspaceFolder}/.env"
},
{
"name": "Debug current file",
"program": "${file}",
"request": "launch",
"skipFiles": ["<node_internals>/**"],
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"],
"preLaunchTask": "tsc: build - tsconfig.json",
"type": "node",
"resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"]
}
]
}
-12
View File
@@ -1,12 +0,0 @@
FROM node:lts-alpine
# needed for native packages (bcrypt, canvas)
RUN apk add --no-cache make gcc g++ python cairo-dev jpeg-dev pango-dev giflib-dev
WORKDIR /usr/src/fosscord-server
COPY package.json .
COPY package-lock.json .
RUN npm rebuild bcrypt --build-from-source && npm install canvas --build-from-source
RUN npm install
COPY . .
EXPOSE 3001
RUN npm run build-docker
CMD ["node", "dist/start.js"]
-67
View File
@@ -1,67 +0,0 @@
<p align="center">
<img width="100" src="https://raw.githubusercontent.com/fosscord/fosscord/master/assets/logo_big_transparent.png" />
</p>
<h1 align="center">Fosscord HTTP API Server</h1>
<p>
<a href="https://discord.gg/ZrnGQP6p3d">
<img src="https://img.shields.io/discord/806142446094385153?color=7489d5&logo=discord&logoColor=ffffff" />
</a>
<img src="https://img.shields.io/static/v1?label=Status&message=Development&color=blue">
<a title="Crowdin" target="_blank" href="https://translate.fosscord.com/"><img src="https://badges.crowdin.net/fosscord/localized.svg"></a>
<a href="https://opencollective.com/fosscord">
<img src="https://opencollective.com/fosscord/tiers/badge.svg">
</a>
</p>
## [About](https://github.com/fosscord/fosscord-server/wiki)
This repository contains the Fosscord HTTP API Server
## Bug Tracker
[Project Board](https://fosscord.notion.site/2c7fe9e73f9842d3bab3a4912dedd091)
## API
We use [express](https://expressjs.com/) for the HTTP Server and
[lambert-server](https://www.npmjs.com/package/lambert-server) for route handling and body validation (customized).
## Contribution
You should be familiar with:
- [Git](https://git-scm.com/)
- [NodeJS](https://nodejs.org/)
- [TypeScript](https://www.typescriptlang.org/)
- [MongoDB/mongoose](http://mongoosejs.com/)
and the other technologies we use
### Getting Started
Clone the Repository:
```bash
git clone https://github.com/fosscord/fosscord-server
cd fosscord-server
```
#### Install (dev)dependencies:
```bash
npm install
npm install --only=dev
```
#### Starting:
```
npm start
```
#### Debugging:
**Vscode:**
The Launch file configuration is in `./vscode/launch.json`,
so you can just debug the server by pressing `F5` or the `> Launch Server` button
-47
View File
@@ -1,47 +0,0 @@
const localStorage = window.localStorage;
// TODO: remote auth
// window.GLOBAL_ENV.REMOTE_AUTH_ENDPOINT = window.GLOBAL_ENV.GATEWAY_ENDPOINT.replace(/wss?:/, "");
localStorage.setItem("gatewayURL", window.GLOBAL_ENV.GATEWAY_ENDPOINT);
localStorage.setItem(
"DeveloperOptionsStore",
`{"trace":false,"canary":false,"logGatewayEvents":true,"logOverlayEvents":true,"logAnalyticsEvents":true,"sourceMapsEnabled":false,"axeEnabled":false}`
);
const supportedLocales = [
"bg",
"cs",
"da",
"de",
"el",
"en-GB",
"es-ES",
"fi",
"fr",
"hi",
"hr",
"hu",
"it",
"ja",
"ko",
"lt",
"nl",
"no",
"pl",
"pt-BR",
"ro",
"ru",
"sv-SE",
"th",
"tr",
"uk",
"vi",
"zh-CN",
"zh-TW"
];
const settings = JSON.parse(localStorage.getItem("UserSettingsStore"));
if (settings && !supportedLocales.includes(settings.locale)) {
// fix client locale wrong and client not loading at all
settings.locale = "en-US";
localStorage.setItem("UserSettingsStore", JSON.stringify(settings));
}
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
/* Your custom CSS goes here, enjoy! */
-6
View File
@@ -1,6 +0,0 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
["@babel/preset-typescript", { allowDeclareFields: true }]
]
};
-66
View File
@@ -1,66 +0,0 @@
const { traverseDirectory } = require("lambert-server");
const path = require("path");
const express = require("express");
const RouteUtility = require("../dist/util/route");
const Router = express.Router;
/**
* Some documentation.
*
* @type {Map<string, RouteUtility.RouteOptions>}
*/
const routes = new Map();
let currentPath = "";
let currentFile = "";
const methods = ["get", "post", "put", "delete", "patch"];
function registerPath(file, method, prefix, path, ...args) {
const urlPath = prefix + path;
const sourceFile = file.replace("/dist/", "/src/").replace(".js", ".ts");
const opts = args.find((x) => typeof x === "object");
if (opts) {
routes.set(urlPath + "|" + method, opts); // @ts-ignore
opts.file = sourceFile;
// console.log(method, urlPath, opts);
} else {
console.log(`${sourceFile}\nrouter.${method}("${path}") is missing the "route()" description middleware\n`);
}
}
function routeOptions(opts) {
return opts;
}
// @ts-ignore
RouteUtility.route = routeOptions;
express.Router = (opts) => {
const path = currentPath;
const file = currentFile;
const router = Router(opts);
for (const method of methods) {
router[method] = registerPath.bind(null, file, method, path);
}
return router;
};
module.exports = function getRouteDescriptions() {
const root = path.join(__dirname, "..", "dist", "routes", "/");
traverseDirectory({ dirname: root, recursive: true }, (file) => {
currentFile = file;
let path = file.replace(root.slice(0, -1), "");
path = path.split(".").slice(0, -1).join("."); // trancate .js/.ts file extension of path
path = path.replaceAll("#", ":").replaceAll("\\", "/"); // replace # with : for path parameters and windows paths with slashes
if (path.endsWith("/index")) path = path.slice(0, "/index".length * -1); // delete index from path
currentPath = path;
try {
require(file);
} catch (error) {
console.error("error loading file " + file, error);
}
});
return routes;
};
-20
View File
@@ -1,20 +0,0 @@
const { Config, initDatabase } = require("@fosscord/util");
const fs = require("fs");
const path = require("path");
const { FosscordServer } = require("../dist/Server");
const Server = new FosscordServer({ port: 3001 });
global.server = Server;
module.exports = async () => {
try {
fs.unlinkSync(path.join(process.cwd(), "database.db"));
} catch {}
await initDatabase();
await Config.init();
Config.get().limits.rate.disabled = true;
return await Server.start();
};
// afterAll(async () => {
// return await Server.stop();
// });
-2
View File
@@ -1,2 +0,0 @@
jest.spyOn(global.console, "log").mockImplementation(() => jest.fn());
jest.spyOn(global.console, "info").mockImplementation(() => jest.fn());
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "מייל או מספר טלפון לא נמצאים במאגר",
"INVALID_PASSWORD": "סיסמא שגויה",
"ACCOUNT_DISABLED": "משתמש זה חסום / מבוטל"
},
"register": {
"REGISTRATION_DISABLED": "לא ניתן לאפשר רישום משתמשים חדשים",
"INVITE_ONLY": "עליך להיות מוזמן בכדי להרשם",
"EMAIL_INVALID": "מייל שגוי",
"EMAIL_ALREADY_REGISTERED": "מייל זה כבר רשום",
"DATE_OF_BIRTH_UNDERAGE": "{{years}} עלייך להיות מעל גיל",
"CONSENT_REQUIRED": ".עליך להסכים לתנאי השירות ולמדיניות הפרטיות",
"USERNAME_TOO_MANY_USERS": "ליותר מדי משתמשים יש שם משתמש זהה, אנא נסה אחר"
}
}
-18
View File
@@ -1,18 +0,0 @@
{
"field": {
"BASE_TYPE_REQUIRED": "שדה זה חובה",
"BASE_TYPE_STRING": "שדה זה חייב להיות כטקסט",
"BASE_TYPE_NUMBER": "שדה זה חייב להיות מספר",
"BASE_TYPE_BIGINT": "השדה הזה חייב להיות ביגינט",
"BASE_TYPE_BOOLEAN": "השדה הזה חייב להיות בוליאני",
"BASE_TYPE_CHOICES": "({{types}}) שדה זה חייב להיות אחד מ",
"BASE_TYPE_CLASS": "{{type}} מסוג instance שדה זה חייב להיות",
"BASE_TYPE_OBJECT": "שדה זה חייב להיות אובייקט",
"BASE_TYPE_ARRAY": "שדה זה חייב להיות מערך",
"UNKOWN_FIELD": "{{key}} :מפתח לא ידוע",
"BASE_TYPE_CONSTANT": "{{value}} שדה זה חייב להיות",
"EMAIL_TYPE_INVALID_EMAIL": "כתובת דואר אלקטרוני לא חוקית",
"DATE_TYPE_PARSE": "ISO8601 אמור להיות {{date}} לא ניתן לאתר",
"BASE_TYPE_BAD_LENGTH": "{{length}} האורך חייב להיות בין"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-18
View File
@@ -1,18 +0,0 @@
{
"field": {
"BASE_TYPE_REQUIRED": "Это поле является обязательным",
"BASE_TYPE_STRING": "This field must be a string",
"BASE_TYPE_NUMBER": "This field must be a number",
"BASE_TYPE_BIGINT": "This field must be a bigint",
"BASE_TYPE_BOOLEAN": "This field must be a boolean",
"BASE_TYPE_CHOICES": "Это поле должно быть одним из ({{types}})",
"BASE_TYPE_CLASS": "Это поле должно быть экземпляром {{type}}",
"BASE_TYPE_OBJECT": "This field must be an object",
"BASE_TYPE_ARRAY": "This field must be an array",
"UNKOWN_FIELD": "Unknown key: {{key}}",
"BASE_TYPE_CONSTANT": "Это поле должно быть {{value}}",
"EMAIL_TYPE_INVALID_EMAIL": "Неправильный формат адреса электронной почты",
"DATE_TYPE_PARSE": "Could not parse {{date}}. Should be ISO8601",
"BASE_TYPE_BAD_LENGTH": "Длина должна быть между {{length}} в длину"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-18
View File
@@ -1,18 +0,0 @@
{
"field": {
"BASE_TYPE_REQUIRED": "This field is required",
"BASE_TYPE_STRING": "This field must be a string",
"BASE_TYPE_NUMBER": "This field must be a number",
"BASE_TYPE_BIGINT": "This field must be a bigint",
"BASE_TYPE_BOOLEAN": "This field must be a boolean",
"BASE_TYPE_CHOICES": "This field must be one of ({{types}})",
"BASE_TYPE_CLASS": "This field must be an instance of {{type}}",
"BASE_TYPE_OBJECT": "This field must be an object",
"BASE_TYPE_ARRAY": "This field must be an array",
"UNKOWN_FIELD": "Unknown key: {{key}}",
"BASE_TYPE_CONSTANT": "This field must be {{value}}",
"EMAIL_TYPE_INVALID_EMAIL": "Not a well-formed email address",
"DATE_TYPE_PARSE": "Could not parse {{date}}. Should be ISO8601",
"BASE_TYPE_BAD_LENGTH": "Must be between {{length}} in length"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
-18
View File
@@ -1,18 +0,0 @@
{
"field": {
"BASE_TYPE_REQUIRED": "This field is required",
"BASE_TYPE_STRING": "This field must be a string",
"BASE_TYPE_NUMBER": "This field must be a number",
"BASE_TYPE_BIGINT": "This field must be a bigint",
"BASE_TYPE_BOOLEAN": "This field must be a boolean",
"BASE_TYPE_CHOICES": "This field must be one of ({{types}})",
"BASE_TYPE_CLASS": "This field must be an instance of {{type}}",
"BASE_TYPE_OBJECT": "This field must be an object",
"BASE_TYPE_ARRAY": "This field must be an array",
"UNKOWN_FIELD": "Unknown key: {{key}}",
"BASE_TYPE_CONSTANT": "This field must be {{value}}",
"EMAIL_TYPE_INVALID_EMAIL": "Not a well-formed email address",
"DATE_TYPE_PARSE": "Could not parse {{date}}. Should be ISO8601",
"BASE_TYPE_BAD_LENGTH": "Must be between {{length}} in length"
}
}
-16
View File
@@ -1,16 +0,0 @@
{
"login": {
"INVALID_LOGIN": "E-Mail or Phone not found",
"INVALID_PASSWORD": "Invalid Password",
"ACCOUNT_DISABLED": "This account is disabled"
},
"register": {
"REGISTRATION_DISABLED": "New user registration is disabled",
"INVITE_ONLY": "You must be invited to register",
"EMAIL_INVALID": "Invalid Email",
"EMAIL_ALREADY_REGISTERED": "Email is already registered",
"DATE_OF_BIRTH_UNDERAGE": "You need to be {{years}} years or older",
"CONSENT_REQUIRED": "You must agree to the Terms of Service and Privacy Policy.",
"USERNAME_TOO_MANY_USERS": "Too many users have this username, please try another"
}
}
BIN
View File
Binary file not shown.
-106
View File
@@ -1,106 +0,0 @@
{
"name": "@fosscord/api",
"version": "1.0.0",
"description": "This repository contains the HTTP API Server",
"main": "dist/index.js",
"types": "src/index.ts",
"scripts": {
"test:only": "jest --coverage --verbose --forceExit ./tests",
"test:routes": "jest --coverage --verbose --forceExit ./routes.test.ts",
"test": "npm run build && npm run test:only",
"test:watch": "jest --watch",
"start": "npm run build && node dist/start",
"build": "npx tsc -p .",
"dev": "tsnd --respawn src/start.ts",
"patch": "ts-patch install -s && npx patch-package",
"postinstall": "npm run patch",
"generate:docs": "node scripts/generate_openapi",
"generate:schema": "node scripts/generate_schema"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fosscord/fosscord-server.git"
},
"keywords": [
"discord",
"fosscord",
"fosscord-server",
"fosscord-api",
"discord open source",
"discord-open-source"
],
"author": "Fosscord",
"license": "AGPL-3.0-only",
"bugs": {
"url": "https://github.com/fosscord/fosscord-server/issues"
},
"homepage": "https://fosscord.com",
"devDependencies": {
"@babel/core": "^7.15.5",
"@babel/preset-env": "^7.15.8",
"@babel/preset-typescript": "^7.15.0",
"@types/amqplib": "^0.8.1",
"@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.9",
"@types/i18next-node-fs-backend": "^2.1.0",
"@types/jest": "^27.0.1",
"@types/jest-expect-message": "^1.0.3",
"@types/jsonwebtoken": "^8.5.0",
"@types/morgan": "^1.9.3",
"@types/multer": "^1.4.5",
"@types/node": "^14.17.9",
"@types/node-fetch": "^2.5.5",
"@types/supertest": "^2.0.11",
"@zerollup/ts-transform-paths": "^1.7.18",
"jest": "^27.2.5",
"jest-expect-message": "^1.0.2",
"jest-runtime": "^27.2.1",
"ts-node": "^9.1.1",
"ts-node-dev": "^1.1.6",
"ts-patch": "^1.4.4",
"typescript": "^4.4.2",
"typescript-json-schema": "0.50.1"
},
"dependencies": {
"@babel/preset-env": "^7.15.8",
"@babel/preset-typescript": "^7.15.0",
"@fosscord/util": "file:../util",
"@sentry/node": "^6.16.1",
"@sentry/tracing": "^6.16.1",
"ajv": "8.6.2",
"ajv-formats": "^2.1.1",
"amqplib": "^0.8.0",
"assert": "^1.5.0",
"bcrypt": "^5.0.1",
"body-parser": "^1.19.0",
"cheerio": "^1.0.0-rc.10",
"dotenv": "^8.2.0",
"express": "^4.17.1",
"form-data": "^3.0.0",
"i18next": "^19.9.2",
"i18next-http-middleware": "^3.1.3",
"i18next-node-fs-backend": "^2.1.3",
"image-size": "^1.0.0",
"jsonwebtoken": "^8.5.1",
"lambert-server": "^1.2.12",
"missing-native-js-functions": "^1.2.18",
"morgan": "^1.10.0",
"multer": "^1.4.2",
"node-fetch": "^2.6.2",
"patch-package": "^6.4.7",
"picocolors": "^1.0.0",
"proxy-agent": "^5.0.0",
"supertest": "^6.1.6",
"typeorm": "^0.2.37"
},
"jest": {
"setupFiles": [
"<rootDir>/jest/setup.js"
],
"setupFilesAfterEnv": [
"jest-expect-message"
],
"globalSetup": "<rootDir>/jest/globalSetup.js",
"verbose": true
}
}
-249
View File
@@ -1,249 +0,0 @@
diff --git a/node_modules/ajv/dist/compile/jtd/parse.js b/node_modules/ajv/dist/compile/jtd/parse.js
index 1eeb1be..7684121 100644
--- a/node_modules/ajv/dist/compile/jtd/parse.js
+++ b/node_modules/ajv/dist/compile/jtd/parse.js
@@ -239,6 +239,9 @@ function parseType(cxt) {
gen.if(fail, () => parsingError(cxt, codegen_1.str `invalid timestamp`));
break;
}
+ case "bigint":
+ parseBigInt(cxt);
+ break
case "float32":
case "float64":
parseNumber(cxt);
@@ -284,6 +287,15 @@ function parseNumber(cxt, maxDigits) {
skipWhitespace(cxt);
gen.if(codegen_1._ `"-0123456789".indexOf(${jsonSlice(1)}) < 0`, () => jsonSyntaxError(cxt), () => parseWith(cxt, parseJson_1.parseJsonNumber, maxDigits));
}
+function parseBigInt(cxt, maxDigits) {
+ const {gen} = cxt
+ skipWhitespace(cxt)
+ gen.if(
+ _`"-0123456789".indexOf(${jsonSlice(1)}) < 0`,
+ () => jsonSyntaxError(cxt),
+ () => parseWith(cxt, parseJson_1.parseJsonBigInt, maxDigits)
+ )
+}
function parseBooleanToken(bool, fail) {
return (cxt) => {
const { gen, data } = cxt;
diff --git a/node_modules/ajv/dist/compile/rules.js b/node_modules/ajv/dist/compile/rules.js
index 82a591f..1ebd8fe 100644
--- a/node_modules/ajv/dist/compile/rules.js
+++ b/node_modules/ajv/dist/compile/rules.js
@@ -1,7 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getRules = exports.isJSONType = void 0;
-const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"];
+const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array","bigint"];
const jsonTypes = new Set(_jsonTypes);
function isJSONType(x) {
return typeof x == "string" && jsonTypes.has(x);
@@ -13,10 +13,11 @@ function getRules() {
string: { type: "string", rules: [] },
array: { type: "array", rules: [] },
object: { type: "object", rules: [] },
+ bigint: {type: "bigint", rules: []}
};
return {
- types: { ...groups, integer: true, boolean: true, null: true },
- rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object],
+ types: { ...groups, integer: true, boolean: true, null: true, bigint: true },
+ rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object, groups.bigint],
post: { rules: [] },
all: {},
keywords: {},
diff --git a/node_modules/ajv/dist/compile/validate/dataType.js b/node_modules/ajv/dist/compile/validate/dataType.js
index 6319e76..8b50b4c 100644
--- a/node_modules/ajv/dist/compile/validate/dataType.js
+++ b/node_modules/ajv/dist/compile/validate/dataType.js
@@ -52,7 +52,7 @@ function coerceAndCheckDataType(it, types) {
return checkTypes;
}
exports.coerceAndCheckDataType = coerceAndCheckDataType;
-const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]);
+const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null","bigint"]);
function coerceToTypes(types, coerceTypes) {
return coerceTypes
? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
@@ -83,6 +83,14 @@ function coerceData(it, types, coerceTo) {
});
function coerceSpecificType(t) {
switch (t) {
+ case "bigint":
+ gen
+ .elseIf(
+ codegen_1._`${dataType} == "boolean" || ${data} === null
+ || (${dataType} == "string" && ${data} && ${data} == BigInt(${data}))`
+ )
+ .assign(coerced, codegen_1._`BigInt(${data})`)
+ return
case "string":
gen
.elseIf(codegen_1._ `${dataType} == "number" || ${dataType} == "boolean"`)
@@ -143,6 +151,9 @@ function checkDataType(dataType, data, strictNums, correct = DataType.Correct) {
case "number":
cond = numCond();
break;
+ case "bigint":
+ cond = codegen_1._`typeof ${data} == "bigint" && isFinite(${data})`
+ break
default:
return codegen_1._ `typeof ${data} ${EQ} ${dataType}`;
}
diff --git a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json
index 7027a12..25679c8 100644
--- a/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json
+++ b/node_modules/ajv/dist/refs/json-schema-2019-09/meta/validation.json
@@ -78,7 +78,7 @@
"default": 0
},
"simpleTypes": {
- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"]
},
"stringArray": {
"type": "array",
diff --git a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
index e0ae13d..57c9036 100644
--- a/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
+++ b/node_modules/ajv/dist/refs/json-schema-2020-12/meta/validation.json
@@ -78,7 +78,7 @@
"default": 0
},
"simpleTypes": {
- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"]
},
"stringArray": {
"type": "array",
diff --git a/node_modules/ajv/dist/refs/json-schema-draft-06.json b/node_modules/ajv/dist/refs/json-schema-draft-06.json
index 5410064..774435b 100644
--- a/node_modules/ajv/dist/refs/json-schema-draft-06.json
+++ b/node_modules/ajv/dist/refs/json-schema-draft-06.json
@@ -16,7 +16,7 @@
"allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
},
"simpleTypes": {
- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"]
},
"stringArray": {
"type": "array",
diff --git a/node_modules/ajv/dist/refs/json-schema-draft-07.json b/node_modules/ajv/dist/refs/json-schema-draft-07.json
index 6a74851..fc6dd7d 100644
--- a/node_modules/ajv/dist/refs/json-schema-draft-07.json
+++ b/node_modules/ajv/dist/refs/json-schema-draft-07.json
@@ -16,7 +16,7 @@
"allOf": [{"$ref": "#/definitions/nonNegativeInteger"}, {"default": 0}]
},
"simpleTypes": {
- "enum": ["array", "boolean", "integer", "null", "number", "object", "string"]
+ "enum": ["array", "boolean", "integer", "null", "number", "object", "string","bigint"]
},
"stringArray": {
"type": "array",
diff --git a/node_modules/ajv/dist/refs/jtd-schema.js b/node_modules/ajv/dist/refs/jtd-schema.js
index 1ee940a..1148887 100644
--- a/node_modules/ajv/dist/refs/jtd-schema.js
+++ b/node_modules/ajv/dist/refs/jtd-schema.js
@@ -38,6 +38,7 @@ const typeForm = (root) => ({
"uint16",
"int32",
"uint32",
+ "bigint",
],
},
},
diff --git a/node_modules/ajv/dist/runtime/parseJson.js b/node_modules/ajv/dist/runtime/parseJson.js
index 2576a6e..e7447b1 100644
--- a/node_modules/ajv/dist/runtime/parseJson.js
+++ b/node_modules/ajv/dist/runtime/parseJson.js
@@ -97,6 +97,71 @@ exports.parseJsonNumber = parseJsonNumber;
parseJsonNumber.message = undefined;
parseJsonNumber.position = 0;
parseJsonNumber.code = 'require("ajv/dist/runtime/parseJson").parseJsonNumber';
+
+function parseJsonBigInt(s, pos, maxDigits) {
+ let numStr = "";
+ let c;
+ parseJsonBigInt.message = undefined;
+ if (s[pos] === "-") {
+ numStr += "-";
+ pos++;
+ }
+ if (s[pos] === "0") {
+ numStr += "0";
+ pos++;
+ }
+ else {
+ if (!parseDigits(maxDigits)) {
+ errorMessage();
+ return undefined;
+ }
+ }
+ if (maxDigits) {
+ parseJsonBigInt.position = pos;
+ return BigInt(numStr);
+ }
+ if (s[pos] === ".") {
+ numStr += ".";
+ pos++;
+ if (!parseDigits()) {
+ errorMessage();
+ return undefined;
+ }
+ }
+ if (((c = s[pos]), c === "e" || c === "E")) {
+ numStr += "e";
+ pos++;
+ if (((c = s[pos]), c === "+" || c === "-")) {
+ numStr += c;
+ pos++;
+ }
+ if (!parseDigits()) {
+ errorMessage();
+ return undefined;
+ }
+ }
+ parseJsonBigInt.position = pos;
+ return BigInt(numStr);
+ function parseDigits(maxLen) {
+ let digit = false;
+ while (((c = s[pos]), c >= "0" && c <= "9" && (maxLen === undefined || maxLen-- > 0))) {
+ digit = true;
+ numStr += c;
+ pos++;
+ }
+ return digit;
+ }
+ function errorMessage() {
+ parseJsonBigInt.position = pos;
+ parseJsonBigInt.message = pos < s.length ? `unexpected token ${s[pos]}` : "unexpected end";
+ }
+}
+exports.parseJsonBigInt = parseJsonBigInt;
+parseJsonBigInt.message = undefined;
+parseJsonBigInt.position = 0;
+parseJsonBigInt.code = 'require("ajv/dist/runtime/parseJson").parseJsonBigInt';
+
+
const escapedChars = {
b: "\b",
f: "\f",
diff --git a/node_modules/ajv/dist/vocabularies/jtd/type.js b/node_modules/ajv/dist/vocabularies/jtd/type.js
index 428bddb..fbc3070 100644
--- a/node_modules/ajv/dist/vocabularies/jtd/type.js
+++ b/node_modules/ajv/dist/vocabularies/jtd/type.js
@@ -45,6 +45,9 @@ const def = {
cond = timestampCode(cxt);
break;
}
+ case "bigint":
+ cond = codegen_1._`typeof ${data} == "bigint" || typeof ${data} == "string"`
+ break
case "float32":
case "float64":
cond = codegen_1._ `typeof ${data} == "number"`;
-107
View File
@@ -1,107 +0,0 @@
import express, { Request, Response, Application } from "express";
import fs from "fs";
import path from "path";
import fetch, { Response as FetchResponse } from "node-fetch";
import ProxyAgent from 'proxy-agent';
import { Config } from "@fosscord/util";
export default function TestClient(app: Application) {
const agent = new ProxyAgent();
const assetCache = new Map<string, { response: FetchResponse; buffer: Buffer }>();
const indexHTML = fs.readFileSync(path.join(__dirname, "..", "..", "client_test", "index.html"), { encoding: "utf8" });
var html = indexHTML;
const CDN_ENDPOINT = (Config.get().cdn.endpointClient || Config.get()?.cdn.endpointPublic || process.env.CDN || "").replace(
/(https?)?(:\/\/?)/g,
""
);
const GATEWAY_ENDPOINT = Config.get().gateway.endpointClient || Config.get()?.gateway.endpointPublic || process.env.GATEWAY || "";
if (CDN_ENDPOINT) {
html = html.replace(/CDN_HOST: .+/, `CDN_HOST: \`${CDN_ENDPOINT}\`,`);
}
if (GATEWAY_ENDPOINT) {
html = html.replace(/GATEWAY_ENDPOINT: .+/, `GATEWAY_ENDPOINT: \`${GATEWAY_ENDPOINT}\`,`);
}
// inline plugins
var files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "preload-plugins"));
var plugins = "";
files.forEach(x =>{if(x.endsWith(".js")) plugins += `<script>${fs.readFileSync(path.join(__dirname, "..", "..", "assets", "preload-plugins", x))}</script>\n`; });
html = html.replaceAll("<!-- preload plugin marker -->", plugins);
// plugins
files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "plugins"));
plugins = "";
files.forEach(x =>{if(x.endsWith(".js")) plugins += `<script src='/assets/plugins/${x}'></script>\n`; });
html = html.replaceAll("<!-- plugin marker -->", plugins);
//preload plugins
files = fs.readdirSync(path.join(__dirname, "..", "..", "assets", "preload-plugins"));
plugins = "";
files.forEach(x =>{if(x.endsWith(".js")) plugins += `<script>${fs.readFileSync(path.join(__dirname, "..", "..", "assets", "preload-plugins", x))}</script>\n`; });
html = html.replaceAll("<!-- preload plugin marker -->", plugins);
app.use("/assets", express.static(path.join(__dirname, "..", "..", "assets")));
app.get("/assets/:file", async (req: Request, res: Response) => {
delete req.headers.host;
var response: FetchResponse;
var buffer: Buffer;
const cache = assetCache.get(req.params.file);
if (!cache) {
response = await fetch(`https://discord.com/assets/${req.params.file}`, {
agent,
// @ts-ignore
headers: {
...req.headers
}
});
buffer = await response.buffer();
} else {
response = cache.response;
buffer = cache.buffer;
}
response.headers.forEach((value, name) => {
if (
[
"content-length",
"content-security-policy",
"strict-transport-security",
"set-cookie",
"transfer-encoding",
"expect-ct",
"access-control-allow-origin",
"content-encoding"
].includes(name.toLowerCase())
) {
return;
}
res.set(name, value);
});
assetCache.set(req.params.file, { buffer, response });
return res.send(buffer);
});
app.get("/developers*", (req: Request, res: Response) => {
const { useTestClient } = Config.get().client;
res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
res.set("content-type", "text/html");
if(!useTestClient) return res.send("Test client is disabled on this instance. Use a stand-alone client to connect this instance.")
res.send(fs.readFileSync(path.join(__dirname, "..", "..", "client_test", "developers.html"), { encoding: "utf8" }));
});
app.get("*", (req: Request, res: Response) => {
const { useTestClient } = Config.get().client;
res.set("Cache-Control", "public, max-age=" + 60 * 60 * 24);
res.set("content-type", "text/html");
if(req.url.startsWith("/api") || req.url.startsWith("/__development")) return;
if(!useTestClient) return res.send("Test client is disabled on this instance. Use a stand-alone client to connect this instance.")
if (req.url.startsWith("/invite")) return res.send(html.replace("9b2b7f0632acd0c5e781", "9f24f709a3de09b67c49"));
res.send(html);
});
}
-13
View File
@@ -1,13 +0,0 @@
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { getIpAdress, IPAnalysis } from "@fosscord/api";
const router = Router();
router.get("/",route({}), async (req: Request, res: Response) => {
//TODO
//Note: It's most likely related to legal. At the moment Discord hasn't finished this too
const country_code = (await IPAnalysis(getIpAdress(req))).country_code;
res.json({ consent_required: false, country_code: country_code, promotional_email_opt_in: { required: true, pre_checked: false}});
});
export default router;
@@ -1,72 +0,0 @@
import { Router, Request, Response } from "express";
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { random } from "@fosscord/api";
import { Channel, Invite, InviteCreateEvent, emitEvent, User, Guild, PublicInviteRelation } from "@fosscord/util";
import { isTextChannel } from "./messages";
const router: Router = Router();
export interface InviteCreateSchema {
target_user_id?: string;
target_type?: string;
validate?: string; // ? what is this
max_age?: number;
max_uses?: number;
temporary?: boolean;
unique?: boolean;
target_user?: string;
target_user_type?: number;
}
router.post("/", route({ body: "InviteCreateSchema", permission: "CREATE_INSTANT_INVITE", right: "CREATE_INVITES" }),
async (req: Request, res: Response) => {
const { user_id } = req;
const { channel_id } = req.params;
const channel = await Channel.findOneOrFail({ where: { id: channel_id }, select: ["id", "name", "type", "guild_id"] });
isTextChannel(channel.type);
if (!channel.guild_id) {
throw new HTTPError("This channel doesn't exist", 404);
}
const { guild_id } = channel;
const expires_at = new Date(req.body.max_age * 1000 + Date.now());
const invite = await new Invite({
code: random(),
temporary: req.body.temporary,
uses: 0,
max_uses: req.body.max_uses,
max_age: req.body.max_age,
expires_at,
created_at: new Date(),
guild_id,
channel_id: channel_id,
inviter_id: user_id
}).save();
const data = invite.toJSON();
data.inviter = await User.getPublicUser(req.user_id);
data.guild = await Guild.findOne({ id: guild_id });
data.channel = channel;
await emitEvent({ event: "INVITE_CREATE", data, guild_id } as InviteCreateEvent);
res.status(201).send(data);
});
router.get("/", route({ permission: "MANAGE_CHANNELS" }), async (req: Request, res: Response) => {
const { user_id } = req;
const { channel_id } = req.params;
const channel = await Channel.findOneOrFail({ id: channel_id });
if (!channel.guild_id) {
throw new HTTPError("This channel doesn't exist", 404);
}
const { guild_id } = channel;
const invites = await Invite.find({ where: { guild_id }, relations: PublicInviteRelation });
res.status(200).send(invites);
});
export default router;
@@ -1,84 +0,0 @@
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { isTextChannel } from "./messages";
import { FindManyOptions, Between, Not } from "typeorm";
import {
Attachment,
Channel,
Config,
Embed,
DiscordApiErrors,
emitEvent,
FosscordApiErrors,
getPermission,
getRights,
Message,
MessageDeleteBulkEvent,
Snowflake,
uploadFile
} from "@fosscord/util";
import { Router, Response, Request } from "express";
import multer from "multer";
import { handleMessage, postHandleMessage } from "@fosscord/api";
const router: Router = Router();
export default router;
export interface PurgeSchema {
before: string;
after: string
}
/**
TODO: apply the delete bit by bit to prevent client and database stress
**/
router.post("/", route({ /*body: "PurgeSchema",*/ }), async (req: Request, res: Response) => {
const { channel_id } = req.params;
const channel = await Channel.findOneOrFail({ id: channel_id });
if (!channel.guild_id) throw new HTTPError("Can't purge dm channels", 400);
isTextChannel(channel.type);
const rights = await getRights(req.user_id);
if (!rights.has("MANAGE_MESSAGES")) {
const permissions = await getPermission(req.user_id, channel.guild_id, channel_id);
permissions.hasThrow("MANAGE_MESSAGES");
permissions.hasThrow("MANAGE_CHANNELS");
}
const { before, after } = req.body as PurgeSchema;
// TODO: send the deletion event bite-by-bite to prevent client stress
var query: FindManyOptions<Message> & { where: { id?: any; }; } = {
order: { id: "ASC" },
// take: limit,
where: {
channel_id,
id: Between(after, before), // the right way around
author_id: rights.has("SELF_DELETE_MESSAGES") ? undefined : Not(req.user_id)
// if you lack the right of self-deletion, you can't delete your own messages, even in purges
},
relations: ["author", "webhook", "application", "mentions", "mention_roles", "mention_channels", "sticker_items", "attachments"]
};
const messages = await Message.find(query);
const endpoint = Config.get().cdn.endpointPublic;
if (messages.length == 0) {
res.sendStatus(304);
return;
}
await Message.delete(messages.map((x) => ({ id: x })));
await emitEvent({
event: "MESSAGE_DELETE_BULK",
channel_id,
data: { ids: messages.map(x => x.id), channel_id, guild_id: channel.guild_id }
} as MessageDeleteBulkEvent);
res.sendStatus(204);
});
-34
View File
@@ -1,34 +0,0 @@
import { Guild, Config } from "@fosscord/util";
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => {
const { offset, limit, categories } = req.query;
var showAllGuilds = Config.get().guild.discovery.showAllGuilds;
var configLimit = Config.get().guild.discovery.limit;
// ! this only works using SQL querys
// TODO: implement this with default typeorm query
// const guilds = await Guild.find({ where: { features: "DISCOVERABLE" } }); //, take: Math.abs(Number(limit)) });
let guilds;
if (categories == undefined) {
guilds = showAllGuilds
? await Guild.find({ take: Math.abs(Number(limit || configLimit)) })
: await Guild.find({ where: `"features" LIKE '%DISCOVERABLE%'`, take: Math.abs(Number(limit || configLimit)) });
} else {
guilds = showAllGuilds
? await Guild.find({ where: `"primary_category_id" = ${categories}`, take: Math.abs(Number(limit || configLimit)) })
: await Guild.find({
where: `"primary_category_id" = ${categories} AND "features" LIKE '%DISCOVERABLE%'`,
take: Math.abs(Number(limit || configLimit))
});
}
const total = guilds ? guilds.length : undefined;
res.send({ total: total, guilds: guilds, offset: Number(offset || Config.get().guild.discovery.offset), limit: Number(limit || configLimit) });
});
export default router;
-20
View File
@@ -1,20 +0,0 @@
import { Router, Response, Request } from "express";
import { route } from "@fosscord/api";
import { Release, Config } from "@fosscord/util";
const router = Router();
router.get("/:branch", route({}), async (req: Request, res: Response) => {
const { client } = Config.get();
const { branch } = req.params;
const { platform } = req.query;
//TODO
if(!platform || !["linux", "osx", "win"].includes(platform.toString())) return res.status(404)
const release = await Release.findOneOrFail({ name: client.releases.upstreamVersion });
res.redirect(release[`win_url`]);
});
export default router;
@@ -1,39 +0,0 @@
import { Guild, Config } from "@fosscord/util";
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => {
const { guild_id } = req.params;
// TODO:
// Load from database
// Admin control, but for now it allows anyone to be discoverable
res.send({
guild_id: guild_id,
safe_environment: true,
healthy: true,
health_score_pending: false,
size: true,
nsfw_properties: {},
protected: true,
sufficient: true,
sufficient_without_grace_period: true,
valid_rules_channel: true,
retention_healthy: true,
engagement_healthy: true,
age: true,
minimum_age: 0,
health_score: {
avg_nonnew_participators: 0,
avg_nonnew_communicators: 0,
num_intentful_joiners: 0,
perc_ret_w1_intentful: 0
},
minimum_size: 0
});
});
export default router;
@@ -1,12 +0,0 @@
import { Router, Response, Request } from "express";
import { Channel, ChannelUpdateEvent, getPermission, emitEvent } from "@fosscord/util";
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { ChannelModifySchema } from "../../channels/#channel_id";
const router = Router();
//TODO: implement integrations list
router.get("/", route({}), async (req: Request, res: Response) => {
res.json([]);
});
export default router;
@@ -1,12 +0,0 @@
import { Router, Response, Request } from "express";
import { Channel, ChannelUpdateEvent, getPermission, emitEvent } from "@fosscord/util";
import { HTTPError } from "lambert-server";
import { route } from "@fosscord/api";
import { ChannelModifySchema } from "../../channels/#channel_id";
const router = Router();
//TODO: implement webhooks
router.get("/", route({}), async (req: Request, res: Response) => {
res.json([]);
});
export default router;
@@ -1,40 +0,0 @@
import { Guild, Config } from "@fosscord/util";
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
const router = Router();
router.get("/", route({}), async (req: Request, res: Response) => {
const { guild_id } = req.params;
// TODO:
// Load from database
// Admin control, but for now it allows anyone to be discoverable
res.send({
guild_id: guild_id,
safe_environment: true,
healthy: true,
health_score_pending: false,
size: true,
nsfw_properties: {},
protected: true,
sufficient: true,
sufficient_without_grace_period: true,
valid_rules_channel: true,
retention_healthy: true,
engagement_healthy: true,
age: true,
minimum_age: 0,
health_score: {
avg_nonnew_participators: 0,
avg_nonnew_communicators: 0,
num_intentful_joiners: 0,
perc_ret_w1_intentful: 0
},
minimum_size: 0
});
});
export default router;
@@ -1,18 +0,0 @@
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
import { Config } from "@fosscord/util";
import { config } from "dotenv"
const router = Router();
router.get("/",route({}), async (req: Request, res: Response) => {
const { cdn, gateway } = Config.get();
const IdentityForm = {
cdn: cdn.endpointPublic || process.env.CDN || "http://localhost:3001",
gateway: gateway.endpointPublic || process.env.GATEWAY || "ws://localhost:3002"
};
res.json(IdentityForm);
});
export default router;
@@ -1,12 +0,0 @@
import { Router, Request, Response } from "express";
import { route } from "@fosscord/api";
const router = Router();
router.get("/scheduled-maintenances/upcoming.json",route({}), async (req: Request, res: Response) => {
res.json({
"page": {},
"scheduled_maintenances": {}
});
});
export default router;

Some files were not shown because too many files have changed in this diff Show More