mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 12:14:33 +01:00
Lint project
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Announce from 'App/Models/Announce'
|
||||
import AnnounceUpdateValidator from 'App/Validators/announce/AnnounceUpdateValidator'
|
||||
import File from 'App/Models/File'
|
||||
@@ -25,7 +25,8 @@ export default class AnnouncesController {
|
||||
await announce.related('message').associate(await getTranslation(data.code))
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await announce.related('cover').associate(cover)
|
||||
if (cover)
|
||||
await announce.related('cover').associate(cover)
|
||||
|
||||
await announce.merge(data).save()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import AuthValidator from 'App/Validators/AuthValidator'
|
||||
|
||||
export default class AuthController {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Experience from 'App/Models/Experience'
|
||||
import ExperienceStoreValidator from 'App/Validators/experience/ExperienceStoreValidator'
|
||||
import ExperienceUpdateValidator from 'App/Validators/experience/ExperienceUpdateValidator'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Application from '@ioc:Adonis/Core/Application'
|
||||
import File from 'App/Models/File'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import FormationStoreValidator from 'App/Validators/formation/FormationStoreValidator'
|
||||
import FormationUpdateValidator from 'App/Validators/formation/FormationUpdateValidator'
|
||||
import Formation from 'App/Models/Formation'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import FormStoreValidator from 'App/Validators/form/FormStoreValidator'
|
||||
import Form from 'App/Models/Form'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Information from 'App/Models/Information'
|
||||
import InformationUpdateValidator from 'App/Validators/information/InformationUpdateValidator'
|
||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Location from 'App/Models/Location'
|
||||
import LocationValidator from 'App/Validators/location/LocationValidator'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Maintenance from 'App/Models/Maintenance'
|
||||
import MaintenanceUpdateValidator from 'App/Validators/maintenance/MaintenanceUpdateValidator'
|
||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import PostColor from 'App/Models/PostColor'
|
||||
import PostColorStoreValidator from 'App/Validators/postColor/PostColorStoreValidator'
|
||||
import PostColorUpdateValidator from 'App/Validators/postColor/PostColorUpdateValidator'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Post from 'App/Models/Post'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import PostUpdateValidator from 'App/Validators/post/PostUpdateValidator'
|
||||
import File from 'App/Models/File'
|
||||
import PostStoreValidator from 'App/Validators/post/PostStoreValidator'
|
||||
@@ -90,10 +90,12 @@ export default class PostsController {
|
||||
await post.related('content').associate(await getTranslation(data.content!))
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await post.related('cover').associate(cover)
|
||||
if (cover)
|
||||
await post.related('cover').associate(cover)
|
||||
|
||||
const color = await PostColor.findBy('name', data.color)
|
||||
if (color) await post.related('color').associate(color)
|
||||
if (color)
|
||||
await post.related('color').associate(color)
|
||||
|
||||
return response.status(200).send({
|
||||
post,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ProfileController {
|
||||
public me({ response }: HttpContextContract) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Project from 'App/Models/Project'
|
||||
import ProjectStoreValidator from 'App/Validators/project/ProjectStoreValidator'
|
||||
import ProjectUpdateValidator from 'App/Validators/project/ProjectUpdateValidator'
|
||||
@@ -49,9 +49,11 @@ export default class ProjectsController {
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
|
||||
await project.merge(data).save()
|
||||
if (cover) await project.related('cover').associate(cover)
|
||||
if (cover)
|
||||
await project.related('cover').associate(cover)
|
||||
|
||||
if (data.description) await project.related('description').associate(await getTranslation(data.description))
|
||||
if (data.description)
|
||||
await project.related('description').associate(await getTranslation(data.description))
|
||||
|
||||
await project.related('tags').sync(data.tags!)
|
||||
return response.status(200).send({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import File from 'App/Models/File'
|
||||
import Skill from 'App/Models/Skill'
|
||||
import SkillStoreValidator from 'App/Validators/skill/SkillStoreValidator'
|
||||
@@ -19,7 +19,8 @@ export default class SkillsController {
|
||||
const skill = await Skill.create(data)
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await skill.related('file').associate(cover)
|
||||
if (cover)
|
||||
await skill.related('file').associate(cover)
|
||||
|
||||
return response.status(200).send({
|
||||
skill,
|
||||
@@ -39,7 +40,8 @@ export default class SkillsController {
|
||||
const skill = await Skill.findOrFail(params.id)
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await skill.related('file').associate(cover)
|
||||
if (cover)
|
||||
await skill.related('file').associate(cover)
|
||||
await skill.merge(data).save()
|
||||
|
||||
return response.status(200).send({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import {
|
||||
fetchTopArtist, fetchTopTracks,
|
||||
getAuthorizationURI,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Redis from '@ioc:Adonis/Addons/Redis'
|
||||
import StateSleepingValidator from 'App/Validators/states/StateSleepingValidator'
|
||||
import { getCurrentPlayingFromCache } from 'App/Utils/SongUtils'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import CommandsRun from 'App/Models/CommandsRun'
|
||||
import BuildsRun from 'App/Models/BuildsRun'
|
||||
import {
|
||||
NOW,
|
||||
fetchDailyStatistics,
|
||||
fetchMonthlyStatistics,
|
||||
fetchStatistics,
|
||||
fetchWeeklyStatistics,
|
||||
NOW,
|
||||
} from 'App/Utils/StatsUtils'
|
||||
|
||||
export default class StatsController {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Subscriber from 'App/Models/Subscriber'
|
||||
import SubscriberStoreValidator from 'App/Validators/subscriber/SubscriberStoreValidator'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import TagStoreValidator from 'App/Validators/tag/TagStoreValidator'
|
||||
import TagUpdateValidator from 'App/Validators/tag/TagUpdateValidator'
|
||||
import Tag from 'App/Models/Tag'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Translation from 'App/Models/Translation'
|
||||
import TranslationStoreValidator from 'App/Validators/translation/TranslationStoreValidator'
|
||||
import TranslationUpdateValidator from 'App/Validators/translation/TranslationUpdateValidator'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import User from 'App/Models/User'
|
||||
import UserStoreValidator from 'App/Validators/user/UserStoreValidator'
|
||||
import UserUpdateValidator from 'App/Validators/user/UserUpdateValidator'
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { BaseMailer, MessageContract } from '@ioc:Adonis/Addons/Mail'
|
||||
import type { MessageContract } from '@ioc:Adonis/Addons/Mail'
|
||||
import { BaseMailer } from '@ioc:Adonis/Addons/Mail'
|
||||
|
||||
export default class FormConfirmation extends BaseMailer {
|
||||
constructor(private name: string, private email: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { AuthenticationException } from '@adonisjs/auth/build/standalone'
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
/**
|
||||
* Silent auth middleware can be used as a global middleware to silent check
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from 'App/Models/File'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Experience extends BaseModel {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class File extends BaseModel {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class Form extends BaseModel {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Formation extends BaseModel {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Information extends BaseModel {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class Location extends BaseModel {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Maintenance extends BaseModel {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column, manyToMany, ManyToMany } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo, ManyToMany } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column, manyToMany } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Tag from 'App/Models/Tag'
|
||||
import Translation from 'App/Models/Translation'
|
||||
import File from 'App/Models/File'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class PostColor extends BaseModel {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column, ManyToMany, manyToMany } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo, ManyToMany } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column, manyToMany } from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from 'App/Models/File'
|
||||
import Tag from 'App/Models/Tag'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from 'App/Models/File'
|
||||
|
||||
export default class Skill extends BaseModel {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class Subscriber extends BaseModel {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import type { DateTime } from 'luxon'
|
||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Tag extends BaseModel {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class Translation extends BaseModel {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import type { DateTime } from 'luxon'
|
||||
import Hash from '@ioc:Adonis/Core/Hash'
|
||||
import { BaseModel, beforeSave, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ interface StatsResponse {
|
||||
|
||||
async function getDevelopmentHours(): Promise<void> {
|
||||
try {
|
||||
const response = await axios.get<{ data: StatsResponse[]}>(`https://wakatime.com/share/@${Env.get('WAKATIME_USER')}/${Env.get('WAKATIME_ID')}.json`)
|
||||
const response = await axios.get<{ data: StatsResponse[] }>(`https://wakatime.com/share/@${Env.get('WAKATIME_USER')}/${Env.get('WAKATIME_ID')}.json`)
|
||||
if (response.status === 200) {
|
||||
const mapped_stats = response.data.data.map((item: StatsResponse) => {
|
||||
return {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios'
|
||||
import axios from 'axios'
|
||||
import Env from '@ioc:Adonis/Core/Env'
|
||||
import Redis from '@ioc:Adonis/Addons/Redis'
|
||||
import { SpotifyArtist, SpotifyTrack } from 'App/Types/ILocalSpotify'
|
||||
import { Artist, InternalPlayerResponse, Item, PlayerResponse, SpotifyToken } from 'App/Types/ISpotify'
|
||||
import type { SpotifyArtist, SpotifyTrack } from 'App/Types/ILocalSpotify'
|
||||
import type { Artist, InternalPlayerResponse, Item, PlayerResponse, SpotifyToken } from 'App/Types/ISpotify'
|
||||
import queryString from 'query-string'
|
||||
import { updateGithubReadmeSpotify } from 'App/Utils/UpdateGithubReadme'
|
||||
|
||||
@@ -12,9 +13,9 @@ export async function getSpotifyAccount(): Promise<SpotifyToken> {
|
||||
return await Redis.exists('spotify:account')
|
||||
? JSON.parse(await Redis.get('spotify:account') || '{}')
|
||||
: {
|
||||
access_token: '',
|
||||
refresh_token: '',
|
||||
}
|
||||
access_token: '',
|
||||
refresh_token: '',
|
||||
}
|
||||
}
|
||||
|
||||
export async function setSpotifyAccount(token: SpotifyToken): Promise<void> {
|
||||
@@ -103,7 +104,8 @@ export async function getCurrentPlayingFromCache(): Promise<InternalPlayerRespon
|
||||
}
|
||||
|
||||
export async function getCurrentPlayingFromSpotify(): Promise<InternalPlayerResponse> {
|
||||
if ((await getSpotifyAccount()).access_token === '') return { is_playing: false }
|
||||
if ((await getSpotifyAccount()).access_token === '')
|
||||
return { is_playing: false }
|
||||
const current_track = await RequestWrapper<PlayerResponse>('https://api.spotify.com/v1/me/player?additional_types=track,episode')
|
||||
|
||||
let current: InternalPlayerResponse
|
||||
|
||||
@@ -3,11 +3,11 @@ import axios from 'axios'
|
||||
import Env from '@ioc:Adonis/Core/Env'
|
||||
import Redis from '@ioc:Adonis/Addons/Redis'
|
||||
import Logger from '@ioc:Adonis/Core/Logger'
|
||||
import { StatesResponse } from 'App/Types/IStates'
|
||||
import type { StatesResponse } from 'App/Types/IStates'
|
||||
|
||||
export async function fetchDevelopingState(): Promise<void> {
|
||||
try {
|
||||
const response = await axios.get<{ data: StatesResponse[]}>(`https://wakatime.com/api/v1/users/${Env.get('WAKATIME_USER')}/heartbeats`, {
|
||||
const response = await axios.get<{ data: StatesResponse[] }>(`https://wakatime.com/api/v1/users/${Env.get('WAKATIME_USER')}/heartbeats`, {
|
||||
headers: {
|
||||
Authorization: `Basic ${btoa(Env.get('WAKATIME_KEY'))}`,
|
||||
},
|
||||
@@ -26,7 +26,8 @@ export async function fetchDevelopingState(): Promise<void> {
|
||||
|
||||
if (redis_state !== active) {
|
||||
await Redis.set('states:developing', String(active))
|
||||
if (redis_state) await Redis.set('states:sleeping', 'false')
|
||||
if (redis_state)
|
||||
await Redis.set('states:sleeping', 'false')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import DevelopmentHour from 'App/Models/DevelopmentHour'
|
||||
import CommandsRun from 'App/Models/CommandsRun'
|
||||
import BuildsRun from 'App/Models/BuildsRun'
|
||||
import { Stats, Time } from 'App/Types/IStats'
|
||||
import type { Stats, Time } from 'App/Types/IStats'
|
||||
|
||||
function formatDate(date: Date): string {
|
||||
return date.toISOString().split('T')[0]
|
||||
|
||||
@@ -7,9 +7,9 @@ import {
|
||||
fetchStatistics,
|
||||
fetchWeeklyStatistics,
|
||||
} from 'App/Utils/StatsUtils'
|
||||
import { Stats } from 'App/Types/IStats'
|
||||
import type { Stats } from 'App/Types/IStats'
|
||||
import { getCurrentPlayingFromCache } from 'App/Utils/SongUtils'
|
||||
import { GithubReason, GithubRequest } from 'App/Types/IGithub'
|
||||
import type { GithubReason, GithubRequest } from 'App/Types/IGithub'
|
||||
|
||||
export async function updateGithubReadmeStats(): Promise<void> {
|
||||
const daily_stats = await fetchDailyStatistics()
|
||||
@@ -84,9 +84,9 @@ async function getReadmeContent(): Promise<GithubRequest | null> {
|
||||
})
|
||||
return response.status === 200
|
||||
? {
|
||||
content: Buffer.from(response.data.content, 'base64').toString(),
|
||||
sha: response.data.sha,
|
||||
}
|
||||
content: Buffer.from(response.data.content, 'base64').toString(),
|
||||
sha: response.data.sha,
|
||||
}
|
||||
: null
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class AuthValidator {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class AnnounceUpdateValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ExperienceStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ExperienceUpdateValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class FormStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class FormationStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class FormationUpdateValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class InformationUpdateValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class LocationValidator {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class MaintenanceUpdateValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class PostStoreValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class PostUpdateValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class PostColorStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class PostColorUpdateValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ProjectStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ProjectUpdateValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class SkillStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class SkillUpdateValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class SongRangeValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class StateSleepingValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class SubscriberStoreValidator {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class TagStoreValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class TagUpdateValidator {
|
||||
constructor(protected ctx: HttpContextContract) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class TranslationStoreValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class TranslationUpdateValidator {
|
||||
public schema = schema.create({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class UserStoreValidator {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
||||
|
||||
export default class UserUpdateValidator {
|
||||
|
||||
Reference in New Issue
Block a user