From b525c5887f1a81a4a88257f7750b22e882dbf4c9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 15 Jun 2024 11:36:55 +0100 Subject: [PATCH] add copyright text to all our files --- .../1680969937000-larger-image-comment.js | 5 ++++ .../migration/1682753227899-NoteEdit.js | 5 ++++ .../migration/1691264431000-add-lb-to-user.js | 7 ++++- .../1695937489995-enableAchievements.js | 7 ++++- .../migration/1696386694000-speakAsCat.js | 5 ++++ .../migration/1696548899000-background.js | 7 ++++- .../migration/1697580470000-approvalSignup.js | 2 +- .../migration/1697603945000-BotTrending.js | 2 +- .../migration/1697624010000-isSilenced.js | 2 +- .../migration/1697970083000-alterNoteEdit.js | 5 ++++ .../1697970083001-oldDateNoteEdit.js | 5 ++++ .../migration/1699376974000-isIndexable.js | 5 ++++ .../migration/1699819257000-defaultLike.js | 5 ++++ .../1700228972000-update-indexable.js | 5 ++++ .../1701647674000-BubbleInstances.js | 5 ++++ .../migration/1701809447000-NSFW-Instance.js | 5 ++++ .../1704744370000-add-donation-url.js | 5 ++++ .../backend/migration/1706232992000-deeplx.js | 2 +- packages/backend/src/models/NoteEdit.ts | 5 ++++ .../src/models/json-schema/note-edit.ts | 5 ++++ .../ExportAccountDataProcessorService.ts | 5 ++++ .../processors/ImportNotesProcessorService.ts | 5 ++++ .../server/api/endpoints/admin/nsfw-user.ts | 5 ++++ .../api/endpoints/admin/silence-user.ts | 5 ++++ .../server/api/endpoints/admin/unnsfw-user.ts | 5 ++++ .../api/endpoints/admin/unsilence-user.ts | 5 ++++ .../server/api/endpoints/i/import-notes.ts | 7 ++++- .../api/endpoints/i/registry/get-unsecure.ts | 5 ++++ .../src/server/api/endpoints/sponsors.ts | 5 ++++ .../api/mastodon/MastodonApiServerService.ts | 27 +++++++++++-------- .../src/server/api/mastodon/converters.ts | 5 ++++ .../src/server/api/mastodon/endpoints.ts | 5 ++++ .../server/api/mastodon/endpoints/account.ts | 9 +++++-- .../src/server/api/mastodon/endpoints/auth.ts | 7 ++++- .../server/api/mastodon/endpoints/filter.ts | 5 ++++ .../src/server/api/mastodon/endpoints/meta.ts | 5 ++++ .../api/mastodon/endpoints/notifications.ts | 5 ++++ .../server/api/mastodon/endpoints/search.ts | 5 ++++ .../server/api/mastodon/endpoints/status.ts | 5 ++++ .../server/api/mastodon/endpoints/timeline.ts | 5 ++++ .../frontend/src/components/CkFollowMouse.vue | 5 ++++ .../frontend/src/components/MkMfmWindow.vue | 5 ++++ .../frontend/src/components/MkModPlayer.vue | 5 ++++ .../src/components/SkApprovalUser.vue | 5 ++++ .../frontend/src/components/SkNoteHeader.vue | 2 +- .../frontend/src/components/SkNoteSub.vue | 2 +- .../src/components/SkOldNoteWindow.vue | 5 ++++ packages/frontend/src/components/SkOneko.vue | 5 ++++ .../src/components/SkSearchResultWindow.vue | 5 ++++ .../frontend/src/pages/admin/approvals.vue | 5 ++++ .../src/pages/user/index.listenbrainz.vue | 5 ++++ .../src/scripts/check-animated-mfm.ts | 13 ++++++--- packages/frontend/src/scripts/chiptune2.ts | 5 ++++ packages/frontend/src/scripts/favicon-dot.ts | 13 ++++++--- .../src/scripts/get-note-versions-menu.ts | 5 ++++ .../frontend/src/scripts/search-engine-map.ts | 5 ++++ .../frontend/src/widgets/WidgetSearch.vue | 2 +- packages/frontend/test/nyaize.test.ts | 5 ++++ scripts/trim-deps.mjs | 5 ++++ 59 files changed, 293 insertions(+), 33 deletions(-) diff --git a/packages/backend/migration/1680969937000-larger-image-comment.js b/packages/backend/migration/1680969937000-larger-image-comment.js index b6b4f9091..2645b1263 100644 --- a/packages/backend/migration/1680969937000-larger-image-comment.js +++ b/packages/backend/migration/1680969937000-larger-image-comment.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: dakkar and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class largerImageComment1680969937000 { name = 'largerImageComment1680969937000'; diff --git a/packages/backend/migration/1682753227899-NoteEdit.js b/packages/backend/migration/1682753227899-NoteEdit.js index 55a0de020..e67b1c566 100644 --- a/packages/backend/migration/1682753227899-NoteEdit.js +++ b/packages/backend/migration/1682753227899-NoteEdit.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class NoteEdit1682753227899 { name = "NoteEdit1682753227899"; diff --git a/packages/backend/migration/1691264431000-add-lb-to-user.js b/packages/backend/migration/1691264431000-add-lb-to-user.js index fe6265e3f..f06017468 100644 --- a/packages/backend/migration/1691264431000-add-lb-to-user.js +++ b/packages/backend/migration/1691264431000-add-lb-to-user.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: amelia and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class AddLbToUser1691264431000 { name = "AddLbToUser1691264431000"; @@ -17,4 +22,4 @@ export class AddLbToUser1691264431000 { ALTER TABLE "user_profile" DROP COLUMN "listenbrainz" `); } -} \ No newline at end of file +} diff --git a/packages/backend/migration/1695937489995-enableAchievements.js b/packages/backend/migration/1695937489995-enableAchievements.js index 2c20971ff..1ee08de14 100644 --- a/packages/backend/migration/1695937489995-enableAchievements.js +++ b/packages/backend/migration/1695937489995-enableAchievements.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class EnableAchievements1695937489995 { name = 'EnableAchievements1695937489995' @@ -8,4 +13,4 @@ export class EnableAchievements1695937489995 { async down(queryRunner) { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableAchievements"`); } -} \ No newline at end of file +} diff --git a/packages/backend/migration/1696386694000-speakAsCat.js b/packages/backend/migration/1696386694000-speakAsCat.js index d68b9401b..b9ba95e2f 100644 --- a/packages/backend/migration/1696386694000-speakAsCat.js +++ b/packages/backend/migration/1696386694000-speakAsCat.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class SpeakAsCat1696386694000 { name = "SpeakAsCat1696386694000"; diff --git a/packages/backend/migration/1696548899000-background.js b/packages/backend/migration/1696548899000-background.js index 59309b98c..f1c0b5a4a 100644 --- a/packages/backend/migration/1696548899000-background.js +++ b/packages/backend/migration/1696548899000-background.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class Background1696548899000 { name = 'Background1696548899000' @@ -16,4 +21,4 @@ export class Background1696548899000 { await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "backgroundUrl"`); await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "backgroundBlurhash"`); } -} \ No newline at end of file +} diff --git a/packages/backend/migration/1697580470000-approvalSignup.js b/packages/backend/migration/1697580470000-approvalSignup.js index c5f8255d4..cc53a6bb5 100644 --- a/packages/backend/migration/1697580470000-approvalSignup.js +++ b/packages/backend/migration/1697580470000-approvalSignup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697603945000-BotTrending.js b/packages/backend/migration/1697603945000-BotTrending.js index 73f1f598e..d59f1b055 100644 --- a/packages/backend/migration/1697603945000-BotTrending.js +++ b/packages/backend/migration/1697603945000-BotTrending.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697624010000-isSilenced.js b/packages/backend/migration/1697624010000-isSilenced.js index 98b5e8c55..16749b54c 100644 --- a/packages/backend/migration/1697624010000-isSilenced.js +++ b/packages/backend/migration/1697624010000-isSilenced.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697970083000-alterNoteEdit.js b/packages/backend/migration/1697970083000-alterNoteEdit.js index 11accb3c5..0aa4f8fa9 100644 --- a/packages/backend/migration/1697970083000-alterNoteEdit.js +++ b/packages/backend/migration/1697970083000-alterNoteEdit.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class AlterNoteEdit1697970083000 { name = "AlterNoteEdit1697970083000"; diff --git a/packages/backend/migration/1697970083001-oldDateNoteEdit.js b/packages/backend/migration/1697970083001-oldDateNoteEdit.js index 17565a091..c21f62c48 100644 --- a/packages/backend/migration/1697970083001-oldDateNoteEdit.js +++ b/packages/backend/migration/1697970083001-oldDateNoteEdit.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class OldDateNoteEdit1697970083001 { name = "OldDateNoteEdit1697970083001"; diff --git a/packages/backend/migration/1699376974000-isIndexable.js b/packages/backend/migration/1699376974000-isIndexable.js index ae826924a..7919b36c5 100644 --- a/packages/backend/migration/1699376974000-isIndexable.js +++ b/packages/backend/migration/1699376974000-isIndexable.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class IsIndexable1699376974000 { name = 'IsIndexable1699376974000' diff --git a/packages/backend/migration/1699819257000-defaultLike.js b/packages/backend/migration/1699819257000-defaultLike.js index 45492fa6c..a91926698 100644 --- a/packages/backend/migration/1699819257000-defaultLike.js +++ b/packages/backend/migration/1699819257000-defaultLike.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class instanceDefaultLike1699819257000 { name = 'instanceDefaultLike1699819257000' diff --git a/packages/backend/migration/1700228972000-update-indexable.js b/packages/backend/migration/1700228972000-update-indexable.js index e724e2ec7..1d46fd08f 100644 --- a/packages/backend/migration/1700228972000-update-indexable.js +++ b/packages/backend/migration/1700228972000-update-indexable.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class UpdateIndexable1700228972000 { name = 'UpdateIndexable1700228972000' diff --git a/packages/backend/migration/1701647674000-BubbleInstances.js b/packages/backend/migration/1701647674000-BubbleInstances.js index 9928b4c36..f048f521b 100644 --- a/packages/backend/migration/1701647674000-BubbleInstances.js +++ b/packages/backend/migration/1701647674000-BubbleInstances.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class BubbleInstances1701647674000 { name = 'BubbleInstances1701647674000' diff --git a/packages/backend/migration/1701809447000-NSFW-Instance.js b/packages/backend/migration/1701809447000-NSFW-Instance.js index 882aa9865..51075517b 100644 --- a/packages/backend/migration/1701809447000-NSFW-Instance.js +++ b/packages/backend/migration/1701809447000-NSFW-Instance.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class NSFWInstance1701809447000 { name = 'NSFWInstance1701809447000' diff --git a/packages/backend/migration/1704744370000-add-donation-url.js b/packages/backend/migration/1704744370000-add-donation-url.js index c953b13cc..ead22c6a9 100644 --- a/packages/backend/migration/1704744370000-add-donation-url.js +++ b/packages/backend/migration/1704744370000-add-donation-url.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: nila and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class AddDonationUrl1704744370000 { name = 'AddDonationUrl1704744370000' diff --git a/packages/backend/migration/1706232992000-deeplx.js b/packages/backend/migration/1706232992000-deeplx.js index 5c763dbf8..17ddbef26 100644 --- a/packages/backend/migration/1706232992000-deeplx.js +++ b/packages/backend/migration/1706232992000-deeplx.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/NoteEdit.ts b/packages/backend/src/models/NoteEdit.ts index 9ec989dd5..cfd9ad748 100644 --- a/packages/backend/src/models/NoteEdit.ts +++ b/packages/backend/src/models/NoteEdit.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Entity, JoinColumn, Column, ManyToOne, PrimaryColumn, Index } from "typeorm"; import { id } from './util/id.js'; import { MiNote } from './Note.js'; diff --git a/packages/backend/src/models/json-schema/note-edit.ts b/packages/backend/src/models/json-schema/note-edit.ts index a58e2aa1d..ba936f866 100644 --- a/packages/backend/src/models/json-schema/note-edit.ts +++ b/packages/backend/src/models/json-schema/note-edit.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export const packedNoteEdit = { type: "object", properties: { diff --git a/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts b/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts index a6892134b..33a2362c4 100644 --- a/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import * as fs from 'node:fs'; import { Inject, Injectable } from '@nestjs/common'; import { In, IsNull, MoreThan, Not } from 'typeorm'; diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts index 58a0ea10a..f89dc4672 100644 --- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import * as fs from 'node:fs'; import * as fsp from 'node:fs/promises'; import * as crypto from 'node:crypto'; diff --git a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts index 2a47abe03..d3fa4251d 100644 --- a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index 007bed5c0..7e6045049 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts index 013e7771b..26588365e 100644 --- a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 5e514ccda..f92be0d8e 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/i/import-notes.ts b/packages/backend/src/server/api/endpoints/i/import-notes.ts index 4e0016355..91ef12c3e 100644 --- a/packages/backend/src/server/api/endpoints/i/import-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/import-notes.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; @@ -59,7 +64,7 @@ export default class extends Endpoint { // eslint- const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId }); if (file == null) throw new ApiError(meta.errors.noSuchFile); - + if (file.size === 0) throw new ApiError(meta.errors.emptyFile); if ((await this.roleService.getUserPolicies(me.id)).canImportNotes === false) { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts index bb471284c..3aa256077 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { RegistryItemsRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/sponsors.ts b/packages/backend/src/server/api/endpoints/sponsors.ts index 50e1c594f..b6ccb9b2f 100644 --- a/packages/backend/src/server/api/endpoints/sponsors.ts +++ b/packages/backend/src/server/api/endpoints/sponsors.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import { Endpoint } from '@/server/api/endpoint-base.js'; diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index 5706a1778..8c9cca173 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import megalodon, { Entity, MegalodonInterface } from 'megalodon'; import querystring from 'querystring'; @@ -89,7 +94,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/instance', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -113,7 +118,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/announcements', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -126,7 +131,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.post<{ Body: { id: string } }>('/v1/announcements/:id/dismiss', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -177,8 +182,8 @@ export class MastodonApiServerService { /* console.error(e); */ reply.code(401).send(e.response.data); } - }); - + }); + fastify.get('/v1/filters', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -192,7 +197,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/trends', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -238,7 +243,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/preferences', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -291,18 +296,18 @@ export class MastodonApiServerService { user: { id: tokeninfo.userId, host: null }, path: avatar.path, name: avatar.originalname !== null && avatar.originalname !== 'file' ? avatar.originalname : undefined, - sensitive: false, + sensitive: false, }); if (upload.type.startsWith('image/')) { // eslint-disable-next-line @typescript-eslint/no-explicit-any (_request.body as any).avatar = upload.id; } - } else if (tokeninfo && header) { + } else if (tokeninfo && header) { const upload = await this.driveService.addFile({ user: { id: tokeninfo.userId, host: null }, path: header.path, name: header.originalname !== null && header.originalname !== 'file' ? header.originalname : undefined, - sensitive: false, + sensitive: false, }); if (upload.type.startsWith('image/')) { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -324,7 +329,7 @@ export class MastodonApiServerService { }; }); // eslint-disable-next-line @typescript-eslint/no-explicit-any - (_request.body as any).fields_attributes = fields.filter((field: any) => field.name.trim().length > 0 && field.value.length > 0); + (_request.body as any).fields_attributes = fields.filter((field: any) => field.name.trim().length > 0 && field.value.length > 0); } const data = await client.updateCredentials(_request.body!); diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index cca950584..405701e82 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Entity } from 'megalodon'; import mfm from '@transfem-org/sfm-js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints.ts b/packages/backend/src/server/api/mastodon/endpoints.ts index 5a7582389..085314059 100644 --- a/packages/backend/src/server/api/mastodon/endpoints.ts +++ b/packages/backend/src/server/api/mastodon/endpoints.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { ApiAuthMastodon } from './endpoints/auth.js'; import { ApiAccountMastodon } from './endpoints/account.js'; import { ApiSearchMastodon } from './endpoints/search.js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 07d9efb8c..6fcfb0019 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { MastoConverters, convertRelationship } from '../converters.js'; import { argsToBools, limitToInt } from './timeline.js'; import type { MegalodonInterface } from 'megalodon'; @@ -104,7 +109,7 @@ export class ApiAccountMastodon { public async getFollowers() { try { const data = await this.client.getAccountFollowers( - (this.request.params as any).id, + (this.request.params as any).id, limitToInt(this.request.query as any), ); return await Promise.all(data.data.map(async (account) => await this.mastoconverter.convertAccount(account))); @@ -118,7 +123,7 @@ export class ApiAccountMastodon { public async getFollowing() { try { const data = await this.client.getAccountFollowing( - (this.request.params as any).id, + (this.request.params as any).id, limitToInt(this.request.query as any), ); return await Promise.all(data.data.map(async (account) => await this.mastoconverter.convertAccount(account))); diff --git a/packages/backend/src/server/api/mastodon/endpoints/auth.ts b/packages/backend/src/server/api/mastodon/endpoints/auth.ts index 80a5e89ca..a447bdb1b 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/auth.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/auth.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import type { MegalodonInterface } from 'megalodon'; import type { FastifyRequest } from 'fastify'; @@ -65,7 +70,7 @@ export async function ApiAuthMastodon(request: FastifyRequest, client: Megalodon client_id: Buffer.from(appData.url || '').toString('base64'), client_secret: appData.clientSecret, }; - + return returns; } catch (e: any) { console.error(e); diff --git a/packages/backend/src/server/api/mastodon/endpoints/filter.ts b/packages/backend/src/server/api/mastodon/endpoints/filter.ts index 212c79b25..ce6809d23 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/filter.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/filter.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { convertFilter } from '../converters.js'; import type { MegalodonInterface } from 'megalodon'; import type { FastifyRequest } from 'fastify'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/meta.ts b/packages/backend/src/server/api/mastodon/endpoints/meta.ts index efb39ef93..79d2c62a2 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/meta.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/meta.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Entity } from 'megalodon'; import { FILE_TYPE_BROWSERSAFE } from '@/const.js'; import type { Config } from '@/config.js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts index c4628b58c..0eefb5894 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { convertNotification } from '../converters.js'; import type { MegalodonInterface, Entity } from 'megalodon'; import type { FastifyRequest } from 'fastify'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/search.ts b/packages/backend/src/server/api/mastodon/endpoints/search.ts index 500129c90..946e796e2 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/search.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/search.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { MastoConverters } from '../converters.js'; import { limitToInt } from './timeline.js'; import type { MegalodonInterface } from 'megalodon'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index fe77646af..ddc99639f 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import querystring from 'querystring'; import { emojiRegexAtStartToEnd } from '@/misc/emoji-regex.js'; import { convertAttachment, convertPoll, convertStatusSource, MastoConverters } from '../converters.js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index f81b63b9a..3eb489871 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { ParsedUrlQuery } from 'querystring'; import { convertConversation, convertList, MastoConverters } from '../converters.js'; import { getClient } from '../MastodonApiServerService.js'; diff --git a/packages/frontend/src/components/CkFollowMouse.vue b/packages/frontend/src/components/CkFollowMouse.vue index b55a577b3..ce7e3c79a 100644 --- a/packages/frontend/src/components/CkFollowMouse.vue +++ b/packages/frontend/src/components/CkFollowMouse.vue @@ -1,3 +1,8 @@ + +