Reorganise schemas a little bit
This commit is contained in:
parent
0da7169b00
commit
e52c237326
90
.idea/workspace.xml
generated
90
.idea/workspace.xml
generated
@ -16,6 +16,14 @@
|
|||||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
</component>
|
</component>
|
||||||
|
<component name="FileTemplateManagerImpl">
|
||||||
|
<option name="RECENT_TEMPLATES">
|
||||||
|
<list>
|
||||||
|
<option value="TypeScript File" />
|
||||||
|
<option value="JavaScript File" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
<component name="Git.Settings">
|
<component name="Git.Settings">
|
||||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
@ -39,53 +47,57 @@
|
|||||||
<option name="hideEmptyMiddlePackages" value="true" />
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
<option name="showLibraryContents" value="true" />
|
<option name="showLibraryContents" value="true" />
|
||||||
</component>
|
</component>
|
||||||
<component name="PropertiesComponent">{
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
"keyToString": {
|
"keyToString": {
|
||||||
"NIXITCH_NIXPKGS_CONFIG": "/etc/nix/nixpkgs-config.nix",
|
"NIXITCH_NIXPKGS_CONFIG": "/etc/nix/nixpkgs-config.nix",
|
||||||
"NIXITCH_NIX_CONF_DIR": "",
|
"NIXITCH_NIX_CONF_DIR": "",
|
||||||
"NIXITCH_NIX_OTHER_STORES": "",
|
"NIXITCH_NIX_OTHER_STORES": "",
|
||||||
"NIXITCH_NIX_PATH": "/home/Rory/.nix-defexpr/channels:nixpkgs=/nix/store/wb6agba4kfsxpbnb5hzlq58vkjzvbsk6-source",
|
"NIXITCH_NIX_PATH": "/home/Rory/.nix-defexpr/channels:nixpkgs=/nix/store/wb6agba4kfsxpbnb5hzlq58vkjzvbsk6-source",
|
||||||
"NIXITCH_NIX_PROFILES": "/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/Rory /home/Rory/.local/state/nix/profile /nix/profile /home/Rory/.nix-profile",
|
"NIXITCH_NIX_PROFILES": "/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/Rory /home/Rory/.local/state/nix/profile /nix/profile /home/Rory/.nix-profile",
|
||||||
"NIXITCH_NIX_REMOTE": "",
|
"NIXITCH_NIX_REMOTE": "",
|
||||||
"NIXITCH_NIX_USER_PROFILE_DIR": "/nix/var/nix/profiles/per-user/Rory",
|
"NIXITCH_NIX_USER_PROFILE_DIR": "/nix/var/nix/profiles/per-user/Rory",
|
||||||
"Node.js.Server.ts.executor": "Debug",
|
"Node.js.Server.ts.executor": "Debug",
|
||||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
"RunOnceActivity.git.unshallow": "true",
|
"RunOnceActivity.git.unshallow": "true",
|
||||||
"javascript.nodejs.core.library.configured.version": "24.8.0",
|
"javascript.nodejs.core.library.configured.version": "24.8.0",
|
||||||
"javascript.nodejs.core.library.typings.version": "24.7.0",
|
"javascript.nodejs.core.library.typings.version": "24.7.0",
|
||||||
"last_opened_file_path": "/home/Rory/git/spacebar/server/src/admin-api/routes/v0",
|
"last_opened_file_path": "/home/Rory/git/spacebar/server-master/src/schemas",
|
||||||
"node.js.detected.package.eslint": "true",
|
"node.js.detected.package.eslint": "true",
|
||||||
"node.js.selected.package.eslint": "(autodetect)",
|
"node.js.selected.package.eslint": "(autodetect)",
|
||||||
"node.js.selected.package.tslint": "(autodetect)",
|
"node.js.selected.package.tslint": "(autodetect)",
|
||||||
"nodejs_interpreter_path": "node",
|
"nodejs_interpreter_path": "node",
|
||||||
"nodejs_package_manager_path": "npm",
|
"nodejs_package_manager_path": "npm",
|
||||||
"npm.Start API.executor": "Run",
|
"npm.Start API.executor": "Run",
|
||||||
"npm.Start CDN.executor": "Run",
|
"npm.Start CDN.executor": "Run",
|
||||||
"npm.Start Gateway.executor": "Run",
|
"npm.Start Gateway.executor": "Run",
|
||||||
"npm.build.executor": "Run",
|
"npm.build.executor": "Run",
|
||||||
"npm.start.executor": "Debug",
|
"npm.start.executor": "Debug",
|
||||||
"prettierjs.PrettierConfiguration.Package": "/home/Rory/git/spacebar/server/node_modules/prettier",
|
"prettierjs.PrettierConfiguration.Package": "/home/Rory/git/spacebar/server-master/node_modules/prettier",
|
||||||
"settings.editor.selected.configurable": "preferences.pluginManager",
|
"settings.editor.selected.configurable": "preferences.pluginManager",
|
||||||
"ts.external.directory.path": "/home/Rory/git/spacebar/server-master/node_modules/typescript/lib"
|
"ts.external.directory.path": "/home/Rory/git/spacebar/server-master/node_modules/typescript/lib"
|
||||||
},
|
},
|
||||||
"keyToStringList": {
|
"keyToStringList": {
|
||||||
"GitStage.ChangesTree.GroupingKeys": [
|
"GitStage.ChangesTree.GroupingKeys": [
|
||||||
"directory",
|
"directory",
|
||||||
"module",
|
"module",
|
||||||
"repository"
|
"repository"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}</component>
|
}]]></component>
|
||||||
<component name="RecentsManager">
|
<component name="RecentsManager">
|
||||||
<key name="CopyFile.RECENT_KEYS">
|
<key name="CopyFile.RECENT_KEYS">
|
||||||
|
<recent name="$PROJECT_DIR$/src/schemas" />
|
||||||
|
<recent name="$PROJECT_DIR$/src/schemas/api/users" />
|
||||||
|
<recent name="$PROJECT_DIR$/src/schemas/api/messages" />
|
||||||
<recent name="$PROJECT_DIR$/src/admin-api/routes/v0" />
|
<recent name="$PROJECT_DIR$/src/admin-api/routes/v0" />
|
||||||
<recent name="$PROJECT_DIR$/src" />
|
<recent name="$PROJECT_DIR$/src" />
|
||||||
<recent name="$PROJECT_DIR$/src/api/routes/channels/#channel_id/messages" />
|
|
||||||
</key>
|
</key>
|
||||||
<key name="MoveFile.RECENT_KEYS">
|
<key name="MoveFile.RECENT_KEYS">
|
||||||
<recent name="$PROJECT_DIR$/src" />
|
<recent name="$PROJECT_DIR$/src/schemas" />
|
||||||
<recent name="$PROJECT_DIR$/src/api/routes/store/published-listings/applications/#application_id" />
|
<recent name="$PROJECT_DIR$/src/schemas/uncategorised" />
|
||||||
<recent name="$PROJECT_DIR$/src/api/routes/store/published-listings/skus/#sku_id" />
|
<recent name="$PROJECT_DIR$/src/schemas/gateway" />
|
||||||
|
<recent name="$PROJECT_DIR$/src/schemas/api/developers" />
|
||||||
|
<recent name="$PROJECT_DIR$/src/schemas/webrtc" />
|
||||||
</key>
|
</key>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunDashboard">
|
<component name="RunDashboard">
|
||||||
@ -132,7 +144,7 @@
|
|||||||
<workItem from="1735848116134" duration="80763000" />
|
<workItem from="1735848116134" duration="80763000" />
|
||||||
<workItem from="1759868659577" duration="8847000" />
|
<workItem from="1759868659577" duration="8847000" />
|
||||||
<workItem from="1760044946282" duration="43683000" />
|
<workItem from="1760044946282" duration="43683000" />
|
||||||
<workItem from="1760402350251" duration="18740000" />
|
<workItem from="1760402350251" duration="40134000" />
|
||||||
</task>
|
</task>
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -5,10 +5,10 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "husky install",
|
"prepare": "husky install",
|
||||||
"postinstall": "npx patch-package",
|
"postinstall": "npx patch-package",
|
||||||
"start": "node dist/bundle/start.js",
|
"start": "node --enable-source-maps dist/bundle/start.js",
|
||||||
"start:api": "node dist/api/start.js",
|
"start:api": "node --enable-source-maps dist/api/start.js",
|
||||||
"start:cdn": "node dist/cdn/start.js",
|
"start:cdn": "node --enable-source-maps dist/cdn/start.js",
|
||||||
"start:gateway": "node dist/gateway/start.js",
|
"start:gateway": "node --enable-source-maps dist/gateway/start.js",
|
||||||
"build": "npm run build:src && npm run generate:schema && npm run generate:openapi",
|
"build": "npm run build:src && npm run generate:schema && npm run generate:openapi",
|
||||||
"build:src": "tsc -b -v",
|
"build:src": "tsc -b -v",
|
||||||
"watch": "tsc -w -b .",
|
"watch": "tsc -w -b .",
|
||||||
|
|||||||
69
scripts/genIndex.js
Normal file
69
scripts/genIndex.js
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
/*
|
||||||
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
|
Copyright (C) 2025 Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
let content = `/*
|
||||||
|
Spacebar: A FOSS re-implementation and extension of the Discord.com backend.
|
||||||
|
Copyright (C) ${new Date().getFullYear()} Spacebar and Spacebar Contributors
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
`;
|
||||||
|
|
||||||
|
// node scripts/genIndex.js /path/to/dir
|
||||||
|
const targetDir = process.argv[2];
|
||||||
|
if (!targetDir) {
|
||||||
|
console.error("Please provide a target directory.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fs.existsSync(path.join(targetDir, "index.js")) || fs.existsSync(path.join(targetDir, "index.ts"))) {
|
||||||
|
console.error("index.js or index.ts already exists in the target directory.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dirs = fs.readdirSync(targetDir).filter(f => fs.statSync(path.join(targetDir, f)).isDirectory());
|
||||||
|
for (const dir of dirs) {
|
||||||
|
content += `export * from "./${dir}";\n`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const files = fs.readdirSync(targetDir).filter(f => f.endsWith(".js") || f.endsWith(".ts"));
|
||||||
|
for (const file of files) {
|
||||||
|
const filePath = path.join(targetDir, file);
|
||||||
|
const stat = fs.statSync(filePath);
|
||||||
|
if (stat.isFile()) {
|
||||||
|
const ext = path.extname(file);
|
||||||
|
const base = path.basename(file, ext);
|
||||||
|
content += `export * from "./${base}";\n`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(path.join(targetDir, "index.ts"), content);
|
||||||
@ -19,7 +19,6 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Application,
|
Application,
|
||||||
BotModifySchema,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
User,
|
User,
|
||||||
createAppBotUser,
|
createAppBotUser,
|
||||||
@ -29,6 +28,7 @@ import {
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
|
import { BotModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,6 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Application,
|
Application,
|
||||||
ApplicationModifySchema,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
Guild,
|
Guild,
|
||||||
handleFile,
|
handleFile,
|
||||||
@ -27,6 +26,7 @@ import {
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
|
import { ApplicationModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -19,13 +19,13 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Application,
|
Application,
|
||||||
ApplicationCreateSchema,
|
|
||||||
Config,
|
Config,
|
||||||
User,
|
User,
|
||||||
createAppBotUser,
|
createAppBotUser,
|
||||||
trimSpecial,
|
trimSpecial,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ApplicationCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,11 +18,11 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
RefreshUrlsRequestSchema,
|
|
||||||
getUrlSignature,
|
getUrlSignature,
|
||||||
NewUrlSignatureData,
|
NewUrlSignatureData,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { RefreshUrlsRequestSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
|
import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
|
||||||
import { Config, Email, ForgotPasswordSchema, User } from "@spacebar/util";
|
import { Config, Email, User } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ForgotPasswordSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import { getIpAdress, route, verifyCaptcha } from "@spacebar/api";
|
|||||||
import {
|
import {
|
||||||
Config,
|
Config,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
LoginSchema,
|
|
||||||
User,
|
User,
|
||||||
WebAuthn,
|
WebAuthn,
|
||||||
generateToken,
|
generateToken,
|
||||||
@ -29,6 +28,7 @@ import {
|
|||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { LoginSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
export default router;
|
export default router;
|
||||||
@ -47,8 +47,7 @@ router.post(
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
async (req: Request, res: Response) => {
|
async (req: Request, res: Response) => {
|
||||||
const { login, password, captcha_key, undelete } =
|
const { login, password, captcha_key, undelete } = req.body as LoginSchema;
|
||||||
req.body as LoginSchema;
|
|
||||||
|
|
||||||
const config = Config.get();
|
const config = Config.get();
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { BackupCode, TotpSchema, User, generateToken } from "@spacebar/util";
|
import { BackupCode, User, generateToken } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
|
import { TotpSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@ -23,11 +23,11 @@ import {
|
|||||||
User,
|
User,
|
||||||
verifyWebAuthnToken,
|
verifyWebAuthnToken,
|
||||||
WebAuthn,
|
WebAuthn,
|
||||||
WebAuthnTotpSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { ExpectedAssertionResult } from "fido2-lib";
|
import { ExpectedAssertionResult } from "fido2-lib";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { WebAuthnTotpSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
function toArrayBuffer(buf: Buffer) {
|
function toArrayBuffer(buf: Buffer) {
|
||||||
|
|||||||
@ -27,7 +27,6 @@ import {
|
|||||||
Config,
|
Config,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
Invite,
|
Invite,
|
||||||
RegisterSchema,
|
|
||||||
User,
|
User,
|
||||||
ValidRegistrationToken,
|
ValidRegistrationToken,
|
||||||
generateToken,
|
generateToken,
|
||||||
@ -36,6 +35,7 @@ import bcrypt from "bcrypt";
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { MoreThan } from "typeorm";
|
import { MoreThan } from "typeorm";
|
||||||
|
import { RegisterSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -22,11 +22,11 @@ import {
|
|||||||
Email,
|
Email,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
generateToken,
|
generateToken,
|
||||||
PasswordResetSchema,
|
|
||||||
User,
|
User,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { PasswordResetSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,9 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { BackupCodesChallengeSchema, FieldErrors, User } from "@spacebar/util";
|
import { FieldErrors, User } from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { BackupCodesChallengeSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@ -21,13 +21,12 @@ import {
|
|||||||
Channel,
|
Channel,
|
||||||
Config,
|
Config,
|
||||||
Permissions,
|
Permissions,
|
||||||
UploadAttachmentRequestSchema,
|
|
||||||
UploadAttachmentResponseSchema,
|
|
||||||
User,
|
User,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { CloudAttachment } from "../../../../util/entities/CloudAttachment";
|
import { CloudAttachment } from "@spacebar/util";
|
||||||
import fetch from "node-fetch-commonjs";
|
import fetch from "node-fetch-commonjs";
|
||||||
|
import { UploadAttachmentRequestSchema, UploadAttachmentResponseSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { HubDirectoryEntriesResponse } from "@spacebar/util";
|
import { HubDirectoryEntriesResponse } from "@spacebar/schemas";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,9 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Channel, emitEvent, GreetRequestSchema, Message, MessageCreateEvent, MessageType, Permissions, Sticker } from "@spacebar/util";
|
import { Channel, emitEvent, Message, MessageCreateEvent, Permissions, Sticker } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { In } from "typeorm";
|
import { In } from "typeorm";
|
||||||
|
import { GreetRequestSchema, MessageType } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import { route } from "@spacebar/api";
|
|||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
ChannelDeleteEvent,
|
ChannelDeleteEvent,
|
||||||
ChannelModifySchema,
|
|
||||||
ChannelType,
|
ChannelType,
|
||||||
ChannelUpdateEvent,
|
ChannelUpdateEvent,
|
||||||
Recipient,
|
Recipient,
|
||||||
@ -28,6 +27,7 @@ import {
|
|||||||
handleFile,
|
handleFile,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ChannelModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
// TODO: delete channel
|
// TODO: delete channel
|
||||||
|
|||||||
@ -17,9 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { randomString, route } from "@spacebar/api";
|
import { randomString, route } from "@spacebar/api";
|
||||||
import { Channel, Guild, Invite, InviteCreateEvent, InviteCreateSchema, PublicInviteRelation, User, emitEvent, isTextChannel } from "@spacebar/util";
|
import { Channel, Guild, Invite, InviteCreateEvent, PublicInviteRelation, User, emitEvent, isTextChannel } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { InviteCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,7 @@ import {
|
|||||||
Channel,
|
Channel,
|
||||||
Message,
|
Message,
|
||||||
MessageCreateEvent,
|
MessageCreateEvent,
|
||||||
MessageCreateSchema,
|
|
||||||
MessageDeleteEvent,
|
MessageDeleteEvent,
|
||||||
MessageEditSchema,
|
|
||||||
MessageUpdateEvent,
|
MessageUpdateEvent,
|
||||||
Snowflake,
|
Snowflake,
|
||||||
SpacebarApiErrors,
|
SpacebarApiErrors,
|
||||||
@ -32,13 +30,12 @@ import {
|
|||||||
getRights,
|
getRights,
|
||||||
uploadFile,
|
uploadFile,
|
||||||
NewUrlUserSignatureData,
|
NewUrlUserSignatureData,
|
||||||
MessageCreateAttachment,
|
|
||||||
MessageCreateCloudAttachment,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import { handleMessage, postHandleMessage, route } from "../../../../../util";
|
import { handleMessage, postHandleMessage, route } from "../../../../../util";
|
||||||
|
import { MessageCreateAttachment, MessageCreateCloudAttachment, MessageCreateSchema, MessageEditSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
// TODO: message content/embed string length limit
|
// TODO: message content/embed string length limit
|
||||||
|
|||||||
@ -28,7 +28,6 @@ import {
|
|||||||
MessageReactionRemoveAllEvent,
|
MessageReactionRemoveAllEvent,
|
||||||
MessageReactionRemoveEmojiEvent,
|
MessageReactionRemoveEmojiEvent,
|
||||||
MessageReactionRemoveEvent,
|
MessageReactionRemoveEvent,
|
||||||
PartialEmoji,
|
|
||||||
PublicMemberProjection,
|
PublicMemberProjection,
|
||||||
PublicUserProjection,
|
PublicUserProjection,
|
||||||
User,
|
User,
|
||||||
@ -36,9 +35,10 @@ import {
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { In } from "typeorm";
|
import { In } from "typeorm";
|
||||||
|
import { PartialEmoji } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
// TODO: check if emoji is really an unicode emoji or a prperly encoded external emoji
|
// TODO: check if emoji is really an unicode emoji or a properly encoded external emoji
|
||||||
|
|
||||||
function getEmoji(emoji: string): PartialEmoji {
|
function getEmoji(emoji: string): PartialEmoji {
|
||||||
emoji = decodeURIComponent(emoji);
|
emoji = decodeURIComponent(emoji);
|
||||||
|
|||||||
@ -26,8 +26,6 @@ import {
|
|||||||
Member,
|
Member,
|
||||||
Message,
|
Message,
|
||||||
MessageCreateEvent,
|
MessageCreateEvent,
|
||||||
MessageCreateSchema,
|
|
||||||
Reaction,
|
|
||||||
ReadState,
|
ReadState,
|
||||||
Rights,
|
Rights,
|
||||||
Snowflake,
|
Snowflake,
|
||||||
@ -39,14 +37,13 @@ import {
|
|||||||
uploadFile,
|
uploadFile,
|
||||||
NewUrlSignatureData,
|
NewUrlSignatureData,
|
||||||
NewUrlUserSignatureData,
|
NewUrlUserSignatureData,
|
||||||
MessageCreateCloudAttachment,
|
|
||||||
MessageCreateAttachment,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import { FindManyOptions, FindOperator, LessThan, MoreThan, MoreThanOrEqual } from "typeorm";
|
import { FindManyOptions, FindOperator, LessThan, MoreThan, MoreThanOrEqual } from "typeorm";
|
||||||
import { URL } from "url";
|
import { URL } from "url";
|
||||||
|
import { MessageCreateAttachment, MessageCreateCloudAttachment, MessageCreateSchema, Reaction } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -16,11 +16,12 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Channel, ChannelPermissionOverwrite, ChannelPermissionOverwriteSchema, ChannelPermissionOverwriteType, ChannelUpdateEvent, emitEvent, Member, Role } from "@spacebar/util";
|
import { Channel, ChannelPermissionOverwrite, ChannelPermissionOverwriteType, ChannelUpdateEvent, emitEvent, Member, Role } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
|
import { ChannelPermissionOverwriteSchema } from "@spacebar/schemas"
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
|
// TODO: Only permissions your bot has in the guild or channel can be allowed/denied (unless your bot has a MANAGE_ROLES overwrite in the channel)
|
||||||
|
|||||||
@ -21,7 +21,6 @@ import {
|
|||||||
Channel,
|
Channel,
|
||||||
Message,
|
Message,
|
||||||
MessageDeleteBulkEvent,
|
MessageDeleteBulkEvent,
|
||||||
PurgeSchema,
|
|
||||||
emitEvent,
|
emitEvent,
|
||||||
getPermission,
|
getPermission,
|
||||||
getRights,
|
getRights,
|
||||||
@ -30,6 +29,7 @@ import {
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { Between, FindManyOptions, FindOperator, Not } from "typeorm";
|
import { Between, FindManyOptions, FindOperator, Not } from "typeorm";
|
||||||
|
import { PurgeSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import {
|
|||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
User,
|
User,
|
||||||
Webhook,
|
Webhook,
|
||||||
WebhookCreateSchema,
|
|
||||||
WebhookType,
|
WebhookType,
|
||||||
handleFile,
|
handleFile,
|
||||||
isTextChannel,
|
isTextChannel,
|
||||||
@ -33,6 +32,7 @@ import {
|
|||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { WebhookCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Config, PreloadMessagesRequestSchema, Message, PreloadMessagesResponseSchema } from "@spacebar/util";
|
import { Config, Message } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { PreloadMessagesRequestSchema, PreloadMessagesResponseSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { CollectiblesCategoriesResponse } from "@spacebar/util";
|
import { CollectiblesCategoriesResponse } from "@spacebar/schemas";
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { CollectiblesShopResponse } from "@spacebar/util";
|
import { CollectiblesShopResponse } from "@spacebar/schemas";
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,12 +18,12 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionStore,
|
ConnectionStore,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -19,14 +19,12 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Emoji,
|
Emoji,
|
||||||
APIErrorResponse,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
EmojiSourceResponse,
|
|
||||||
Guild,
|
Guild,
|
||||||
Member,
|
Member,
|
||||||
EmojiGuild,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { APIErrorResponse, EmojiGuild, EmojiSourceResponse } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,15 +18,14 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
TenorMediaTypes,
|
|
||||||
getGifApiKey,
|
getGifApiKey,
|
||||||
parseGifResult,
|
parseGifResult,
|
||||||
TenorGif,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import fetch from "node-fetch-commonjs";
|
import fetch from "node-fetch-commonjs";
|
||||||
import { ProxyAgent } from "proxy-agent";
|
import { ProxyAgent } from "proxy-agent";
|
||||||
import http from "http";
|
import http from "http";
|
||||||
|
import { TenorGif, TenorMediaTypes } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,15 +18,14 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
TenorMediaTypes,
|
|
||||||
getGifApiKey,
|
getGifApiKey,
|
||||||
parseGifResult,
|
parseGifResult,
|
||||||
TenorGif,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import fetch from "node-fetch-commonjs";
|
import fetch from "node-fetch-commonjs";
|
||||||
import { ProxyAgent } from "proxy-agent";
|
import { ProxyAgent } from "proxy-agent";
|
||||||
import http from "http";
|
import http from "http";
|
||||||
|
import { TenorGif, TenorMediaTypes } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
TenorCategoriesResults,
|
|
||||||
TenorTrendingResults,
|
|
||||||
getGifApiKey,
|
getGifApiKey,
|
||||||
parseGifResult,
|
parseGifResult,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
@ -27,6 +25,7 @@ import { Request, Response, Router } from "express";
|
|||||||
import fetch from "node-fetch-commonjs";
|
import fetch from "node-fetch-commonjs";
|
||||||
import { ProxyAgent } from "proxy-agent";
|
import { ProxyAgent } from "proxy-agent";
|
||||||
import http from "http";
|
import http from "http";
|
||||||
|
import { TenorCategoriesResults, TenorTrendingResults } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,9 +17,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { User, AutomodRuleSchema, AutomodRule } from "@spacebar/util";
|
import { User, AutomodRule } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { AutomodRuleSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,19 +18,17 @@
|
|||||||
|
|
||||||
import { getIpAdress, route } from "@spacebar/api";
|
import { getIpAdress, route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
APIBansArray,
|
|
||||||
Ban,
|
Ban,
|
||||||
BanRegistrySchema,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
GuildBanAddEvent,
|
GuildBanAddEvent,
|
||||||
GuildBanRemoveEvent,
|
GuildBanRemoveEvent,
|
||||||
GuildBansResponse,
|
|
||||||
Member,
|
Member,
|
||||||
User,
|
User,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { APIBansArray, BanRegistrySchema, GuildBansResponse } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -19,13 +19,12 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
ChannelModifySchema,
|
|
||||||
ChannelReorderSchema,
|
|
||||||
ChannelUpdateEvent,
|
ChannelUpdateEvent,
|
||||||
Guild,
|
Guild,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ChannelModifySchema, ChannelReorderSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
|
|||||||
@ -21,8 +21,6 @@ import {
|
|||||||
Config,
|
Config,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
Emoji,
|
Emoji,
|
||||||
EmojiCreateSchema,
|
|
||||||
EmojiModifySchema,
|
|
||||||
GuildEmojisUpdateEvent,
|
GuildEmojisUpdateEvent,
|
||||||
Member,
|
Member,
|
||||||
Snowflake,
|
Snowflake,
|
||||||
@ -31,6 +29,7 @@ import {
|
|||||||
handleFile,
|
handleFile,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { EmojiCreateSchema, EmojiModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -22,7 +22,6 @@ import {
|
|||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
Guild,
|
Guild,
|
||||||
GuildUpdateEvent,
|
GuildUpdateEvent,
|
||||||
GuildUpdateSchema,
|
|
||||||
Member,
|
Member,
|
||||||
Permissions,
|
Permissions,
|
||||||
SpacebarApiErrors,
|
SpacebarApiErrors,
|
||||||
@ -33,6 +32,7 @@ import {
|
|||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { GuildUpdateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -27,13 +27,13 @@ import {
|
|||||||
GuildMemberUpdateEvent,
|
GuildMemberUpdateEvent,
|
||||||
handleFile,
|
handleFile,
|
||||||
Member,
|
Member,
|
||||||
MemberChangeSchema,
|
|
||||||
PublicMemberProjection,
|
PublicMemberProjection,
|
||||||
PublicUserProjection,
|
PublicUserProjection,
|
||||||
Role,
|
Role,
|
||||||
Sticker,
|
Sticker,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { MemberChangeSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Guild, GuildProfileResponse, GuildVisibilityLevel } from "@spacebar/util";
|
import { Guild } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { GuildProfileResponse, GuildVisibilityLevel } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -22,10 +22,10 @@ import {
|
|||||||
GuildMemberUpdateEvent,
|
GuildMemberUpdateEvent,
|
||||||
handleFile,
|
handleFile,
|
||||||
Member,
|
Member,
|
||||||
MemberChangeProfileSchema,
|
|
||||||
OrmUtils,
|
OrmUtils,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { MemberChangeProfileSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -24,10 +24,10 @@ import {
|
|||||||
handleFile,
|
handleFile,
|
||||||
Member,
|
Member,
|
||||||
Role,
|
Role,
|
||||||
RoleModifySchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { RoleModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -25,12 +25,11 @@ import {
|
|||||||
GuildRoleUpdateEvent,
|
GuildRoleUpdateEvent,
|
||||||
Member,
|
Member,
|
||||||
Role,
|
Role,
|
||||||
RoleModifySchema,
|
|
||||||
RolePositionUpdateSchema,
|
|
||||||
Snowflake,
|
Snowflake,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { Not } from "typeorm";
|
import { Not } from "typeorm";
|
||||||
|
import { RoleModifySchema, RolePositionUpdateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import { route } from "@spacebar/api";
|
|||||||
import {
|
import {
|
||||||
GuildStickersUpdateEvent,
|
GuildStickersUpdateEvent,
|
||||||
Member,
|
Member,
|
||||||
ModifyGuildStickerSchema,
|
|
||||||
Snowflake,
|
Snowflake,
|
||||||
Sticker,
|
Sticker,
|
||||||
StickerFormatType,
|
StickerFormatType,
|
||||||
@ -33,6 +32,7 @@ import {
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
|
import { ModifyGuildStickerSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
|
|||||||
@ -22,10 +22,10 @@ import {
|
|||||||
ChannelType,
|
ChannelType,
|
||||||
Guild,
|
Guild,
|
||||||
Invite,
|
Invite,
|
||||||
VanityUrlSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { VanityUrlSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -25,9 +25,9 @@ import {
|
|||||||
getPermission,
|
getPermission,
|
||||||
VoiceState,
|
VoiceState,
|
||||||
VoiceStateUpdateEvent,
|
VoiceStateUpdateEvent,
|
||||||
VoiceStateUpdateSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { VoiceStateUpdateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
//TODO need more testing when community guild and voice stage channel are working
|
//TODO need more testing when community guild and voice stage channel are working
|
||||||
|
|||||||
@ -20,10 +20,10 @@ import { route } from "@spacebar/api";
|
|||||||
import {
|
import {
|
||||||
Channel,
|
Channel,
|
||||||
Guild,
|
Guild,
|
||||||
GuildUpdateWelcomeScreenSchema,
|
|
||||||
Member,
|
Member,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { GuildUpdateWelcomeScreenSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Guild, WidgetModifySchema } from "@spacebar/util";
|
import { Guild } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { WidgetModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,14 +18,12 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
EmailDomainLookupResponse,
|
|
||||||
EmailDomainLookupSchema,
|
|
||||||
EmailDomainLookupVerifyCodeSchema,
|
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import emailProviders from "email-providers/all.json";
|
import emailProviders from "email-providers/all.json";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { EmailDomainLookupResponse, EmailDomainLookupSchema, EmailDomainLookupVerifyCodeSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,11 @@ import {
|
|||||||
Config,
|
Config,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
Guild,
|
Guild,
|
||||||
GuildCreateSchema,
|
|
||||||
Member,
|
Member,
|
||||||
getRights,
|
getRights,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { GuildCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,10 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Config, DiscordApiErrors, Guild, GuildTemplateCreateSchema, Member, Template } from "@spacebar/util";
|
import { Config, DiscordApiErrors, Guild, Member, Template } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import fetch from "node-fetch-commonjs";
|
import fetch from "node-fetch-commonjs";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { GuildTemplateCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import { route } from "@spacebar/api";
|
|||||||
import {
|
import {
|
||||||
HubWaitlistSignupResponse,
|
HubWaitlistSignupResponse,
|
||||||
HubWaitlistSignupSchema,
|
HubWaitlistSignupSchema,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/schemas";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -20,7 +20,6 @@ import { route } from "@spacebar/api";
|
|||||||
import {
|
import {
|
||||||
ApiError,
|
ApiError,
|
||||||
Application,
|
Application,
|
||||||
ApplicationAuthorizeSchema,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
Member,
|
Member,
|
||||||
@ -29,6 +28,7 @@ import {
|
|||||||
getPermission,
|
getPermission,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ApplicationAuthorizeSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
// TODO: scopes, other oauth types
|
// TODO: scopes, other oauth types
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { AckBulkSchema, ReadState } from "@spacebar/util";
|
import { ReadState } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { AckBulkSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.post(
|
router.post(
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { CollectiblesCategoriesResponse } from "@spacebar/util";
|
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { AccountStandingResponse, AccountStandingState, AppealEligibility, User } from "@spacebar/util";
|
import { User } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { AccountStandingResponse, AccountStandingState, AppealEligibility } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { AccountStandingResponse, AccountStandingState, AppealEligibility, User } from "@spacebar/util";
|
import { User } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { AccountStandingResponse, AccountStandingState, AppealEligibility } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -20,13 +20,13 @@ import { Request, Response, Router } from "express";
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
Team,
|
Team,
|
||||||
TeamCreateSchema,
|
|
||||||
TeamMember,
|
TeamMember,
|
||||||
TeamMemberRole,
|
TeamMemberRole,
|
||||||
TeamMemberState,
|
TeamMemberState,
|
||||||
User,
|
User,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { TeamCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Config, DmMessagesResponseSchema, Message, User } from "@spacebar/util";
|
import { Config, Message, User } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { DmMessagesResponseSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
|
|||||||
@ -28,13 +28,12 @@ import {
|
|||||||
PublicUser,
|
PublicUser,
|
||||||
PublicUserProjection,
|
PublicUserProjection,
|
||||||
Relationship,
|
Relationship,
|
||||||
RelationshipType,
|
|
||||||
User,
|
User,
|
||||||
UserProfileModifySchema,
|
|
||||||
UserUpdateEvent,
|
UserUpdateEvent,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { In } from "typeorm";
|
import { In } from "typeorm";
|
||||||
|
import { RelationshipType, UserProfileModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { User, UserRelationsResponse } from "@spacebar/util";
|
import { User } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { UserRelationsResponse } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,13 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import { Channel, DmChannelDTO, Recipient } from "@spacebar/util";
|
||||||
Channel,
|
|
||||||
DmChannelCreateSchema,
|
|
||||||
DmChannelDTO,
|
|
||||||
Recipient,
|
|
||||||
} from "@spacebar/util";
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { DmChannelCreateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { CollectiblesMarketingResponse } from "@spacebar/util";
|
import { CollectiblesMarketingResponse } from "@spacebar/schemas";
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,13 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import { ConnectedAccount, DiscordApiErrors, emitEvent } from "@spacebar/util";
|
||||||
ConnectedAccount,
|
|
||||||
ConnectionUpdateSchema,
|
|
||||||
DiscordApiErrors,
|
|
||||||
emitEvent,
|
|
||||||
} from "@spacebar/util";
|
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { ConnectionUpdateSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
// TODO: connection update schema
|
// TODO: connection update schema
|
||||||
|
|||||||
@ -21,9 +21,9 @@ import {
|
|||||||
Channel,
|
Channel,
|
||||||
Member,
|
Member,
|
||||||
OrmUtils,
|
OrmUtils,
|
||||||
UserGuildSettingsSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { UserGuildSettingsSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -25,11 +25,11 @@ import {
|
|||||||
handleFile,
|
handleFile,
|
||||||
PrivateUserProjection,
|
PrivateUserProjection,
|
||||||
User,
|
User,
|
||||||
UserModifySchema,
|
|
||||||
UserUpdateEvent,
|
UserUpdateEvent,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { UserModifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -19,12 +19,12 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
BackupCode,
|
BackupCode,
|
||||||
CodesVerificationSchema,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
User,
|
User,
|
||||||
generateMfaBackupCodes,
|
generateMfaBackupCodes,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { CodesVerificationSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -21,11 +21,11 @@ import {
|
|||||||
BackupCode,
|
BackupCode,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
generateMfaBackupCodes,
|
generateMfaBackupCodes,
|
||||||
MfaCodesSchema,
|
|
||||||
User,
|
User,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { MfaCodesSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -19,13 +19,13 @@
|
|||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
BackupCode,
|
BackupCode,
|
||||||
TotpDisableSchema,
|
|
||||||
User,
|
User,
|
||||||
generateToken,
|
generateToken,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
|
import { TotpDisableSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
TotpEnableSchema,
|
|
||||||
User,
|
User,
|
||||||
generateMfaBackupCodes,
|
generateMfaBackupCodes,
|
||||||
generateToken,
|
generateToken,
|
||||||
@ -27,6 +26,7 @@ import bcrypt from "bcrypt";
|
|||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { verifyToken } from "node-2fa";
|
import { verifyToken } from "node-2fa";
|
||||||
|
import { TotpEnableSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -18,21 +18,19 @@
|
|||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import {
|
import {
|
||||||
CreateWebAuthnCredentialSchema,
|
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
FieldErrors,
|
FieldErrors,
|
||||||
GenerateWebAuthnCredentialsSchema,
|
|
||||||
generateWebAuthnTicket,
|
generateWebAuthnTicket,
|
||||||
SecurityKey,
|
SecurityKey,
|
||||||
User,
|
User,
|
||||||
verifyWebAuthnToken,
|
verifyWebAuthnToken,
|
||||||
WebAuthn,
|
WebAuthn,
|
||||||
WebAuthnPostSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import bcrypt from "bcrypt";
|
import bcrypt from "bcrypt";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { ExpectedAttestationResult } from "fido2-lib";
|
import { ExpectedAttestationResult } from "fido2-lib";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { CreateWebAuthnCredentialSchema, GenerateWebAuthnCredentialsSchema, WebAuthnPostSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
const isGenerateSchema = (
|
const isGenerateSchema = (
|
||||||
|
|||||||
@ -24,12 +24,12 @@ import {
|
|||||||
Relationship,
|
Relationship,
|
||||||
RelationshipAddEvent,
|
RelationshipAddEvent,
|
||||||
RelationshipRemoveEvent,
|
RelationshipRemoveEvent,
|
||||||
RelationshipType,
|
|
||||||
User,
|
User,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { RelationshipType } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -21,14 +21,11 @@ import { Request, Response, Router } from "express";
|
|||||||
import {
|
import {
|
||||||
emitEvent,
|
emitEvent,
|
||||||
OrmUtils,
|
OrmUtils,
|
||||||
SettingsProtoJsonResponse,
|
|
||||||
SettingsProtoResponse,
|
|
||||||
SettingsProtoUpdateJsonSchema,
|
|
||||||
SettingsProtoUpdateSchema,
|
|
||||||
UserSettingsProtos,
|
UserSettingsProtos,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { PreloadedUserSettings } from "discord-protos";
|
import { PreloadedUserSettings } from "discord-protos";
|
||||||
import { JsonValue } from "@protobuf-ts/runtime";
|
import { JsonValue } from "@protobuf-ts/runtime";
|
||||||
|
import { SettingsProtoJsonResponse, SettingsProtoResponse, SettingsProtoUpdateJsonSchema, SettingsProtoUpdateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -21,14 +21,11 @@ import { Request, Response, Router } from "express";
|
|||||||
import {
|
import {
|
||||||
emitEvent,
|
emitEvent,
|
||||||
OrmUtils,
|
OrmUtils,
|
||||||
SettingsProtoJsonResponse,
|
|
||||||
SettingsProtoResponse,
|
|
||||||
SettingsProtoUpdateJsonSchema,
|
|
||||||
SettingsProtoUpdateSchema,
|
|
||||||
UserSettingsProtos,
|
UserSettingsProtos,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { FrecencyUserSettings } from "discord-protos";
|
import { FrecencyUserSettings } from "discord-protos";
|
||||||
import { JsonValue } from "@protobuf-ts/runtime";
|
import { JsonValue } from "@protobuf-ts/runtime";
|
||||||
|
import { SettingsProtoJsonResponse, SettingsProtoResponse, SettingsProtoUpdateJsonSchema, SettingsProtoUpdateSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router: Router = Router({ mergeParams: true });
|
const router: Router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { route } from "@spacebar/api";
|
import { route } from "@spacebar/api";
|
||||||
import { User, UserSettings, UserSettingsSchema } from "@spacebar/util";
|
import { User, UserSettings } from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
|
import { UserSettingsSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ router.patch(
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (!user.settings)
|
if (!user.settings)
|
||||||
user.settings = UserSettings.create(body);
|
user.settings = UserSettings.create(body as Partial<UserSettings>);
|
||||||
else
|
else
|
||||||
user.settings.assign(body);
|
user.settings.assign(body);
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import { getProxyUrl, route } from "@spacebar/api";
|
import { getProxyUrl, route } from "@spacebar/api";
|
||||||
import { capitalize, EmbedType, WebhookExecuteSchema } from "@spacebar/util";
|
import { capitalize } from "@spacebar/util";
|
||||||
import { NextFunction, Request, Response, Router } from "express";
|
import { NextFunction, Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { executeWebhook } from "../../../../util/handlers/Webhook";
|
import { executeWebhook } from "../../../../util/handlers/Webhook";
|
||||||
|
import { EmbedType, WebhookExecuteSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
|
|||||||
@ -7,12 +7,12 @@ import {
|
|||||||
ValidateName,
|
ValidateName,
|
||||||
Webhook,
|
Webhook,
|
||||||
WebhooksUpdateEvent,
|
WebhooksUpdateEvent,
|
||||||
WebhookUpdateSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import { executeWebhook } from "../../../../util/handlers/Webhook";
|
import { executeWebhook } from "../../../../util/handlers/Webhook";
|
||||||
|
import { WebhookUpdateSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
|
|||||||
@ -6,13 +6,13 @@ import {
|
|||||||
Webhook,
|
Webhook,
|
||||||
WebhooksUpdateEvent,
|
WebhooksUpdateEvent,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
WebhookUpdateSchema,
|
|
||||||
Channel,
|
Channel,
|
||||||
handleFile,
|
handleFile,
|
||||||
ValidateName,
|
ValidateName,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response, Router } from "express";
|
import { Request, Response, Router } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
|
import { WebhookUpdateSchema } from "@spacebar/schemas"
|
||||||
const router = Router({ mergeParams: true });
|
const router = Router({ mergeParams: true });
|
||||||
|
|
||||||
router.get(
|
router.get(
|
||||||
|
|||||||
@ -22,7 +22,6 @@ import {
|
|||||||
Attachment,
|
Attachment,
|
||||||
Channel,
|
Channel,
|
||||||
Config,
|
Config,
|
||||||
Embed,
|
|
||||||
EmbedCache,
|
EmbedCache,
|
||||||
emitEvent,
|
emitEvent,
|
||||||
EVERYONE_MENTION,
|
EVERYONE_MENTION,
|
||||||
@ -32,8 +31,6 @@ import {
|
|||||||
HERE_MENTION,
|
HERE_MENTION,
|
||||||
Message,
|
Message,
|
||||||
MessageCreateEvent,
|
MessageCreateEvent,
|
||||||
MessageCreateSchema,
|
|
||||||
MessageType,
|
|
||||||
MessageUpdateEvent,
|
MessageUpdateEvent,
|
||||||
Role,
|
Role,
|
||||||
ROLE_MENTION,
|
ROLE_MENTION,
|
||||||
@ -45,14 +42,12 @@ import {
|
|||||||
handleFile,
|
handleFile,
|
||||||
Permissions,
|
Permissions,
|
||||||
normalizeUrl,
|
normalizeUrl,
|
||||||
Reaction,
|
|
||||||
MessageCreateCloudAttachment,
|
|
||||||
MessageCreateAttachment,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { In } from "typeorm";
|
import { In } from "typeorm";
|
||||||
import fetch from "node-fetch-commonjs";
|
import fetch from "node-fetch-commonjs";
|
||||||
import { CloudAttachment } from "../../../util/entities/CloudAttachment";
|
import { CloudAttachment } from "../../../util/entities/CloudAttachment";
|
||||||
|
import { Embed, MessageCreateAttachment, MessageCreateCloudAttachment, MessageCreateSchema, MessageType, Reaction } from "@spacebar/schemas";
|
||||||
const allow_empty = false;
|
const allow_empty = false;
|
||||||
// TODO: check webhook, application, system author, stickers
|
// TODO: check webhook, application, system author, stickers
|
||||||
// TODO: embed gifs/videos/images
|
// TODO: embed gifs/videos/images
|
||||||
|
|||||||
@ -10,11 +10,11 @@ import {
|
|||||||
uploadFile,
|
uploadFile,
|
||||||
ValidateName,
|
ValidateName,
|
||||||
Webhook,
|
Webhook,
|
||||||
WebhookExecuteSchema,
|
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { Request, Response } from "express";
|
import { Request, Response } from "express";
|
||||||
import { HTTPError } from "lambert-server";
|
import { HTTPError } from "lambert-server";
|
||||||
import { MoreThan } from "typeorm";
|
import { MoreThan } from "typeorm";
|
||||||
|
import { WebhookExecuteSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
export const executeWebhook = async (req: Request, res: Response) => {
|
export const executeWebhook = async (req: Request, res: Response) => {
|
||||||
const { wait } = req.query;
|
const { wait } = req.query;
|
||||||
|
|||||||
@ -25,12 +25,12 @@ import {
|
|||||||
RightResolvable,
|
RightResolvable,
|
||||||
Rights,
|
Rights,
|
||||||
SpacebarApiErrors,
|
SpacebarApiErrors,
|
||||||
ajv,
|
|
||||||
getPermission,
|
getPermission,
|
||||||
getRights,
|
getRights,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import { AnyValidateFunction } from "ajv/dist/core";
|
import { AnyValidateFunction } from "ajv/dist/core";
|
||||||
import { NextFunction, Request, Response } from "express";
|
import { NextFunction, Request, Response } from "express";
|
||||||
|
import { ajv } from "@spacebar/schemas"
|
||||||
|
|
||||||
const ignoredRequestSchemas = [
|
const ignoredRequestSchemas = [
|
||||||
// skip validation for settings proto JSON updates - TODO: figure out if this even possible to fix?
|
// skip validation for settings proto JSON updates - TODO: figure out if this even possible to fix?
|
||||||
|
|||||||
@ -16,7 +16,8 @@
|
|||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Config, Embed, EmbedImage, EmbedType } from "@spacebar/util";
|
import { Config }from "@spacebar/util";
|
||||||
|
import { Embed, EmbedImage, EmbedType } from "@spacebar/schemas";
|
||||||
import * as cheerio from "cheerio";
|
import * as cheerio from "cheerio";
|
||||||
import crypto from "crypto";
|
import crypto from "crypto";
|
||||||
import fetch, { RequestInit } from "node-fetch-commonjs";
|
import fetch, { RequestInit } from "node-fetch-commonjs";
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { BattleNetSettings } from "./BattleNetSettings";
|
import { BattleNetSettings } from "./BattleNetSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface BattleNetConnectionUser {
|
interface BattleNetConnectionUser {
|
||||||
sub: string;
|
sub: string;
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { DiscordSettings } from "./DiscordSettings";
|
import { DiscordSettings } from "./DiscordSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface UserResponse {
|
interface UserResponse {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { EpicGamesSettings } from "./EpicGamesSettings";
|
import { EpicGamesSettings } from "./EpicGamesSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
export interface UserResponse {
|
export interface UserResponse {
|
||||||
accountId: string;
|
accountId: string;
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { FacebookSettings } from "./FacebookSettings";
|
import { FacebookSettings } from "./FacebookSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
export interface FacebookErrorResponse {
|
export interface FacebookErrorResponse {
|
||||||
error: {
|
error: {
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { GitHubSettings } from "./GitHubSettings";
|
import { GitHubSettings } from "./GitHubSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface UserResponse {
|
interface UserResponse {
|
||||||
login: string;
|
login: string;
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { RedditSettings } from "./RedditSettings";
|
import { RedditSettings } from "./RedditSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
export interface UserResponse {
|
export interface UserResponse {
|
||||||
verified: boolean;
|
verified: boolean;
|
||||||
|
|||||||
@ -19,13 +19,13 @@
|
|||||||
import {
|
import {
|
||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
RefreshableConnection,
|
RefreshableConnection,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { SpotifySettings } from "./SpotifySettings";
|
import { SpotifySettings } from "./SpotifySettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
export interface UserResponse {
|
export interface UserResponse {
|
||||||
display_name: string;
|
display_name: string;
|
||||||
|
|||||||
@ -19,13 +19,13 @@
|
|||||||
import {
|
import {
|
||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
RefreshableConnection,
|
RefreshableConnection,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { TwitchSettings } from "./TwitchSettings";
|
import { TwitchSettings } from "./TwitchSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface TwitchConnectionUserResponse {
|
interface TwitchConnectionUserResponse {
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -19,13 +19,13 @@
|
|||||||
import {
|
import {
|
||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
RefreshableConnection,
|
RefreshableConnection,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { TwitterSettings } from "./TwitterSettings";
|
import { TwitterSettings } from "./TwitterSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface TwitterUserResponse {
|
interface TwitterUserResponse {
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { XboxSettings } from "./XboxSettings";
|
import { XboxSettings } from "./XboxSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface XboxUserResponse {
|
interface XboxUserResponse {
|
||||||
IssueInstant: string;
|
IssueInstant: string;
|
||||||
|
|||||||
@ -20,12 +20,12 @@ import {
|
|||||||
ConnectedAccount,
|
ConnectedAccount,
|
||||||
ConnectedAccountCommonOAuthTokenResponse,
|
ConnectedAccountCommonOAuthTokenResponse,
|
||||||
Connection,
|
Connection,
|
||||||
ConnectionCallbackSchema,
|
|
||||||
ConnectionLoader,
|
ConnectionLoader,
|
||||||
DiscordApiErrors,
|
DiscordApiErrors,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
import wretch from "wretch";
|
import wretch from "wretch";
|
||||||
import { YoutubeSettings } from "./YoutubeSettings";
|
import { YoutubeSettings } from "./YoutubeSettings";
|
||||||
|
import { ConnectionCallbackSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
interface YouTubeConnectionChannelListResult {
|
interface YouTubeConnectionChannelListResult {
|
||||||
items: {
|
items: {
|
||||||
|
|||||||
@ -17,13 +17,14 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { CLOSECODES, OPCODES, Payload, WebSocket } from "@spacebar/gateway";
|
import { CLOSECODES, OPCODES, Payload, WebSocket } from "@spacebar/gateway";
|
||||||
import { ErlpackType, PayloadSchema } from "@spacebar/util";
|
import { ErlpackType } from "@spacebar/util";
|
||||||
import fs from "fs/promises";
|
import fs from "fs/promises";
|
||||||
import BigIntJson from "json-bigint";
|
import BigIntJson from "json-bigint";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import WS from "ws";
|
import WS from "ws";
|
||||||
import OPCodeHandlers from "../opcodes";
|
import OPCodeHandlers from "../opcodes";
|
||||||
import { check } from "../opcodes/instanceOf";
|
import { check } from "../opcodes/instanceOf";
|
||||||
|
import { PayloadSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
const bigIntJson = BigIntJson({ storeAsString: true });
|
const bigIntJson = BigIntJson({ storeAsString: true });
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import {
|
|||||||
Member,
|
Member,
|
||||||
EVENTEnum,
|
EVENTEnum,
|
||||||
Relationship,
|
Relationship,
|
||||||
RelationshipType,
|
|
||||||
Message,
|
Message,
|
||||||
NewUrlUserSignatureData,
|
NewUrlUserSignatureData,
|
||||||
} from "@spacebar/util";
|
} from "@spacebar/util";
|
||||||
@ -36,6 +35,7 @@ import { WebSocket } from "@spacebar/gateway";
|
|||||||
import { Channel as AMQChannel } from "amqplib";
|
import { Channel as AMQChannel } from "amqplib";
|
||||||
import { Recipient } from "@spacebar/util";
|
import { Recipient } from "@spacebar/util";
|
||||||
import * as console from "node:console";
|
import * as console from "node:console";
|
||||||
|
import { RelationshipType } from "@spacebar/schemas"
|
||||||
|
|
||||||
// TODO: close connection on Invalidated Token
|
// TODO: close connection on Invalidated Token
|
||||||
// TODO: check intent
|
// TODO: check intent
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { WebSocket, Payload } from "@spacebar/gateway";
|
import { WebSocket, Payload } from "@spacebar/gateway";
|
||||||
import { onLazyRequest } from "./LazyRequest";
|
import { onLazyRequest } from "./LazyRequest";
|
||||||
import { GuildSubscriptionsBulkSchema } from "@spacebar/util";
|
import { GuildSubscriptionsBulkSchema } from "@spacebar/schemas";
|
||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
|
|
||||||
export async function onGuildSubscriptionsBulk(
|
export async function onGuildSubscriptionsBulk(
|
||||||
|
|||||||
@ -25,7 +25,6 @@ import {
|
|||||||
EVENTEnum,
|
EVENTEnum,
|
||||||
Guild,
|
Guild,
|
||||||
GuildOrUnavailable,
|
GuildOrUnavailable,
|
||||||
IdentifySchema,
|
|
||||||
Intents,
|
Intents,
|
||||||
Member,
|
Member,
|
||||||
MemberPrivateProjection,
|
MemberPrivateProjection,
|
||||||
@ -60,6 +59,7 @@ import {
|
|||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
import { In } from "typeorm";
|
import { In } from "typeorm";
|
||||||
import { PreloadedUserSettings } from "discord-protos";
|
import { PreloadedUserSettings } from "discord-protos";
|
||||||
|
import { IdentifySchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
// TODO: user sharding
|
// TODO: user sharding
|
||||||
// TODO: check privileged intents, if defined in the config
|
// TODO: check privileged intents, if defined in the config
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import {
|
|||||||
Member,
|
Member,
|
||||||
Role,
|
Role,
|
||||||
Session,
|
Session,
|
||||||
LazyRequestSchema,
|
|
||||||
User,
|
User,
|
||||||
Presence,
|
Presence,
|
||||||
Channel,
|
Channel,
|
||||||
@ -38,6 +37,7 @@ import {
|
|||||||
} from "@spacebar/gateway";
|
} from "@spacebar/gateway";
|
||||||
import murmur from "murmurhash-js/murmurhash3_gc";
|
import murmur from "murmurhash-js/murmurhash3_gc";
|
||||||
import { check } from "./instanceOf";
|
import { check } from "./instanceOf";
|
||||||
|
import { LazyRequestSchema } from "@spacebar/schemas"
|
||||||
|
|
||||||
// TODO: only show roles/members that have access to this channel
|
// TODO: only show roles/members that have access to this channel
|
||||||
// TODO: config: to list all members (even those who are offline) sorted by role, or just those who are online
|
// TODO: config: to list all members (even those who are offline) sorted by role, or just those who are online
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user