New formatting
This commit is contained in:
parent
0b5e82bfcc
commit
026d1ca06d
@ -15,5 +15,5 @@ export interface ClientStyleContextData {
|
||||
}
|
||||
|
||||
export const ClientStyleContext = createContext<ClientStyleContextData | null>(
|
||||
null
|
||||
null,
|
||||
);
|
||||
|
@ -34,5 +34,5 @@ hydrateRoot(
|
||||
<ClientCacheProvider>
|
||||
<RemixBrowser />
|
||||
</ClientCacheProvider>
|
||||
</StrictMode>
|
||||
</StrictMode>,
|
||||
);
|
||||
|
@ -10,7 +10,7 @@ export default function handleRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext
|
||||
remixContext: EntryContext,
|
||||
) {
|
||||
const cache = createEmotionCache();
|
||||
const { extractCriticalToChunks } = createEmotionServer(cache);
|
||||
@ -19,7 +19,7 @@ export default function handleRequest(
|
||||
<CacheProvider value={cache}>
|
||||
<RemixServer context={remixContext} url={request.url} />
|
||||
</CacheProvider>
|
||||
</ServerStyleContext.Provider>
|
||||
</ServerStyleContext.Provider>,
|
||||
);
|
||||
|
||||
const chunks = extractCriticalToChunks(html);
|
||||
@ -29,7 +29,7 @@ export default function handleRequest(
|
||||
<CacheProvider value={cache}>
|
||||
<RemixServer context={remixContext} url={request.url} />
|
||||
</CacheProvider>
|
||||
</ServerStyleContext.Provider>
|
||||
</ServerStyleContext.Provider>,
|
||||
);
|
||||
|
||||
responseHeaders.set("content-type", "text/html;charset=utf-8");
|
||||
|
12
app/root.tsx
12
app/root.tsx
@ -46,7 +46,7 @@ export function ErrorBoundary() {
|
||||
<Link color="#646cff" onClick={() => location.reload()}>
|
||||
Refresh
|
||||
</Link>
|
||||
</Container>
|
||||
</Container>,
|
||||
);
|
||||
|
||||
const { status } = error;
|
||||
@ -74,7 +74,7 @@ export function ErrorBoundary() {
|
||||
<Link color="#646cff" onClick={() => history.go(-1)}>
|
||||
Go back
|
||||
</Link>
|
||||
</Container>
|
||||
</Container>,
|
||||
);
|
||||
|
||||
default:
|
||||
@ -90,7 +90,7 @@ export function ErrorBoundary() {
|
||||
<Link color="#646cff" onClick={() => location.reload()}>
|
||||
Reload
|
||||
</Link>
|
||||
</Container>
|
||||
</Container>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -124,7 +124,7 @@ export function meta() {
|
||||
|
||||
function getMarkup(
|
||||
loaderData: { [k: string]: any },
|
||||
child: ReactNode
|
||||
child: ReactNode,
|
||||
): JSX.Element {
|
||||
const Document = withEmotionCache(
|
||||
({ children }: { children: ReactNode }, emotionCache) => {
|
||||
@ -149,7 +149,7 @@ function getMarkup(
|
||||
colorModeManager={cookieStorageManagerSSR(
|
||||
typeof document === "undefined"
|
||||
? `chakra-ui-color-mode=${loaderData.theme}`
|
||||
: document.cookie
|
||||
: document.cookie,
|
||||
)}
|
||||
theme={theme}
|
||||
>
|
||||
@ -199,7 +199,7 @@ function getMarkup(
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
return <Document>{child}</Document>;
|
||||
|
@ -44,7 +44,7 @@ export async function loader({ context }: { context: RequestContext }) {
|
||||
await dataKV.list({
|
||||
prefix: `appeal_${currentUser.id}`,
|
||||
})
|
||||
).keys.length
|
||||
).keys.length,
|
||||
),
|
||||
can_toggle:
|
||||
currentUser.permissions & (1 << 0) || currentUser.permissions & (1 << 11),
|
||||
|
@ -23,7 +23,7 @@ import { useEffect, useState } from "react";
|
||||
|
||||
export default function (props: AppealCardProps) {
|
||||
const [dateString, setDateString] = useState(
|
||||
new Date(props.created_at).toUTCString()
|
||||
new Date(props.created_at).toUTCString(),
|
||||
);
|
||||
const [action, setAction] = useState("");
|
||||
const [feedback, setFeedback] = useState("");
|
||||
|
@ -49,7 +49,7 @@ export default function ({
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
id: string,
|
||||
value: string
|
||||
value: string,
|
||||
) {
|
||||
const newState = { ...state };
|
||||
newState[id] = value;
|
||||
@ -60,7 +60,7 @@ export default function ({
|
||||
function renderCheckboxOptions(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for checkbox are undefined");
|
||||
|
||||
@ -88,7 +88,7 @@ export default function ({
|
||||
? groupValues.push(e.target.value)
|
||||
: groupValues.splice(
|
||||
groupValues.findIndex((v) => v === e.target.value),
|
||||
1
|
||||
1,
|
||||
);
|
||||
|
||||
newState[c.id] = groupValues;
|
||||
@ -97,7 +97,7 @@ export default function ({
|
||||
value={option.value}
|
||||
>
|
||||
{option.value}
|
||||
</Checkbox>
|
||||
</Checkbox>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -111,7 +111,7 @@ export default function ({
|
||||
function renderRadioElements(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for radio buttons are undefined!");
|
||||
const buttons = [];
|
||||
@ -120,7 +120,7 @@ export default function ({
|
||||
buttons.push(
|
||||
<Radio checked={option.default} value={option.value}>
|
||||
{option.value}
|
||||
</Radio>
|
||||
</Radio>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ export default function ({
|
||||
function renderSelectElements(
|
||||
c: component,
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
) {
|
||||
if (!c.options) throw new Error("Options for select are undefined!");
|
||||
|
||||
@ -170,14 +170,14 @@ export default function ({
|
||||
function generateReactComponents(
|
||||
components: component[],
|
||||
state: { [k: string]: string | string[] },
|
||||
setState: Dispatch<SetStateAction<{}>>
|
||||
setState: Dispatch<SetStateAction<{}>>,
|
||||
): JSX.Element[] {
|
||||
const fragmentsList = [];
|
||||
|
||||
for (const component of components) {
|
||||
fragmentsList.push(
|
||||
<Heading size="md">{component.title}</Heading>,
|
||||
<br />
|
||||
<br />,
|
||||
);
|
||||
|
||||
switch (component.type) {
|
||||
@ -204,7 +204,7 @@ export default function ({
|
||||
value={component.value}
|
||||
/>
|
||||
<FormErrorMessage>Field is required</FormErrorMessage>
|
||||
</FormControl>
|
||||
</FormControl>,
|
||||
);
|
||||
break;
|
||||
|
||||
@ -212,7 +212,7 @@ export default function ({
|
||||
fragmentsList.push(
|
||||
<NumberInput
|
||||
isInvalid={isNumberElemInvalid(
|
||||
document.getElementById(component.id) as HTMLInputElement
|
||||
document.getElementById(component.id) as HTMLInputElement,
|
||||
)}
|
||||
isReadOnly={read_only}
|
||||
>
|
||||
@ -227,7 +227,7 @@ export default function ({
|
||||
<NumberIncrementStepper />
|
||||
<NumberDecrementStepper />
|
||||
</NumberInputStepper>
|
||||
</NumberInput>
|
||||
</NumberInput>,
|
||||
);
|
||||
break;
|
||||
|
||||
@ -256,7 +256,7 @@ export default function ({
|
||||
style={{ display: page ? "none" : undefined }}
|
||||
>
|
||||
{generateReactComponents(componentList, responses, setResponses)}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ import {
|
||||
export default function (props: GameAppealProps) {
|
||||
async function performAction(action: "accept" | "deny"): Promise<void> {
|
||||
const statsReduction = parseInt(
|
||||
(document.getElementById("reductPercentage") as HTMLInputElement).value
|
||||
(document.getElementById("reductPercentage") as HTMLInputElement).value,
|
||||
);
|
||||
|
||||
const actionResponse = await fetch(`/api/game-appeals/${props.roblox_id}`, {
|
||||
@ -49,7 +49,7 @@ export default function (props: GameAppealProps) {
|
||||
duration: 10000,
|
||||
status: "error",
|
||||
title: "An error occurred...",
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -112,6 +112,9 @@ export default function (props: {
|
||||
<Link href="/support" size="lg">
|
||||
Support
|
||||
</Link>
|
||||
<Link href="https://ccdiscussion.com" size="lg">
|
||||
Community
|
||||
</Link>
|
||||
<Link
|
||||
display={hasMod() ? undefined : "none"}
|
||||
href="/mod-queue"
|
||||
|
@ -18,7 +18,7 @@ export default function (props: { isOpen: boolean; onClose: () => void }) {
|
||||
if (!props.isOpen) return;
|
||||
|
||||
const evidenceElement = document.getElementById(
|
||||
"evidence"
|
||||
"evidence",
|
||||
) as HTMLInputElement;
|
||||
|
||||
if (!evidenceElement.files && e.clipboardData?.files) {
|
||||
|
@ -55,7 +55,7 @@ function createConstructStyleTagsFromChunks(cache, nonceString) {
|
||||
item.key,
|
||||
item.ids.join(" "),
|
||||
item.css,
|
||||
nonceString
|
||||
nonceString,
|
||||
);
|
||||
});
|
||||
|
||||
@ -73,7 +73,7 @@ export function createEmotionServer(cache) {
|
||||
extractCriticalToChunks: createExtractCriticalToChunks(cache),
|
||||
constructStyleTagsFromChunks: createConstructStyleTagsFromChunks(
|
||||
cache,
|
||||
nonceString
|
||||
nonceString,
|
||||
),
|
||||
};
|
||||
}
|
||||
|
@ -106,10 +106,7 @@ async function setHeaders(context: RequestContext) {
|
||||
"Content-Security-Policy",
|
||||
"connect-src: https://o1071757.ingest.sentry.io https://storage.googleapis.com self; default-src: self; frame-src: https://challenges.cloudflare.com; img-src: https://cdn.discordapp.com https://mediaproxy.carcrushers.cc self; media-src: https://mediaproxy.carcrushers.cc; report-uri: https://o1071757.ingest.sentry.io/api/6069431/security/?sentry_key=3d2b34700e6942f9b739cd8b2001f70f; script=src: https://challenges.cloudflare.com self",
|
||||
);
|
||||
response.headers.set(
|
||||
"Permissions-Policy",
|
||||
"clipboard-write=(self)",
|
||||
);
|
||||
response.headers.set("Permissions-Policy", "clipboard-write=(self)");
|
||||
response.headers.set("Referrer-Policy", "same-origin");
|
||||
response.headers.set(
|
||||
"RTV",
|
||||
|
@ -7,7 +7,7 @@ export async function onRequest(context: RequestContext) {
|
||||
});
|
||||
|
||||
const deliveryDate = new Date(
|
||||
Date.now() + 86400000 + Math.round(Math.random() * 172800000)
|
||||
Date.now() + 86400000 + Math.round(Math.random() * 172800000),
|
||||
)
|
||||
.toUTCString()
|
||||
.replace("GMT", "+0000");
|
||||
|
@ -15,7 +15,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
authorization: `Basic ${btoa("api:" + context.env.MAILGUN_API_KEY)}`,
|
||||
},
|
||||
method: "POST",
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (!emailReq.ok) {
|
||||
@ -38,7 +38,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
"x-audit-log-reason": `Appeal accepted by ${currentUser.username}#${currentUser.discriminator} (${currentUser.id})`,
|
||||
},
|
||||
method: "DELETE",
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await fetch(context.env.APPEALS_WEBHOOK, {
|
||||
|
@ -11,7 +11,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
|
||||
await context.env.DATA.put(
|
||||
`appealban_${context.data.targetId}`,
|
||||
JSON.stringify({ moderator: currentUser.id })
|
||||
JSON.stringify({ moderator: currentUser.id }),
|
||||
);
|
||||
await fetch(context.env.APPEALS_WEBHOOK, {
|
||||
body: JSON.stringify({
|
||||
|
@ -15,7 +15,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
authorization: `Basic ${btoa("api:" + context.env.MAILGUN_API_KEY)}`,
|
||||
},
|
||||
method: "POST",
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (!emailReq.ok) {
|
||||
|
@ -19,7 +19,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
status: 400,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const { current_user: currentUser } = context.data;
|
||||
@ -36,13 +36,13 @@ export async function onRequestPost(context: RequestContext) {
|
||||
prefix: `appeal_${currentUser.id}`,
|
||||
});
|
||||
const existingBlockedAppeal = await context.env.DATA.get(
|
||||
`blockedappeal_${currentUser.id}`
|
||||
`blockedappeal_${currentUser.id}`,
|
||||
);
|
||||
|
||||
if (
|
||||
existingBlockedAppeal ||
|
||||
existingAppeals.keys.find(
|
||||
(appeal) => (appeal.metadata as { [k: string]: any })?.open
|
||||
(appeal) => (appeal.metadata as { [k: string]: any })?.open,
|
||||
)
|
||||
)
|
||||
return new Response('{"error":"Appeal already submitted"}', {
|
||||
@ -82,7 +82,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
}),
|
||||
{
|
||||
expirationTtl: 94608000,
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
await fetch(context.env.APPEALS_WEBHOOK, {
|
||||
|
@ -14,7 +14,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
`https://discord.com/oauth2/authorize?client_id=${
|
||||
env.DISCORD_ID
|
||||
}&redirect_uri=${encodeURIComponent(
|
||||
`${protocol}//${host}/api/auth/session`
|
||||
)}&response_type=code&scope=identify%20email%20guilds.members.read&state=${state}`
|
||||
`${protocol}//${host}/api/auth/session`,
|
||||
)}&response_type=code&scope=identify%20email%20guilds.members.read&state=${state}`,
|
||||
);
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ import tokenPrefixes from "../../../data/token_prefixes.json";
|
||||
async function generateTokenHash(token: string): Promise<string> {
|
||||
const hash = await crypto.subtle.digest(
|
||||
"SHA-512",
|
||||
new TextEncoder().encode(token)
|
||||
new TextEncoder().encode(token),
|
||||
);
|
||||
return btoa(String.fromCharCode(...new Uint8Array(hash)))
|
||||
.replace(/\+/g, "-")
|
||||
@ -62,7 +62,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
}).toString(),
|
||||
headers: {
|
||||
authorization: `Basic ${btoa(
|
||||
context.env.DISCORD_ID + ":" + context.env.DISCORD_SECRET
|
||||
context.env.DISCORD_ID + ":" + context.env.DISCORD_SECRET,
|
||||
)}`,
|
||||
"content-type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
@ -114,7 +114,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
headers: {
|
||||
authorization: `Bearer ${tokenData.access_token}`,
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const memberData: { [k: string]: any } = await serverMemberReq.json();
|
||||
@ -133,7 +133,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
selectedTokenStart +
|
||||
`${crypto.randomUUID()}${crypto.randomUUID()}${crypto.randomUUID()}${crypto.randomUUID()}`.replaceAll(
|
||||
"-",
|
||||
""
|
||||
"",
|
||||
);
|
||||
|
||||
const tokenHash = await generateTokenHash(authToken);
|
||||
|
@ -13,7 +13,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
});
|
||||
|
||||
const appeal = await context.env.DATA.get(
|
||||
`gameappeal_${context.params.id as string}`
|
||||
`gameappeal_${context.params.id as string}`,
|
||||
);
|
||||
|
||||
if (!appeal)
|
||||
@ -45,7 +45,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
await insertLogs(
|
||||
{ [data.roblox_id]: 4 },
|
||||
context.params.id as string,
|
||||
context
|
||||
context,
|
||||
);
|
||||
await setBanList(context, banList);
|
||||
|
||||
|
@ -17,7 +17,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
await context.env.DATA.put(
|
||||
`gameappealblock_${appealData.roblox_id}`,
|
||||
`${Date.now() + 2592000000}`,
|
||||
{ expirationTtl: 2592000000 }
|
||||
{ expirationTtl: 2592000000 },
|
||||
);
|
||||
|
||||
return new Response(null, {
|
||||
|
@ -11,7 +11,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (!robloxUserReq.ok) {
|
||||
@ -41,13 +41,13 @@ export async function onRequestGet(context: RequestContext) {
|
||||
a.entity.properties.executed_at.integerValue >
|
||||
b.entity.properties.executed_at.integerValue
|
||||
? 1
|
||||
: -1
|
||||
)
|
||||
: -1,
|
||||
),
|
||||
),
|
||||
{
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
|
||||
if (
|
||||
!ticket_link?.match(
|
||||
/^https?:\/\/carcrushers\.modmail\.dev\/logs\/[a-z\d]{12}$/
|
||||
/^https?:\/\/carcrushers\.modmail\.dev\/logs\/[a-z\d]{12}$/,
|
||||
)
|
||||
)
|
||||
return new Response('{"error":"Invalid ticket link provided"}', {
|
||||
|
@ -19,7 +19,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
|
||||
if (
|
||||
["165594923586945025", "289372404541554689", "396347223736057866"].includes(
|
||||
user
|
||||
user,
|
||||
)
|
||||
)
|
||||
return new Response(null, {
|
||||
|
@ -14,7 +14,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
if (
|
||||
!context.data.current_user?.permissions ||
|
||||
![1 << 0, 1 << 2, 1 << 11].find(
|
||||
(p) => context.data.current_user.permissions & p
|
||||
(p) => context.data.current_user.permissions & p,
|
||||
)
|
||||
)
|
||||
return new Response('{"error":"Forbidden"}', {
|
||||
@ -88,7 +88,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
});
|
||||
|
||||
const attachmentKey = `${Date.now()}${Math.round(
|
||||
Math.random() * 10000000
|
||||
Math.random() * 10000000,
|
||||
).toString()}/${file.name}`;
|
||||
|
||||
urlPromises.push(
|
||||
@ -96,8 +96,8 @@ export async function onRequestPost(context: RequestContext) {
|
||||
context.env,
|
||||
attachmentKey,
|
||||
file.size,
|
||||
(allowedFileTypes.find((t) => t === file.type) as string).split("/")[1]
|
||||
)
|
||||
(allowedFileTypes.find((t) => t === file.type) as string).split("/")[1],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -111,9 +111,9 @@ export async function onRequestPost(context: RequestContext) {
|
||||
status: 500,
|
||||
});
|
||||
|
||||
const infractionId = `${body.get("user")}${Date.now()}${
|
||||
context.request.headers.get("cf-ray")?.split("-")[0]
|
||||
}`;
|
||||
const infractionId = `${body.get(
|
||||
"user",
|
||||
)}${Date.now()}${context.request.headers.get("cf-ray")?.split("-")[0]}`;
|
||||
const uploadReqs = [];
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
@ -121,7 +121,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
fetch(settledURLPromises[i] as unknown as string, {
|
||||
body: files[i],
|
||||
method: "PUT",
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ export async function onRequestPost(context: RequestContext) {
|
||||
JSON.stringify({
|
||||
created_at: Date.now(),
|
||||
moderator: context.data.current_user.id,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
return new Response(null, {
|
||||
|
@ -54,7 +54,7 @@ export async function onRequestGet(context: RequestContext) {
|
||||
To avoid any potential injection attacks we enforce a list of specific values and permissions for table names
|
||||
*/
|
||||
await context.env.D1.prepare(
|
||||
`SELECT id FROM ${table} WHERE created_at < ? AND open = ? ORDER BY created_at DESC LIMIT 25;`
|
||||
`SELECT id FROM ${table} WHERE created_at < ? AND open = ? ORDER BY created_at DESC LIMIT 25;`,
|
||||
)
|
||||
.bind(before, Number(!showClosed))
|
||||
.all();
|
||||
|
@ -8,18 +8,18 @@ export async function onRequestGet(context: RequestContext) {
|
||||
new TextEncoder().encode(atob(context.env.URL_SIGNING_KEY)),
|
||||
{ hash: "SHA-1", name: "HMAC" },
|
||||
false,
|
||||
["sign"]
|
||||
["sign"],
|
||||
);
|
||||
const signature = await crypto.subtle.sign(
|
||||
"HMAC",
|
||||
signingKey,
|
||||
new TextEncoder().encode(unsignedURL)
|
||||
new TextEncoder().encode(unsignedURL),
|
||||
);
|
||||
|
||||
return Response.redirect(
|
||||
`${unsignedURL}&Signature=${btoa(new TextDecoder().decode(signature))
|
||||
.replaceAll("+", "-")
|
||||
.replaceAll("/", "_")
|
||||
.replaceAll("=", "")}`
|
||||
.replaceAll("=", "")}`,
|
||||
);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
export default async function (
|
||||
userid: string,
|
||||
roles?: string[],
|
||||
context?: RequestContext
|
||||
context?: RequestContext,
|
||||
): Promise<number> {
|
||||
let permissions = 0;
|
||||
|
||||
@ -12,7 +12,7 @@ export default async function (
|
||||
if (roles?.includes("607697704419852289")) permissions |= 1 << 4; // Events Team Management
|
||||
if (
|
||||
["165594923586945025", "289372404541554689", "396347223736057866"].includes(
|
||||
userid
|
||||
userid,
|
||||
) ||
|
||||
Boolean(await context?.env.DATA.get(`gamemod_${userid}`))
|
||||
)
|
||||
|
@ -18,7 +18,7 @@ export async function getBanList(context: RequestContext) {
|
||||
|
||||
export async function setBanList(
|
||||
context: RequestContext,
|
||||
data: { [k: string]: { [k: string]: any } }
|
||||
data: { [k: string]: { [k: string]: any } },
|
||||
) {
|
||||
const setRequest = await fetch(DATASTORE_URL, {
|
||||
body: JSON.stringify(data),
|
||||
|
2
index.d.ts
vendored
2
index.d.ts
vendored
@ -17,7 +17,7 @@ declare global {
|
||||
|
||||
interface EmotionServer {
|
||||
constructStyleTagsFromChunks: (
|
||||
criticalData: EmotionCriticalToChunks
|
||||
criticalData: EmotionCriticalToChunks,
|
||||
) => string;
|
||||
extractCriticalToChunks: (html: string) => EmotionCriticalToChunks;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user