mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-23 02:13:00 +00:00
Merge branch 'master' into pr/darkhpp/261-2
This commit is contained in:
commit
a687b489d7
139 files changed
+539
-4463
No files matched your search
Vendored
-1
@@ -1 +0,0 @@
|
||||
open_collective: fosscord
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
---
|
||||
name: "[Feature] "
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
-71
@@ -1,71 +0,0 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
# The branches below must be a subset of the branches above
|
||||
branches: [ master ]
|
||||
schedule:
|
||||
- cron: '25 10 * * 5'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'javascript' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
|
||||
# Learn more:
|
||||
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
# queries: ./path/to/local/query, your-org/your-repo/queries@main
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@v1
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
||||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
|
||||
# and modify them (or add more) to build your code if your project
|
||||
# uses a compiled language
|
||||
|
||||
#- run: |
|
||||
# make bootstrap
|
||||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v1
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
name: docker-publish
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
-
|
||||
name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
-
|
||||
name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
-
|
||||
name: Cache Docker layers
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
-
|
||||
name: Login to DockerHub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
-
|
||||
name: Build and push
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKERHUB_TAGS }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||
-
|
||||
# Hackfix to cleanup cache; replace after buildx 0.6 and BuildKit 0.9 are released
|
||||
# https://github.com/docker/build-push-action/pull/406#issuecomment-879184394
|
||||
name: Move cache fix
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
Vendored
-88
@@ -1,88 +0,0 @@
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
|
||||
|
||||
name: Publish Release
|
||||
|
||||
jobs:
|
||||
insiders-build:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows, macos, ubuntu]
|
||||
include:
|
||||
- os: windows
|
||||
build: npm run bundle:windows
|
||||
artifact: fosscord-api-windows.exe
|
||||
- os: macos
|
||||
build: npm run bundle:macos
|
||||
artifact: fosscord-api-macos.app.tgz
|
||||
- os: ubuntu
|
||||
build: npm run bundle:linux
|
||||
artifact: fosscord-api-linux.tgz
|
||||
runs-on: ${{ matrix.os }}-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
- run: npm install
|
||||
- run: npm run build
|
||||
- run: ${{ matrix.build }}
|
||||
- uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ matrix.artifact }}
|
||||
path: ${{ matrix.artifact }}
|
||||
|
||||
release:
|
||||
needs: [insiders-build]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Extract version
|
||||
id: extract_version
|
||||
uses: Saionaro/extract-package-version@v1.0.6
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: fosscord-api-windows-${{ github.sha }}.exe
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: fosscord-api-macos-${{ github.sha }}.app.tgz
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: fosscord-api-linux-${{ github.sha }}.tgz
|
||||
- uses: actions/create-release@v1
|
||||
id: create-release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: v${{ steps.extract_version.outputs.version }}
|
||||
release_name: Release ${{ steps.extract_version.outputs.version }}
|
||||
draft: false
|
||||
prerelease: true # TODO: change this to false
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: fosscord-api-windows-${{ github.sha }}.exe
|
||||
asset_name: fosscord-api-windows.exe
|
||||
asset_content_type: application/vnd.microsoft.portable-executable
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: fosscord-api-macos-${{ github.sha }}.app.tgz
|
||||
asset_name: fosscord-api-macos.app.tgz
|
||||
asset_content_type: application/gzip
|
||||
- uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: fosscord-api-linux-${{ github.sha }}.tgz
|
||||
asset_name: fosscord-api-linux.tgz
|
||||
asset_content_type: application/gzip
|
||||
Generated
BIN
Binary file not shown.
+3
-1
@@ -5,6 +5,8 @@
|
||||
"main": "dist/Server.js",
|
||||
"types": "dist/Server.d.ts",
|
||||
"scripts": {
|
||||
"link": "npm run build && npm link",
|
||||
"postinstall": "npm run --prefix ../util/ link && npm link @fosscord/util && npm run link",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"start": "npm run build && node dist/start",
|
||||
@@ -33,7 +35,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/fosscord/fosscord-api#readme",
|
||||
"dependencies": {
|
||||
"@fosscord/server-util": "file:../util",
|
||||
"@fosscord/util": "file:../util",
|
||||
"@types/jest": "^26.0.22",
|
||||
"@types/json-schema": "^7.0.7",
|
||||
"ajv": "^8.4.0",
|
||||
|
||||
+4
-4
@@ -3,7 +3,7 @@ import fs from "fs";
|
||||
import { Connection } from "mongoose";
|
||||
import { Server, ServerOptions } from "lambert-server";
|
||||
import { Authentication, CORS } from "./middlewares/";
|
||||
import { Config, db, RabbitMQ } from "@fosscord/server-util";
|
||||
import { Config, db, initEvent, RabbitMQ } from "@fosscord/util";
|
||||
import i18next from "i18next";
|
||||
import i18nextMiddleware, { I18next } from "i18next-http-middleware";
|
||||
import i18nextBackend from "i18next-node-fs-backend";
|
||||
@@ -56,9 +56,8 @@ export class FosscordServer extends Server {
|
||||
// @ts-ignore
|
||||
await (db as Promise<Connection>);
|
||||
await this.setupSchema();
|
||||
console.log("[Database] connected");
|
||||
await Config.init();
|
||||
await RabbitMQ.init();
|
||||
await initEvent();
|
||||
|
||||
this.app.use(CORS);
|
||||
this.app.use(Authentication);
|
||||
@@ -93,11 +92,12 @@ export class FosscordServer extends Server {
|
||||
app.use("/api/v9", api);
|
||||
app.use("/api", api); // allow unversioned requests
|
||||
|
||||
api.get("*", (req: Request, res: Response) => {
|
||||
api.get("*", (req: Request, res: Response, next) => {
|
||||
res.status(404).json({
|
||||
message: "404: Not Found",
|
||||
code: 0
|
||||
});
|
||||
next();
|
||||
});
|
||||
|
||||
this.app = app;
|
||||
|
||||
@@ -7,9 +7,7 @@ export * from "./schema/Invite";
|
||||
export * from "./schema/Message";
|
||||
export * from "./util/Config";
|
||||
export * from "./util/Constants";
|
||||
export * from "./util/Event";
|
||||
export * from "./util/instanceOf";
|
||||
export * from "./util/Event";
|
||||
export * from "./util/instanceOf";
|
||||
export * from "./util/Member";
|
||||
export * from "./util/RandomInviteID";
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { NextFunction, Request, Response } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { checkToken, Config } from "@fosscord/server-util";
|
||||
import { checkToken, Config } from "@fosscord/util";
|
||||
|
||||
export const NO_AUTHORIZATION_ROUTES = [
|
||||
/^\/api(\/v\d+)?\/auth\/login/,
|
||||
/^\/api(\/v\d+)?\/auth\/register/,
|
||||
/^\/api(\/v\d+)?\/webhooks\//,
|
||||
/^\/api(\/v\d+)?\/ping/,
|
||||
/^\/api(\/v\d+)?\/gateway/,
|
||||
/^\/api(\/v\d+)?\/experiments/,
|
||||
/^\/api(\/v\d+)?\/guilds\/\d+\/widget\.(json|png)/
|
||||
"/auth/login",
|
||||
"/auth/register",
|
||||
"/webhooks/",
|
||||
"/ping",
|
||||
"/gateway",
|
||||
"/experiments"
|
||||
// /^\/api(\/v\d+)?\/guilds\/\d+\/widget\.(json|png)/
|
||||
];
|
||||
|
||||
export const API_PREFIX = /^\/api(\/v\d+)?/;
|
||||
@@ -24,13 +24,14 @@ declare global {
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO wenn client offen ist, wird http://localhost:8080/api/v9/users/@me/guild-events blockiert?
|
||||
|
||||
export async function Authentication(req: Request, res: Response, next: NextFunction) {
|
||||
if (req.method === "OPTIONS") return res.sendStatus(204);
|
||||
if (!req.url.startsWith("/api")) return next();
|
||||
const apiPath = req.url.replace(API_PREFIX, "");
|
||||
if (apiPath.startsWith("/invites") && req.method === "GET") return next();
|
||||
if (NO_AUTHORIZATION_ROUTES.some((x) => x.test(req.url))) return next();
|
||||
if (apiPath.startsWith("/invites") && req.method === "GET") return next(); // @ts-ignore
|
||||
if (NO_AUTHORIZATION_ROUTES.some((x) => apiPath.startsWith(x) || x.test?.(req.url))) return next();
|
||||
if (!req.headers.authorization) return next(new HTTPError("Missing Authorization Header", 401));
|
||||
|
||||
try {
|
||||
|
||||
@@ -25,8 +25,6 @@ export function ErrorHandler(error: Error, req: Request, res: Response, next: Ne
|
||||
if (httpcode > 511) httpcode = 400;
|
||||
|
||||
res.status(httpcode).json({ code: code, message, errors });
|
||||
|
||||
return;
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
return res.status(500).json({ code: 500, message: "Internal Server Error" });
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
import { db, MongooseCache, Bucket, Config } from "@fosscord/server-util";
|
||||
// @ts-nocheck
|
||||
import { db, Bucket, Config } from "@fosscord/util";
|
||||
import { NextFunction, Request, Response, Router } from "express";
|
||||
import { getIpAdress } from "../util/ipAddress";
|
||||
import { API_PREFIX_TRAILING_SLASH } from "./Authentication";
|
||||
|
||||
const Cache = new MongooseCache(
|
||||
db.collection("ratelimits"),
|
||||
[
|
||||
// TODO: uncomment $match and fix error: not receiving change events
|
||||
// { $match: { blocked: true } }
|
||||
],
|
||||
{ onlyEvents: false, array: true }
|
||||
);
|
||||
// const Cache = new MongooseCache(
|
||||
// db.collection("ratelimits"),
|
||||
// [
|
||||
// // TODO: uncomment $match and fix error: not receiving change events
|
||||
// // { $match: { blocked: true } }
|
||||
// ],
|
||||
// { onlyEvents: false, array: true }
|
||||
// );
|
||||
|
||||
// Docs: https://discord.com/developers/docs/topics/rate-limits
|
||||
|
||||
@@ -31,6 +32,7 @@ TODO: use config values
|
||||
|
||||
*/
|
||||
|
||||
// TODO: FIX with new event handling
|
||||
export default function RateLimit(opts: {
|
||||
bucket?: string;
|
||||
window: number;
|
||||
@@ -44,6 +46,7 @@ export default function RateLimit(opts: {
|
||||
success?: boolean;
|
||||
onlyIp?: boolean;
|
||||
}): any {
|
||||
return (req, res, next) => next();
|
||||
Cache.init(); // will only initalize it once
|
||||
|
||||
return async (req: Request, res: Response, next: NextFunction): Promise<any> => {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { HTTPError } from "lambert-server";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import fetch, { Response as FetchResponse } from "node-fetch";
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { Config } from "@fosscord/util";
|
||||
|
||||
export default function TestClient(app: Application) {
|
||||
const assetCache = new Map<string, { response: FetchResponse; buffer: Buffer }>();
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Request, Response, Router } from "express";
|
||||
import { check, FieldErrors, Length } from "../../util/instanceOf";
|
||||
import bcrypt from "bcrypt";
|
||||
import jwt from "jsonwebtoken";
|
||||
import { Config, UserModel } from "@fosscord/server-util";
|
||||
import { Config, UserModel } from "@fosscord/util";
|
||||
import { adjustEmail } from "./register";
|
||||
import RateLimit from "../../middlewares/RateLimit";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { trimSpecial, User, Snowflake, UserModel, Config } from "@fosscord/server-util";
|
||||
import { trimSpecial, User, Snowflake, UserModel, Config } from "@fosscord/util";
|
||||
import bcrypt from "bcrypt";
|
||||
import { check, Email, EMAIL_REGEX, FieldErrors, Length } from "../../util/instanceOf";
|
||||
import "missing-native-js-functions";
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { ChannelDeleteEvent, ChannelModel, ChannelUpdateEvent, getPermission, GuildUpdateEvent, toObject } from "@fosscord/server-util";
|
||||
import { ChannelDeleteEvent, ChannelModel, ChannelUpdateEvent, emitEvent, getPermission, GuildUpdateEvent, toObject } from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { ChannelModifySchema } from "../../../schema/Channel";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
import { check } from "../../../util/instanceOf";
|
||||
const router: Router = Router();
|
||||
// TODO: delete channel
|
||||
|
||||
@@ -3,11 +3,10 @@ import { HTTPError } from "lambert-server";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { random } from "../../../util/RandomInviteID";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { InviteCreateSchema } from "../../../schema/Invite";
|
||||
|
||||
import { getPermission, ChannelModel, InviteModel, InviteCreateEvent, toObject } from "@fosscord/server-util";
|
||||
import { getPermission, ChannelModel, InviteModel, InviteCreateEvent, toObject, emitEvent } from "@fosscord/util";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getPermission, MessageAckEvent, ReadStateModel } from "@fosscord/server-util";
|
||||
import { emitEvent, getPermission, MessageAckEvent, ReadStateModel } from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { emitEvent } from "../../../../../util/Event";
|
||||
|
||||
import { check } from "../../../../../util/instanceOf";
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ChannelModel, getPermission, MessageDeleteEvent, MessageModel, MessageUpdateEvent, toObject } from "@fosscord/server-util";
|
||||
import { ChannelModel, emitEvent, getPermission, MessageDeleteEvent, MessageModel, MessageUpdateEvent, toObject } from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { MessageCreateSchema } from "../../../../../schema/Message";
|
||||
import { emitEvent } from "../../../../../util/Event";
|
||||
|
||||
import { check } from "../../../../../util/instanceOf";
|
||||
import { handleMessage, postHandleMessage } from "../../../../../util/Message";
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
ChannelModel,
|
||||
emitEvent,
|
||||
EmojiModel,
|
||||
getPermission,
|
||||
MemberModel,
|
||||
@@ -12,10 +13,9 @@ import {
|
||||
PublicUserProjection,
|
||||
toObject,
|
||||
UserModel
|
||||
} from "@fosscord/server-util";
|
||||
} from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../../../util/Event";
|
||||
|
||||
const router = Router();
|
||||
// TODO: check if emoji is really an unicode emoji or a prperly encoded external emoji
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Router, Response, Request } from "express";
|
||||
import { ChannelModel, Config, getPermission, MessageDeleteBulkEvent, MessageModel } from "@fosscord/server-util";
|
||||
import { ChannelModel, Config, emitEvent, getPermission, MessageDeleteBulkEvent, MessageModel } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../../util/Event";
|
||||
|
||||
import { check } from "../../../../util/instanceOf";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Router, Response, Request } from "express";
|
||||
import { Attachment, ChannelModel, ChannelType, getPermission, MessageDocument, MessageModel, toObject } from "@fosscord/server-util";
|
||||
import { Attachment, ChannelModel, ChannelType, getPermission, MessageDocument, MessageModel, toObject } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { MessageCreateSchema } from "../../../../schema/Message";
|
||||
import { check, instanceOf, Length } from "../../../../util/instanceOf";
|
||||
|
||||
@@ -1,7 +1,15 @@
|
||||
import { ChannelModel, ChannelPermissionOverwrite, ChannelUpdateEvent, getPermission, MemberModel, RoleModel } from "@fosscord/server-util";
|
||||
import {
|
||||
ChannelModel,
|
||||
ChannelPermissionOverwrite,
|
||||
ChannelUpdateEvent,
|
||||
emitEvent,
|
||||
getPermission,
|
||||
MemberModel,
|
||||
RoleModel
|
||||
} from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
const router: Router = Router();
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@ import {
|
||||
ChannelModel,
|
||||
ChannelPinsUpdateEvent,
|
||||
Config,
|
||||
emitEvent,
|
||||
getPermission,
|
||||
MessageModel,
|
||||
MessageUpdateEvent,
|
||||
toObject
|
||||
} from "@fosscord/server-util";
|
||||
} from "@fosscord/util";
|
||||
import { Router, Request, Response } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { ChannelModel, MemberModel, toObject, TypingStartEvent } from "@fosscord/server-util";
|
||||
import { ChannelModel, emitEvent, MemberModel, toObject, TypingStartEvent } from "@fosscord/util";
|
||||
import { Router, Request, Response } from "express";
|
||||
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
const router: Router = Router();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Router, Response, Request } from "express";
|
||||
import { check, Length } from "../../../util/instanceOf";
|
||||
import { ChannelModel, getPermission, trimSpecial } from "@fosscord/server-util";
|
||||
import { ChannelModel, getPermission, trimSpecial } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { isTextChannel } from "./messages/index";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { Config } from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { BanModel, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, GuildModel, toObject } from "@fosscord/server-util";
|
||||
import { BanModel, emitEvent, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, GuildModel, toObject } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { getIpAdress } from "../../../util/ipAddress";
|
||||
import { BanCreateSchema } from "../../../schema/Ban";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { removeMember } from "../../../util/Member";
|
||||
import { getPublicUser } from "../../../util/User";
|
||||
|
||||
@@ -8,11 +8,12 @@ import {
|
||||
toObject,
|
||||
ChannelUpdateEvent,
|
||||
AnyChannel,
|
||||
getPermission
|
||||
} from "@fosscord/server-util";
|
||||
getPermission,
|
||||
emitEvent
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { ChannelModifySchema } from "../../../schema/Channel";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { createChannel } from "../../../util/Channel";
|
||||
const router = Router();
|
||||
@@ -64,7 +65,7 @@ router.patch(
|
||||
|
||||
const channel = await ChannelModel.findOneAndUpdate({ id: req.body, guild_id }, opts).exec();
|
||||
|
||||
await emitEvent({ event: "CHANNEL_UPDATE", data: channel, channel_id: body.id, guild_id } as ChannelUpdateEvent);
|
||||
await emitEvent({ event: "CHANNEL_UPDATE", data: toObject(channel), channel_id: body.id, guild_id } as ChannelUpdateEvent);
|
||||
|
||||
res.json(toObject(channel));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {
|
||||
ChannelModel,
|
||||
emitEvent,
|
||||
EmojiModel,
|
||||
GuildDeleteEvent,
|
||||
GuildModel,
|
||||
@@ -8,10 +9,9 @@ import {
|
||||
MessageModel,
|
||||
RoleModel,
|
||||
UserModel
|
||||
} from "@fosscord/server-util";
|
||||
} from "@fosscord/util";
|
||||
import { Router, Request, Response } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
const router = Router();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import {
|
||||
ChannelModel,
|
||||
emitEvent,
|
||||
EmojiModel,
|
||||
getPermission,
|
||||
GuildDeleteEvent,
|
||||
@@ -12,10 +13,10 @@ import {
|
||||
RoleModel,
|
||||
toObject,
|
||||
UserModel
|
||||
} from "@fosscord/server-util";
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { GuildUpdateSchema } from "../../../schema/Guild";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { handleFile } from "../../../util/cdn";
|
||||
import "missing-native-js-functions";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPermission, InviteModel, toObject } from "@fosscord/server-util";
|
||||
import { getPermission, InviteModel, toObject } from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -8,13 +8,13 @@ import {
|
||||
getPermission,
|
||||
PermissionResolvable,
|
||||
RoleModel,
|
||||
GuildMemberUpdateEvent
|
||||
} from "@fosscord/server-util";
|
||||
GuildMemberUpdateEvent,
|
||||
emitEvent
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { addMember, isMember, removeMember } from "../../../../../util/Member";
|
||||
import { check } from "../../../../../util/instanceOf";
|
||||
import { MemberChangeSchema } from "../../../../../schema/Member";
|
||||
import { emitEvent } from "../../../../../util/Event";
|
||||
|
||||
const router = Router();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPermission, PermissionResolvable } from "@fosscord/server-util";
|
||||
import { getPermission, PermissionResolvable } from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { check } from "lambert-server";
|
||||
import { MemberNickChangeSchema } from "../../../../../schema/Member";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPermission } from "@fosscord/server-util";
|
||||
import { getPermission } from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
import { addRole, removeRole } from "../../../../../../../util/Member";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { GuildModel, MemberModel, toObject } from "@fosscord/server-util";
|
||||
import { GuildModel, MemberModel, toObject } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { instanceOf, Length } from "../../../../util/instanceOf";
|
||||
import { PublicMemberProjection, isMember } from "../../../../util/Member";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { Config } from "@fosscord/util";
|
||||
import { Request, Response, Router } from "express";
|
||||
|
||||
const router = Router();
|
||||
@@ -7,4 +7,4 @@ router.get("/", async (req: Request, res: Response) => {
|
||||
return res.json(Config.get().regions.available);
|
||||
});
|
||||
|
||||
export default router;
|
||||
export default router;
|
||||
@@ -9,10 +9,11 @@ import {
|
||||
MemberModel,
|
||||
GuildRoleCreateEvent,
|
||||
GuildRoleUpdateEvent,
|
||||
GuildRoleDeleteEvent
|
||||
} from "@fosscord/server-util";
|
||||
GuildRoleDeleteEvent,
|
||||
emitEvent
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { RoleModifySchema } from "../../../schema/Roles";
|
||||
import { getPublicUser } from "../../../util/User";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { TemplateModel, GuildModel, getPermission, toObject, UserModel, Snowflake } from "@fosscord/server-util";
|
||||
import { TemplateModel, GuildModel, getPermission, toObject, UserModel, Snowflake } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { TemplateCreateSchema, TemplateModifySchema } from "../../../schema/Template";
|
||||
import { check } from "../../../util/instanceOf";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { getPermission, GuildModel, InviteModel, trimSpecial } from "@fosscord/server-util";
|
||||
import { getPermission, GuildModel, InviteModel, trimSpecial } from "@fosscord/util";
|
||||
import { Router, Request, Response } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { check, Length } from "../../../util/instanceOf";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { GuildModel, getPermission, toObject, Snowflake } from "@fosscord/server-util";
|
||||
import { GuildModel, getPermission, toObject, Snowflake } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { isMember } from "../../../util/Member";
|
||||
import { GuildAddChannelToWelcomeScreenSchema } from "../../../schema/Guild";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { Config, Permissions, GuildModel, InviteModel, ChannelModel, MemberModel } from "@fosscord/server-util";
|
||||
import { Config, Permissions, GuildModel, InviteModel, ChannelModel, MemberModel } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { random } from "../../../util/RandomInviteID";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { GuildModel } from "@fosscord/server-util";
|
||||
import { GuildModel } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
import { getPermission, GuildModel } from "@fosscord/server-util";
|
||||
import { getPermission, GuildModel } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { check } from "../../../util/instanceOf";
|
||||
import { WidgetModifySchema } from "../../../schema/Widget";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { RoleModel, GuildModel, Snowflake, Guild, RoleDocument, Config } from "@fosscord/server-util";
|
||||
import { RoleModel, GuildModel, Snowflake, Guild, RoleDocument, Config } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { check } from "./../../util/instanceOf";
|
||||
import { GuildCreateSchema } from "../../schema/Guild";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Request, Response, Router } from "express";
|
||||
const router: Router = Router();
|
||||
import { TemplateModel, GuildModel, toObject, UserModel, RoleModel, Snowflake, Guild, Config } from "@fosscord/server-util";
|
||||
import { TemplateModel, GuildModel, toObject, UserModel, RoleModel, Snowflake, Guild, Config } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { GuildTemplateCreateSchema } from "../../../schema/Guild";
|
||||
import { getPublicUser } from "../../../util/User";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { getPermission, InviteModel, toObject } from "@fosscord/server-util";
|
||||
import { getPermission, InviteModel, toObject } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { addMember } from "../../util/Member";
|
||||
const router: Router = Router();
|
||||
|
||||
@@ -8,10 +8,11 @@ import {
|
||||
trimSpecial,
|
||||
Channel,
|
||||
DMChannel,
|
||||
UserModel
|
||||
} from "@fosscord/server-util";
|
||||
UserModel,
|
||||
emitEvent
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { DmChannelCreateSchema } from "../../../schema/Channel";
|
||||
import { check } from "../../../util/instanceOf";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { GuildModel, MemberModel, UserModel } from "@fosscord/server-util";
|
||||
import { GuildModel, MemberModel, UserModel } from "@fosscord/util";
|
||||
import bcrypt from "bcrypt";
|
||||
const router = Router();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { UserModel } from "@fosscord/server-util";
|
||||
import { UserModel } from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
import bcrypt from "bcrypt";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { GuildModel, MemberModel, UserModel, GuildDeleteEvent, GuildMemberRemoveEvent, toObject } from "@fosscord/server-util";
|
||||
import { GuildModel, MemberModel, UserModel, GuildDeleteEvent, GuildMemberRemoveEvent, toObject, emitEvent } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { getPublicUser } from "../../../util/User";
|
||||
|
||||
const router: Router = Router();
|
||||
@@ -32,10 +32,10 @@ router.delete("/:id", async (req: Request, res: Response) => {
|
||||
emitEvent({
|
||||
event: "GUILD_DELETE",
|
||||
data: {
|
||||
id: guild_id,
|
||||
id: guild_id
|
||||
},
|
||||
user_id: req.user_id,
|
||||
} as GuildDeleteEvent),
|
||||
user_id: req.user_id
|
||||
} as GuildDeleteEvent)
|
||||
]);
|
||||
|
||||
const user = await getPublicUser(req.user_id);
|
||||
@@ -44,9 +44,9 @@ router.delete("/:id", async (req: Request, res: Response) => {
|
||||
event: "GUILD_MEMBER_REMOVE",
|
||||
data: {
|
||||
guild_id: guild_id,
|
||||
user: user,
|
||||
user: user
|
||||
},
|
||||
guild_id: guild_id,
|
||||
guild_id: guild_id
|
||||
} as GuildMemberRemoveEvent);
|
||||
|
||||
return res.sendStatus(204);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Router, Request, Response } from "express";
|
||||
import { UserModel, toObject, PublicUserProjection } from "@fosscord/server-util";
|
||||
import { UserModel, toObject, PublicUserProjection } from "@fosscord/util";
|
||||
import { getPublicUser } from "../../../util/User";
|
||||
import { UserModifySchema } from "../../../schema/User";
|
||||
import { check } from "../../../util/instanceOf";
|
||||
|
||||
@@ -5,11 +5,12 @@ import {
|
||||
toObject,
|
||||
RelationshipType,
|
||||
RelationshipRemoveEvent,
|
||||
UserDocument
|
||||
} from "@fosscord/server-util";
|
||||
UserDocument,
|
||||
emitEvent
|
||||
} from "@fosscord/util";
|
||||
import { Router, Response, Request } from "express";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "../../../util/Event";
|
||||
|
||||
import { check, Length } from "../../../util/instanceOf";
|
||||
|
||||
const router = Router();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChannelType } from "@fosscord/server-util";
|
||||
import { ChannelType } from "@fosscord/util";
|
||||
import { Length } from "../util/instanceOf";
|
||||
|
||||
export const ChannelModifySchema = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ChannelSchema, GuildChannel } from "@fosscord/server-util";
|
||||
import { ChannelSchema, GuildChannel } from "@fosscord/util";
|
||||
import { Length } from "../util/instanceOf";
|
||||
|
||||
export const GuildCreateSchema = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Embed, EmbedImage } from "@fosscord/server-util";
|
||||
import { Embed, EmbedImage } from "@fosscord/util";
|
||||
import { Length } from "../util/instanceOf";
|
||||
|
||||
export const MessageCreateSchema = {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
import { Snowflake } from "@fosscord/server-util";
|
||||
import { Snowflake } from "@fosscord/util";
|
||||
|
||||
console.log(Snowflake.deconstruct("0"));
|
||||
@@ -2,18 +2,18 @@ import {
|
||||
ChannelCreateEvent,
|
||||
ChannelModel,
|
||||
ChannelType,
|
||||
emitEvent,
|
||||
getPermission,
|
||||
GuildModel,
|
||||
Snowflake,
|
||||
TextChannel,
|
||||
toObject,
|
||||
VoiceChannel
|
||||
} from "@fosscord/server-util";
|
||||
} from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "./Event";
|
||||
|
||||
// TODO: DM channel
|
||||
export async function createChannel(channel: Partial<TextChannel | VoiceChannel>, user_id: string = "0") {
|
||||
|
||||
// Always check if user has permission first
|
||||
const permissions = await getPermission(user_id, channel.guild_id);
|
||||
permissions.hasThrow("MANAGE_CHANNELS");
|
||||
@@ -50,7 +50,7 @@ export async function createChannel(channel: Partial<TextChannel | VoiceChannel>
|
||||
recipient_ids: null
|
||||
}).save();
|
||||
|
||||
await emitEvent({ event: "CHANNEL_CREATE", data: channel, guild_id: channel.guild_id } as ChannelCreateEvent);
|
||||
await emitEvent({ event: "CHANNEL_CREATE", data: toObject(channel), guild_id: channel.guild_id } as ChannelCreateEvent);
|
||||
|
||||
return channel;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import Ajv, { JSONSchemaType } from "ajv";
|
||||
import { getConfigPathForFile } from "@fosscord/server-util/dist/util/Config";
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { getConfigPathForFile } from "@fosscord/util/dist/util/Config";
|
||||
import { Config } from "@fosscord/util";
|
||||
|
||||
export interface RateLimitOptions {
|
||||
count: number;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
import { Config, Event, EventModel, RabbitMQ } from "@fosscord/server-util";
|
||||
|
||||
export async function emitEvent(payload: Omit<Event, "created_at">) {
|
||||
if (RabbitMQ.connection) {
|
||||
const id = (payload.channel_id || payload.user_id || payload.guild_id) as string;
|
||||
if (!id) console.error("event doesn't contain any id", payload);
|
||||
const data = typeof payload.data === "object" ? JSON.stringify(payload.data) : payload.data; // use rabbitmq for event transmission
|
||||
await RabbitMQ.channel?.assertExchange(id, "fanout", { durable: false });
|
||||
|
||||
// assertQueue isn't needed, because a queue will automatically created if it doesn't exist
|
||||
const successful = RabbitMQ.channel?.publish(id, "", Buffer.from(`${data}`), { type: payload.event });
|
||||
if (!successful) throw new Error("failed to send event");
|
||||
} else {
|
||||
// use mongodb for event transmission
|
||||
// TODO: use event emitter for local server bundle
|
||||
const obj = {
|
||||
created_at: new Date(), // in seconds
|
||||
...payload
|
||||
};
|
||||
// TODO: bigint isn't working
|
||||
|
||||
return await new EventModel(obj).save();
|
||||
}
|
||||
}
|
||||
|
||||
export async function emitAuditLog(payload: any) {}
|
||||
@@ -11,11 +11,12 @@ import {
|
||||
toObject,
|
||||
UserModel,
|
||||
GuildDocument,
|
||||
Config
|
||||
} from "@fosscord/server-util";
|
||||
Config,
|
||||
emitEvent
|
||||
} from "@fosscord/util";
|
||||
|
||||
import { HTTPError } from "lambert-server";
|
||||
import { emitEvent } from "./Event";
|
||||
|
||||
import { getPublicUser } from "./User";
|
||||
|
||||
export const PublicMemberProjection = {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { ChannelModel, Embed, Message, MessageCreateEvent, MessageUpdateEvent } from "@fosscord/server-util";
|
||||
import { Snowflake } from "@fosscord/server-util";
|
||||
import { MessageModel } from "@fosscord/server-util";
|
||||
import { PublicMemberProjection } from "@fosscord/server-util";
|
||||
import { toObject } from "@fosscord/server-util";
|
||||
import { getPermission } from "@fosscord/server-util";
|
||||
import { ChannelModel, Embed, emitEvent, Message, MessageCreateEvent, MessageUpdateEvent } from "@fosscord/util";
|
||||
import { Snowflake } from "@fosscord/util";
|
||||
import { MessageModel } from "@fosscord/util";
|
||||
import { PublicMemberProjection } from "@fosscord/util";
|
||||
import { toObject } from "@fosscord/util";
|
||||
import { getPermission } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import fetch from "node-fetch";
|
||||
import cheerio from "cheerio";
|
||||
import { emitEvent } from "./Event";
|
||||
import { MessageType } from "@fosscord/server-util/dist/util/Constants";
|
||||
|
||||
import { MessageType } from "@fosscord/util/dist/util/Constants";
|
||||
// TODO: check webhook, application, system author
|
||||
|
||||
const LINK_REGEX = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/g;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { toObject, UserModel, PublicUserProjection } from "@fosscord/server-util";
|
||||
import { toObject, UserModel, PublicUserProjection } from "@fosscord/util";
|
||||
import { HTTPError } from "lambert-server";
|
||||
|
||||
export { PublicUserProjection };
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { Config } from "@fosscord/util";
|
||||
import FormData from "form-data";
|
||||
import { HTTPError } from "lambert-server";
|
||||
import fetch from "node-fetch";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { Config } from "@fosscord/util";
|
||||
import { Request } from "express";
|
||||
// use ipdata package instead of simple fetch because of integrated caching
|
||||
import fetch from "node-fetch";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config } from "@fosscord/server-util";
|
||||
import { Config } from "@fosscord/util";
|
||||
import "missing-native-js-functions";
|
||||
|
||||
const reNUMBER = /[0-9]/g;
|
||||
|
||||
Reference in new issue
Block a user