Skip to content

Commit db7b2fe

Browse files
committed
chore: format
1 parent 8f2c767 commit db7b2fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+389
-353
lines changed

.github/workflows/build-and-push.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches:
66
- 'coolify'
77
paths:
8+
- "package.json"
9+
- "package-lock.json"
810
- backend/**
911
- dashboard/**
1012
- shared/**

backend/src/RegExpRunner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ const isTimeoutError = (a): a is TimeoutError => {
99
};
1010

1111
export class RegExpTimeoutError extends Error {
12-
constructor(message: string, public elapsedTimeMs: number) {
12+
constructor(
13+
message: string,
14+
public elapsedTimeMs: number,
15+
) {
1316
super(message);
1417
}
1518
}

backend/src/api/docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import express from "express";
22
import z from "zod/v4";
3+
import { $ZodPipeDef } from "zod/v4/core";
34
import { availableGuildPlugins } from "../plugins/availablePlugins.js";
45
import { ZeppelinGuildPluginInfo } from "../types.js";
56
import { indentLines } from "../utils.js";
67
import { notFound } from "./responses.js";
7-
import { $ZodPipeDef } from "zod/v4/core";
88

99
function isZodObject(schema: z.ZodType): schema is z.ZodObject<any> {
1010
return schema.def.type === "object";

backend/src/configValidator.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,12 @@ export async function validateGuildConfig(config: any): Promise<string | null> {
2828
}
2929

3030
const plugin = pluginNameToPlugin.get(pluginName)!;
31-
const configManager = new PluginConfigManager(
32-
pluginOptions,
33-
{
34-
configSchema: plugin.configSchema,
35-
defaultOverrides: plugin.defaultOverrides ?? [],
36-
levels: {},
37-
customOverrideCriteriaFunctions: plugin.customOverrideCriteriaFunctions,
38-
},
39-
);
31+
const configManager = new PluginConfigManager(pluginOptions, {
32+
configSchema: plugin.configSchema,
33+
defaultOverrides: plugin.defaultOverrides ?? [],
34+
levels: {},
35+
customOverrideCriteriaFunctions: plugin.customOverrideCriteriaFunctions,
36+
});
4037

4138
try {
4239
await configManager.init();

backend/src/data/FishFish.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ async function getSessionToken(): Promise<string> {
5959
}
6060

6161
const timeUntilExpiry = Date.now() - parseResult.data.expires * 1000;
62-
setTimeout(() => {
63-
sessionTokenPromise = null;
64-
}, timeUntilExpiry - 1 * MINUTES); // Subtract a minute to ensure we refresh before expiry
62+
setTimeout(
63+
() => {
64+
sessionTokenPromise = null;
65+
},
66+
timeUntilExpiry - 1 * MINUTES,
67+
); // Subtract a minute to ensure we refresh before expiry
6568

6669
return parseResult.data.token;
6770
})();

backend/src/data/GuildLogs.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ export class GuildLogs extends events.EventEmitter {
4040
this.ignoredLogs.push({ type, ignoreId });
4141

4242
// Clear after expiry (15sec by default)
43-
setTimeout(() => {
44-
this.clearIgnoredLog(type, ignoreId);
45-
}, timeout || 1000 * 15);
43+
setTimeout(
44+
() => {
45+
this.clearIgnoredLog(type, ignoreId);
46+
},
47+
timeout || 1000 * 15,
48+
);
4649
}
4750

4851
isLogIgnored(type: keyof typeof LogType, ignoreId: any) {

backend/src/data/GuildSavedMessages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class GuildSavedMessages extends BaseGuildRepository<SavedMessage> {
2626

2727
protected msgToSavedMessageData(msg: Message): ISavedMessageData {
2828
if (msg.reference?.type === MessageReferenceType.Forward && msg.reference.messageId) {
29-
const realMsg = msg.messageSnapshots.get(msg.reference.messageId)
29+
const realMsg = msg.messageSnapshots.get(msg.reference.messageId);
3030
if (realMsg) {
3131
msg.content = realMsg.content;
3232
msg.attachments = realMsg.attachments;

backend/src/exportSchemas.ts

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,24 @@ const basePluginOverrideCriteriaSchema = z.strictObject({
3434
extra: z.any().optional(),
3535
});
3636

37-
const pluginOverrideCriteriaSchema = basePluginOverrideCriteriaSchema.extend({
38-
get zzz_dummy_property_do_not_use() {
39-
return pluginOverrideCriteriaSchema.optional();
40-
},
41-
get all() {
42-
return z.array(pluginOverrideCriteriaSchema).optional();
43-
},
44-
get any() {
45-
return z.array(pluginOverrideCriteriaSchema).optional();
46-
},
47-
get not() {
48-
return pluginOverrideCriteriaSchema.optional();
49-
},
50-
}).meta({
51-
id: "overrideCriteria",
52-
});
37+
const pluginOverrideCriteriaSchema = basePluginOverrideCriteriaSchema
38+
.extend({
39+
get zzz_dummy_property_do_not_use() {
40+
return pluginOverrideCriteriaSchema.optional();
41+
},
42+
get all() {
43+
return z.array(pluginOverrideCriteriaSchema).optional();
44+
},
45+
get any() {
46+
return z.array(pluginOverrideCriteriaSchema).optional();
47+
},
48+
get not() {
49+
return pluginOverrideCriteriaSchema.optional();
50+
},
51+
})
52+
.meta({
53+
id: "overrideCriteria",
54+
});
5355

5456
const outputPath = process.argv[2];
5557
if (!outputPath) {

backend/src/index.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,17 @@ setInterval(() => {
199199
avgCount++;
200200
lastCheck = now;
201201
}, 500);
202-
setInterval(() => {
203-
const avgBlocking = avgTotal / (avgCount || 1);
204-
// FIXME: Debug
205-
// tslint:disable-next-line:no-console
206-
console.log(`Average blocking in the last 5min: ${avgBlocking / avgTotal}ms`);
207-
avgTotal = 0;
208-
avgCount = 0;
209-
}, 5 * 60 * 1000);
202+
setInterval(
203+
() => {
204+
const avgBlocking = avgTotal / (avgCount || 1);
205+
// FIXME: Debug
206+
// tslint:disable-next-line:no-console
207+
console.log(`Average blocking in the last 5min: ${avgBlocking / avgTotal}ms`);
208+
avgTotal = 0;
209+
avgCount = 0;
210+
},
211+
5 * 60 * 1000,
212+
);
210213

211214
if (env.DEBUG) {
212215
logger.info("NOTE: Bot started in DEBUG mode");
@@ -332,7 +335,7 @@ connect().then(async () => {
332335

333336
if (loaded.success_emoji || loaded.error_emoji) {
334337
const deprecatedKeys = [] as string[];
335-
const exampleConfig = `plugins:\n common:\n config:\n success_emoji: "👍"\n error_emoji: "👎"`;
338+
// const exampleConfig = `plugins:\n common:\n config:\n success_emoji: "👍"\n error_emoji: "👎"`;
336339

337340
if (loaded.success_emoji) {
338341
deprecatedKeys.push("success_emoji");

backend/src/plugins/Automod/actions/changePerms.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ const permissionNames = keys(PermissionsBitField.Flags) as U.ListOf<keyof typeof
6565
const legacyPermissionNames = keys(legacyPermMap) as U.ListOf<keyof typeof legacyPermMap>;
6666
const allPermissionNames = [...permissionNames, ...legacyPermissionNames] as const;
6767

68-
const permissionTypeMap = allPermissionNames.reduce((map, permName) => {
69-
map[permName] = z.boolean().nullable();
70-
return map;
71-
}, {} as Record<typeof allPermissionNames[number], z.ZodNullable<z.ZodBoolean>>);
68+
const permissionTypeMap = allPermissionNames.reduce(
69+
(map, permName) => {
70+
map[permName] = z.boolean().nullable();
71+
return map;
72+
},
73+
{} as Record<(typeof allPermissionNames)[number], z.ZodNullable<z.ZodBoolean>>,
74+
);
7275
const zPermissionsMap = z.strictObject(permissionTypeMap);
7376

7477
export const ChangePermsAction = automodAction({

0 commit comments

Comments
 (0)