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 b6b4f90913..2645b12630 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 55a0de0206..e67b1c566d 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 fe6265e3f5..f06017468a 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 2c20971ff5..1ee08de146 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 d68b9401bf..b9ba95e2fa 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 59309b98c2..f1c0b5a4a5 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 c5f8255d49..cc53a6bb5c 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 73f1f598ed..d59f1b0552 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 98b5e8c55c..16749b54cf 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 11accb3c54..0aa4f8fa9c 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 17565a0914..c21f62c486 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 ae826924a8..7919b36c5d 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 45492fa6c6..a91926698a 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 e724e2ec7e..1d46fd08fd 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 9928b4c36e..f048f521b0 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 882aa9865d..51075517b0 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 c953b13cc9..ead22c6a95 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 5c763dbf8b..17ddbef26a 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 9ec989dd50..cfd9ad748e 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 a58e2aa1de..ba936f866b 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 a6892134bc..33a2362c4a 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 58a0ea10ad..f89dc46722 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 2a47abe03c..d3fa4251dd 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 007bed5c03..7e6045049a 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 013e7771ba..26588365e1 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 5e514ccda6..f92be0d8e0 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 4e00163550..91ef12c3e3 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 bb471284c9..3aa256077e 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 50e1c594f2..b6ccb9b2f9 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 5706a17786..8c9cca1730 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 cca9505846..405701e826 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 5a75823891..085314059b 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 07d9efb8c1..6fcfb0019c 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 80a5e89ca3..a447bdb1b7 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 212c79b251..ce6809d230 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 efb39ef939..79d2c62a24 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 c4628b58c4..0eefb5894c 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 500129c901..946e796e2a 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 fe77646af4..ddc99639fa 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 f81b63b9ac..3eb4898713 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 b55a577b3f..ce7e3c79a8 100644 --- a/packages/frontend/src/components/CkFollowMouse.vue +++ b/packages/frontend/src/components/CkFollowMouse.vue @@ -1,3 +1,8 @@ + +