summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.editorconfig1
-rw-r--r--.gitattributes1
-rw-r--r--.github/workflows/check_copyright_year.yml36
-rw-r--r--.github/workflows/lint.yml108
-rw-r--r--packages/backend/src/server/api/endpoints/clips/remove-note.ts144
-rw-r--r--packages/frontend/assets/label-red.svg12
-rw-r--r--packages/frontend/assets/label.svg12
-rw-r--r--packages/frontend/assets/unread.svg14
8 files changed, 165 insertions, 163 deletions
diff --git a/.editorconfig b/.editorconfig
index edccf3a9d5..6db1367645 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -5,6 +5,7 @@ indent_style = tab
indent_size = 2
charset = utf-8
insert_final_newline = true
+end_of_line = lf
[*.yml]
indent_style = space
diff --git a/.gitattributes b/.gitattributes
index a175917f31..246ecb0a60 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -5,3 +5,4 @@
*.glb -diff -text
*.blend -diff -text
*.afdesign -diff -text
+* text=auto eol=lf
diff --git a/.github/workflows/check_copyright_year.yml b/.github/workflows/check_copyright_year.yml
index 99799672f2..8daea44a83 100644
--- a/.github/workflows/check_copyright_year.yml
+++ b/.github/workflows/check_copyright_year.yml
@@ -1,18 +1,18 @@
-name: Check copyright year
-
-on:
- push:
- branches:
- - master
- - develop
-
-jobs:
- check_copyright_year:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3.2.0
- - run: |
- if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then
- echo "Please change copyright year!"
- exit 1
- fi
+name: Check copyright year
+
+on:
+ push:
+ branches:
+ - master
+ - develop
+
+jobs:
+ check_copyright_year:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3.2.0
+ - run: |
+ if [ "$(grep Copyright COPYING | sed -e 's/.*2014-\([0-9]*\) .*/\1/g')" -ne "$(date +%Y)" ]; then
+ echo "Please change copyright year!"
+ exit 1
+ fi
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index b88b97ab0c..6a579bffc8 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -1,54 +1,54 @@
-name: Lint
-
-on:
- push:
- branches:
- - master
- - develop
- pull_request:
-
-jobs:
- pnpm_install:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v3.3.0
- with:
- fetch-depth: 0
- submodules: true
- - uses: pnpm/action-setup@v2
- with:
- version: 7
- run_install: false
- - uses: actions/setup-node@v3.6.0
- with:
- node-version: 18.x
- cache: 'pnpm'
- - run: corepack enable
- - run: pnpm i --frozen-lockfile
-
- lint:
- needs: [pnpm_install]
- runs-on: ubuntu-latest
- continue-on-error: true
- strategy:
- matrix:
- workspace:
- - backend
- - frontend
- - sw
- steps:
- - uses: actions/checkout@v3.3.0
- with:
- fetch-depth: 0
- submodules: true
- - uses: pnpm/action-setup@v2
- with:
- version: 7
- run_install: false
- - uses: actions/setup-node@v3.6.0
- with:
- node-version: 18.x
- cache: 'pnpm'
- - run: corepack enable
- - run: pnpm i --frozen-lockfile
- - run: pnpm --filter ${{ matrix.workspace }} run lint
+name: Lint
+
+on:
+ push:
+ branches:
+ - master
+ - develop
+ pull_request:
+
+jobs:
+ pnpm_install:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3.3.0
+ with:
+ fetch-depth: 0
+ submodules: true
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 7
+ run_install: false
+ - uses: actions/setup-node@v3.6.0
+ with:
+ node-version: 18.x
+ cache: 'pnpm'
+ - run: corepack enable
+ - run: pnpm i --frozen-lockfile
+
+ lint:
+ needs: [pnpm_install]
+ runs-on: ubuntu-latest
+ continue-on-error: true
+ strategy:
+ matrix:
+ workspace:
+ - backend
+ - frontend
+ - sw
+ steps:
+ - uses: actions/checkout@v3.3.0
+ with:
+ fetch-depth: 0
+ submodules: true
+ - uses: pnpm/action-setup@v2
+ with:
+ version: 7
+ run_install: false
+ - uses: actions/setup-node@v3.6.0
+ with:
+ node-version: 18.x
+ cache: 'pnpm'
+ - run: corepack enable
+ - run: pnpm i --frozen-lockfile
+ - run: pnpm --filter ${{ matrix.workspace }} run lint
diff --git a/packages/backend/src/server/api/endpoints/clips/remove-note.ts b/packages/backend/src/server/api/endpoints/clips/remove-note.ts
index 55778c7ecb..5d88870ed2 100644
--- a/packages/backend/src/server/api/endpoints/clips/remove-note.ts
+++ b/packages/backend/src/server/api/endpoints/clips/remove-note.ts
@@ -1,72 +1,72 @@
-import { Inject, Injectable } from '@nestjs/common';
-import { Endpoint } from '@/server/api/endpoint-base.js';
-import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js';
-import { DI } from '@/di-symbols.js';
-import { ApiError } from '../../error.js';
-import { GetterService } from '@/server/api/GetterService.js';
-
-export const meta = {
- tags: ['account', 'notes', 'clips'],
-
- requireCredential: true,
-
- kind: 'write:account',
-
- errors: {
- noSuchClip: {
- message: 'No such clip.',
- code: 'NO_SUCH_CLIP',
- id: 'b80525c6-97f7-49d7-a42d-ebccd49cfd52',
- },
-
- noSuchNote: {
- message: 'No such note.',
- code: 'NO_SUCH_NOTE',
- id: 'aff017de-190e-434b-893e-33a9ff5049d8',
- },
- },
-} as const;
-
-export const paramDef = {
- type: 'object',
- properties: {
- clipId: { type: 'string', format: 'misskey:id' },
- noteId: { type: 'string', format: 'misskey:id' },
- },
- required: ['clipId', 'noteId'],
-} as const;
-
-// eslint-disable-next-line import/no-default-export
-@Injectable()
-export default class extends Endpoint<typeof meta, typeof paramDef> {
- constructor(
- @Inject(DI.clipsRepository)
- private clipsRepository: ClipsRepository,
-
- @Inject(DI.clipNotesRepository)
- private clipNotesRepository: ClipNotesRepository,
-
- private getterService: GetterService,
- ) {
- super(meta, paramDef, async (ps, me) => {
- const clip = await this.clipsRepository.findOneBy({
- id: ps.clipId,
- userId: me.id,
- });
-
- if (clip == null) {
- throw new ApiError(meta.errors.noSuchClip);
- }
-
- const note = await this.getterService.getNote(ps.noteId).catch(err => {
- if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
- throw err;
- });
-
- await this.clipNotesRepository.delete({
- noteId: note.id,
- clipId: clip.id,
- });
- });
- }
-}
+import { Inject, Injectable } from '@nestjs/common';
+import { Endpoint } from '@/server/api/endpoint-base.js';
+import type { ClipNotesRepository, ClipsRepository } from '@/models/index.js';
+import { DI } from '@/di-symbols.js';
+import { ApiError } from '../../error.js';
+import { GetterService } from '@/server/api/GetterService.js';
+
+export const meta = {
+ tags: ['account', 'notes', 'clips'],
+
+ requireCredential: true,
+
+ kind: 'write:account',
+
+ errors: {
+ noSuchClip: {
+ message: 'No such clip.',
+ code: 'NO_SUCH_CLIP',
+ id: 'b80525c6-97f7-49d7-a42d-ebccd49cfd52',
+ },
+
+ noSuchNote: {
+ message: 'No such note.',
+ code: 'NO_SUCH_NOTE',
+ id: 'aff017de-190e-434b-893e-33a9ff5049d8',
+ },
+ },
+} as const;
+
+export const paramDef = {
+ type: 'object',
+ properties: {
+ clipId: { type: 'string', format: 'misskey:id' },
+ noteId: { type: 'string', format: 'misskey:id' },
+ },
+ required: ['clipId', 'noteId'],
+} as const;
+
+// eslint-disable-next-line import/no-default-export
+@Injectable()
+export default class extends Endpoint<typeof meta, typeof paramDef> {
+ constructor(
+ @Inject(DI.clipsRepository)
+ private clipsRepository: ClipsRepository,
+
+ @Inject(DI.clipNotesRepository)
+ private clipNotesRepository: ClipNotesRepository,
+
+ private getterService: GetterService,
+ ) {
+ super(meta, paramDef, async (ps, me) => {
+ const clip = await this.clipsRepository.findOneBy({
+ id: ps.clipId,
+ userId: me.id,
+ });
+
+ if (clip == null) {
+ throw new ApiError(meta.errors.noSuchClip);
+ }
+
+ const note = await this.getterService.getNote(ps.noteId).catch(err => {
+ if (err.id === '9725d0ce-ba28-4dde-95a7-2cbb2c15de24') throw new ApiError(meta.errors.noSuchNote);
+ throw err;
+ });
+
+ await this.clipNotesRepository.delete({
+ noteId: note.id,
+ clipId: clip.id,
+ });
+ });
+ }
+}
diff --git a/packages/frontend/assets/label-red.svg b/packages/frontend/assets/label-red.svg
index 45996aa9ce..c89d3f5f3a 100644
--- a/packages/frontend/assets/label-red.svg
+++ b/packages/frontend/assets/label-red.svg
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
- y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve">
-<polygon fill="#ea2412" points="0,45.255 45.254,0 84.854,0 0,84.854 "/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve">
+<polygon fill="#ea2412" points="0,45.255 45.254,0 84.854,0 0,84.854 "/>
+</svg>
diff --git a/packages/frontend/assets/label.svg b/packages/frontend/assets/label.svg
index b1f85f3c07..997335f505 100644
--- a/packages/frontend/assets/label.svg
+++ b/packages/frontend/assets/label.svg
@@ -1,6 +1,6 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
- y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve">
-<polygon fill="#0B8AEA" points="0,45.255 45.254,0 84.854,0 0,84.854 "/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="96px" height="96px" viewBox="0 0 96 96" enable-background="new 0 0 96 96" xml:space="preserve">
+<polygon fill="#0B8AEA" points="0,45.255 45.254,0 84.854,0 0,84.854 "/>
+</svg>
diff --git a/packages/frontend/assets/unread.svg b/packages/frontend/assets/unread.svg
index 8c3cc9f475..8bd4156e51 100644
--- a/packages/frontend/assets/unread.svg
+++ b/packages/frontend/assets/unread.svg
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
- y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
-<circle fill="#3AA2DC" cx="16.5" cy="16.5" r="6"/>
-</svg>
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
+ y="0px" width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
+<circle fill="#3AA2DC" cx="16.5" cy="16.5" r="6"/>
+</svg>