Compare commits
1 Commits
92b00934a2
...
698a6c7e19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
698a6c7e19 |
@ -16,10 +16,7 @@
|
||||
"enabled": true,
|
||||
"includes": ["src/**", "!src/types/openapi.d.ts"],
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"style": {
|
||||
"noNonNullAssertion": "off"
|
||||
}
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import * as v from "valibot";
|
||||
import { CONFIG_SCHEMA_KEYS, type Config, ConfigSchema } from "./schema";
|
||||
import { ConfigSchema, CONFIG_SCHEMA_KEYS, type Config } from "./schema";
|
||||
import { transformEnvToConfig } from "./transformer";
|
||||
import * as v from "valibot";
|
||||
|
||||
function createConfig(): Config {
|
||||
const rawConfig = transformEnvToConfig(
|
||||
|
||||
@ -26,7 +26,7 @@ export function transformEnvToConfig<Keys extends string[]>(
|
||||
// descend into the deeper layers
|
||||
// (following keyPath)
|
||||
let current: Record<string, unknown> = config;
|
||||
for (const part of keyPathParts.slice(0, -1)) {
|
||||
for (let part of keyPathParts.slice(0, -1)) {
|
||||
if (!(part in current)) {
|
||||
current[part] = {};
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ authRouter.get("/login/:forgeId", (req: Request, res: Response) => {
|
||||
}
|
||||
|
||||
const forgeId = parseInt(forgeIdParam, 10);
|
||||
if (Number.isNaN(forgeId)) {
|
||||
if (isNaN(forgeId)) {
|
||||
res.status(400).json({ error: "Invalid forgeId" });
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import express from "express";
|
||||
import session from "express-session";
|
||||
import { createOpenAPIBackend, createOpenAPIMiddleware } from "./api/openapi";
|
||||
import { config } from "./config";
|
||||
import { connectDB } from "./config/db";
|
||||
import { config } from "./config";
|
||||
import authRouter from "./routes/auth";
|
||||
import { seedForges } from "./util/seedforges";
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
import * as arctic from "arctic";
|
||||
import type { ForgeInstanceConfig } from "../../config/schema";
|
||||
import type { Forge } from "../../types/forge";
|
||||
import type { ForgeUser } from "../../types/forgeuser";
|
||||
import type { GiteaRepo } from "../../types/gitearepo";
|
||||
import type { Repository } from "../../types/openapi";
|
||||
import { ForgeInstanceConfig } from "../../config/schema";
|
||||
export class GiteaForge implements Forge {
|
||||
private gitea: arctic.Gitea;
|
||||
private forgeId: number;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user