📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
fixed linting issues
Blue Moused943e0b492ce
diff --git a/apps/production/src/user/user.controller.ts b/apps/production/src/user/user.controller.tsindex 84cbfda16..ef5b272d2 100644--- a/apps/production/src/user/user.controller.ts+++ b/apps/production/src/user/user.controller.ts@@ -29,9 +29,9 @@ import * as _isString from 'lodash/isString'import * as _omit from 'lodash/omit'import { v4 as uuidv4 } from 'uuid'+import { Markup } from 'telegraf'import { JwtAccessTokenGuard } from '../auth/guards'import { TelegramService } from '../integrations/telegram/telegram.service'-import { Markup } from 'telegraf'import { UserService } from './user.service'import { ProjectService, deleteProjectRedis } from '../project/project.service'import {diff --git a/apps/selfhosted/src/auth/auth.controller.ts b/apps/selfhosted/src/auth/auth.controller.tsindex 105b70dfa..f335e8853 100644--- a/apps/selfhosted/src/auth/auth.controller.ts+++ b/apps/selfhosted/src/auth/auth.controller.ts@@ -16,7 +16,7 @@ import {import { ApiTags, ApiOperation, ApiOkResponse } from '@nestjs/swagger'import { I18nValidationExceptionFilter, I18n, I18nContext } from 'nestjs-i18n'-import { getUserClickhouse, checkRateLimit } from '../common/utils'+import { checkRateLimit } from '../common/utils'import { generateSelfhostedUser } from '../user/entities/user.entity'import { AuthService } from './auth.service'import { Public, CurrentUserId, CurrentUser } from './decorators'@@ -102,9 +102,7 @@ export class AuthController {throw new ConflictException(i18n.t('auth.invalidRefreshToken'))}- const accessToken = await this.authService.generateJwtAccessToken(- user.id,- )+ const accessToken = await this.authService.generateJwtAccessToken(user.id)return { accessToken }}diff --git a/apps/selfhosted/src/auth/auth.service.ts b/apps/selfhosted/src/auth/auth.service.tsindex cc80d3401..bafd0bc04 100644--- a/apps/selfhosted/src/auth/auth.service.ts+++ b/apps/selfhosted/src/auth/auth.service.ts@@ -14,9 +14,7 @@ import {SELFHOSTED_PASSWORD,JWT_ACCESS_TOKEN_SECRET,} from '../common/constants'-import {- getSelfhostedUser, SelfhostedUser,-} from '../user/entities/user.entity'+import { getSelfhostedUser, SelfhostedUser } from '../user/entities/user.entity'@Injectable()export class AuthService {@@ -55,7 +53,7 @@ export class AuthService {return null}- return await getSelfhostedUser()+ return getSelfhostedUser()}private async generateJwtRefreshToken(diff --git a/apps/selfhosted/src/auth/dtos/login.dto.ts b/apps/selfhosted/src/auth/dtos/login.dto.tsindex 48ce61915..9be0dc156 100644--- a/apps/selfhosted/src/auth/dtos/login.dto.ts+++ b/apps/selfhosted/src/auth/dtos/login.dto.ts@@ -1,8 +1,5 @@import { ApiProperty } from '@nestjs/swagger'-import {- IsEmail,- MinLength,-} from 'class-validator'+import { IsEmail, MinLength } from 'class-validator'export class LoginRequestDto {@ApiProperty({diff --git a/apps/selfhosted/src/auth/guards/jwt-access-token.guard.ts b/apps/selfhosted/src/auth/guards/jwt-access-token.guard.tsindex da772da93..0a9067747 100644--- a/apps/selfhosted/src/auth/guards/jwt-access-token.guard.ts+++ b/apps/selfhosted/src/auth/guards/jwt-access-token.guard.ts@@ -10,7 +10,9 @@ export class JwtAccessTokenGuard extends AuthGuard('jwt-access-token') {super()}- canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean> {+ canActivate(+ context: ExecutionContext,+ ): boolean | Promise<boolean> | Observable<boolean> {const isPublic = this.reflector.getAllAndOverride<boolean>(IS_PUBLIC_KEY, [context.getHandler(),context.getClass(),diff --git a/apps/selfhosted/src/auth/strategies/jwt-access-token.strategy.ts b/apps/selfhosted/src/auth/strategies/jwt-access-token.strategy.tsindex 31bde65f0..fdbf73b6f 100644--- a/apps/selfhosted/src/auth/strategies/jwt-access-token.strategy.ts+++ b/apps/selfhosted/src/auth/strategies/jwt-access-token.strategy.ts@@ -3,7 +3,10 @@ import { ConfigService } from '@nestjs/config'import { PassportStrategy } from '@nestjs/passport'import { Strategy, ExtractJwt } from 'passport-jwt'-import { SELFHOSTED_UUID, JWT_ACCESS_TOKEN_SECRET } from '../../common/constants'+import {+ SELFHOSTED_UUID,+ JWT_ACCESS_TOKEN_SECRET,+} from '../../common/constants'import { getSelfhostedUser } from '../../user/entities/user.entity'import { IJwtPayload } from '../interfaces'@@ -25,6 +28,6 @@ export class JwtAccessTokenStrategy extends PassportStrategy(throw new UnauthorizedException()}- return await getSelfhostedUser()+ return getSelfhostedUser()}}diff --git a/apps/selfhosted/src/common/utils.ts b/apps/selfhosted/src/common/utils.tsindex 8939e0a86..75509f2e3 100644--- a/apps/selfhosted/src/common/utils.ts+++ b/apps/selfhosted/src/common/utils.ts@@ -214,9 +214,9 @@ const getUserClickhouse = async () => {}const query = `SELECT * FROM sfuser WHERE id = {id:String}`-+try {- return ((await clickhouse.query(query, paramsData).toPromise())[0] || {})+ return (await clickhouse.query(query, paramsData).toPromise())[0] || {}} catch {return {}}diff --git a/apps/selfhosted/src/user/entities/user.entity.ts b/apps/selfhosted/src/user/entities/user.entity.tsindex 4c0390b7a..5d48e7374 100644--- a/apps/selfhosted/src/user/entities/user.entity.ts+++ b/apps/selfhosted/src/user/entities/user.entity.ts@@ -41,7 +41,7 @@ export const getSelfhostedUser = async (): Promise<SelfhostedUser> => {let settings = {}try {- settings = _omit((await getUserClickhouse() || {}), ['id'])+ settings = _omit((await getUserClickhouse()) || {}, ['id'])} catch (reason) {console.error('[ERROR] getSelfhostedUser: ', reason)}@@ -50,4 +50,4 @@ export const getSelfhostedUser = async (): Promise<SelfhostedUser> => {...user,...settings,}-}\ No newline at end of file+}diff --git a/apps/selfhosted/src/user/user.controller.ts b/apps/selfhosted/src/user/user.controller.tsindex 9edf4b077..b6eacb317 100644--- a/apps/selfhosted/src/user/user.controller.ts+++ b/apps/selfhosted/src/user/user.controller.ts@@ -1,4 +1,11 @@-import { Controller, Get, Put, UseGuards, Body, BadRequestException} from '@nestjs/common'+import {+ Controller,+ Get,+ Put,+ UseGuards,+ Body,+ BadRequestException,+} from '@nestjs/common'import { ApiTags } from '@nestjs/swagger'import * as _omit from 'lodash/omit'@@ -28,7 +35,7 @@ export class UserController {async me(@CurrentUserId() user_id: string): Promise<SelfhostedUser> {this.logger.log({ user_id }, 'GET /user/me')- return await getSelfhostedUser()+ return getSelfhostedUser()}@Put('/')@@ -47,7 +54,7 @@ export class UserController {})const user = generateSelfhostedUser()- const settings = _omit((await getUserClickhouse() || {}), ['id'])+ const settings = _omit((await getUserClickhouse()) || {}, ['id'])return {...user,