refactor: APIエンドポイントファイルの定義を良い感じにする (#8154)
* Fix API Schema Error * Delete SimpleSchema/SimpleObj and Move schemas to dedicated files * Userのスキーマを分割してみる * define packMany type * add , * Ensure enum schema and Make "as const" put once * test? * Revert "test?" This reverts commit 97dc9bfa70851bfb7d1cf38e883f8df20fb78b79. * Revert "Fix API Schema Error" This reverts commit 21b6176d974ed8e3eb73723ad21a105c5d297323. * ✌️ * clean up * test? * wip * wip * better schema def * ✌️ * fix * add minLength property * wip * wip * wip * anyOf/oneOf/allOfに対応? ~ relation.ts * refactor! * Define MinimumSchema * wip * wip * anyOf/oneOf/allOfが動作するようにUnionSchemaTypeを修正 * anyOf/oneOf/allOfが動作するようにUnionSchemaTypeを修正 * Update packages/backend/src/misc/schema.ts Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com> * fix * array oneOfをより正確な型に * array oneOfをより正確な型に * wip * ✌️ * なんかもういろいろ * remove * very good schema * api schema * wip * refactor: awaitAllの型定義を変えてみる * fix * specify types in awaitAll * specify types in awaitAll * ✌️ * wip * ... * ✌️ * AllowDateはやめておく * 不必要なoptional: false, nullable: falseを廃止 * Packedが展開されないように * 続packed * wip * define note type * wip * UserDetailedをMeDetailedかUserDetailedNotMeかを区別できるように * wip * wip * wip specify user type of other schemas * ok * convertSchemaToOpenApiSchemaを改修 * convertSchemaToOpenApiSchemaを改修 * Fix * fix * ✌️ * wip * 分割代入ではなくallOfで定義するように Co-authored-by: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
This commit is contained in:
@ -12,7 +12,7 @@ import { generateMutedInstanceQuery } from '../../common/generate-muted-instance
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -34,15 +34,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -9,7 +9,7 @@ import { In } from 'typeorm';
|
||||
export const meta = {
|
||||
tags: ['clips', 'notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -18,12 +18,12 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
ref: 'Note',
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Clip',
|
||||
},
|
||||
},
|
||||
|
||||
@ -34,7 +34,7 @@ export const meta = {
|
||||
id: '47db1a1c-b0af-458d-8fb4-986e4efafe1e',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, me) => {
|
||||
|
@ -9,7 +9,7 @@ import { Notes } from '@/models/index';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -28,11 +28,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -44,7 +44,7 @@ export const meta = {
|
||||
id: 'e1035875-9551-45ec-afa8-1ded1fcb53c8',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -25,7 +25,7 @@ setInterval(() => {
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
limit: {
|
||||
duration: ms('1hour'),
|
||||
@ -113,12 +113,12 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
createdNote: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -173,7 +173,7 @@ export const meta = {
|
||||
id: 'b390d7e1-8a5e-46ed-b625-06271cafd3d3',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -10,7 +10,7 @@ import { Users } from '@/models/index';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:notes',
|
||||
|
||||
@ -39,7 +39,7 @@ export const meta = {
|
||||
id: 'fe8d7103-0ea8-4ec3-814d-f8b401dc69e9',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -9,7 +9,7 @@ import { genId } from '@/misc/gen-id';
|
||||
export const meta = {
|
||||
tags: ['notes', 'favorites'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:favorites',
|
||||
|
||||
@ -32,7 +32,7 @@ export const meta = {
|
||||
id: 'a402c12b-34dd-41d2-97d8-4d2ffd96a1a6',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -8,7 +8,7 @@ import { NoteFavorites } from '@/models/index';
|
||||
export const meta = {
|
||||
tags: ['notes', 'favorites'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:favorites',
|
||||
|
||||
@ -31,7 +31,7 @@ export const meta = {
|
||||
id: 'b625fc69-635e-45e9-86f4-dbefbef35af5',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -7,7 +7,7 @@ import { generateBlockedUserQuery } from '../../common/generate-block-query';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
limit: {
|
||||
@ -22,15 +22,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -43,11 +43,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -59,7 +59,7 @@ export const meta = {
|
||||
id: '0332fc13-6ab2-4427-ae80-a9fadffd1a6b',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -18,7 +18,7 @@ import { generateBlockedUserQuery } from '../../common/generate-block-query';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
limit: {
|
||||
@ -63,11 +63,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -79,7 +79,7 @@ export const meta = {
|
||||
id: '620763f4-f621-4533-ab33-0577a1a3c342',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -54,11 +54,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -70,7 +70,7 @@ export const meta = {
|
||||
id: '45a6eb02-7695-4393-b023-dd3be9aaaefd',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -13,7 +13,7 @@ import { generateMutedNoteThreadQuery } from '../../common/generate-muted-note-t
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
following: {
|
||||
@ -40,15 +40,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -6,7 +6,7 @@ import { Brackets, In } from 'typeorm';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
limit: {
|
||||
@ -21,15 +21,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -17,7 +17,7 @@ import { genId } from '@/misc/gen-id';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:votes',
|
||||
|
||||
@ -68,7 +68,7 @@ export const meta = {
|
||||
id: '85a5377e-b1e9-4617-b0b9-5bea73331e49',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -10,7 +10,7 @@ import { NoteReaction } from '@/models/entities/note-reaction';
|
||||
export const meta = {
|
||||
tags: ['notes', 'reactions'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -41,11 +41,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'NoteReaction',
|
||||
},
|
||||
},
|
||||
@ -57,7 +57,7 @@ export const meta = {
|
||||
id: '263fff3d-d0e1-4af4-bea7-8408059b451a',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -8,7 +8,7 @@ import { ApiError } from '../../../error';
|
||||
export const meta = {
|
||||
tags: ['reactions', 'notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:reactions',
|
||||
|
||||
@ -41,7 +41,7 @@ export const meta = {
|
||||
id: '20ef5475-9f38-4e4c-bd33-de6d979498ec',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -9,7 +9,7 @@ import { ApiError } from '../../../error';
|
||||
export const meta = {
|
||||
tags: ['reactions', 'notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:reactions',
|
||||
|
||||
@ -38,7 +38,7 @@ export const meta = {
|
||||
id: '92f4426d-4196-4125-aa5b-02943e2ec8fc',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -12,7 +12,7 @@ import { generateBlockedUserQuery } from '../../common/generate-block-query';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -34,11 +34,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -50,7 +50,7 @@ export const meta = {
|
||||
id: '12908022-2e21-46cd-ba6a-3edaf6093f46',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -10,7 +10,7 @@ import { generateBlockedUserQuery } from '../../common/generate-block-query';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -32,15 +32,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -56,15 +56,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, me) => {
|
||||
|
@ -13,7 +13,7 @@ import { generateBlockedUserQuery } from '../../common/generate-block-query';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
query: {
|
||||
@ -50,18 +50,18 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
|
||||
errors: {
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, me) => {
|
||||
|
@ -8,7 +8,7 @@ import { Notes } from '@/models/index';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -17,8 +17,8 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
|
||||
@ -29,7 +29,7 @@ export const meta = {
|
||||
id: '24fcbfc6-2e37-42b6-8388-c29b3861a08d',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -6,7 +6,7 @@ import { NoteFavorites, Notes, NoteThreadMutings, NoteWatchings } from '@/models
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -15,24 +15,24 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
properties: {
|
||||
isFavorited: {
|
||||
type: 'boolean' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
isWatching: {
|
||||
type: 'boolean' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
isMutedThread: {
|
||||
type: 'boolean' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'boolean',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -10,7 +10,7 @@ import readNote from '@/services/note/read';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:account',
|
||||
|
||||
@ -27,7 +27,7 @@ export const meta = {
|
||||
id: '5ff67ada-ed3b-2e71-8e87-a1a421e177d2',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -8,7 +8,7 @@ import { NoteThreadMutings } from '@/models';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:account',
|
||||
|
||||
@ -25,7 +25,7 @@ export const meta = {
|
||||
id: 'bddd57ac-ceb3-b29d-4334-86ea5fae481a',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -16,7 +16,7 @@ import { generateBlockedUserQuery } from '../../common/generate-block-query';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
limit: {
|
||||
@ -61,15 +61,15 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -13,7 +13,7 @@ import { Notes } from '@/models';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: false as const,
|
||||
requireCredential: false,
|
||||
|
||||
params: {
|
||||
noteId: {
|
||||
@ -25,8 +25,8 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
},
|
||||
|
||||
errors: {
|
||||
@ -36,7 +36,7 @@ export const meta = {
|
||||
id: 'bea9b03f-36e0-49c5-a4db-627a029f8971',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -10,7 +10,7 @@ import { Notes, Users } from '@/models/index';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:notes',
|
||||
|
||||
@ -33,7 +33,7 @@ export const meta = {
|
||||
id: 'efd4a259-2442-496b-8dd7-b255aa1a160f',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -11,7 +11,7 @@ import { Brackets } from 'typeorm';
|
||||
export const meta = {
|
||||
tags: ['notes', 'lists'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
params: {
|
||||
listId: {
|
||||
@ -60,11 +60,11 @@ export const meta = {
|
||||
},
|
||||
|
||||
res: {
|
||||
type: 'array' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'array',
|
||||
optional: false, nullable: false,
|
||||
items: {
|
||||
type: 'object' as const,
|
||||
optional: false as const, nullable: false as const,
|
||||
type: 'object',
|
||||
optional: false, nullable: false,
|
||||
ref: 'Note',
|
||||
},
|
||||
},
|
||||
@ -76,7 +76,7 @@ export const meta = {
|
||||
id: '8fb1fbd5-e476-4c37-9fb0-43d55b63a2ff',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -8,7 +8,7 @@ import { ApiError } from '../../../error';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:account',
|
||||
|
||||
@ -25,7 +25,7 @@ export const meta = {
|
||||
id: 'ea0e37a6-90a3-4f58-ba6b-c328ca206fc7',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
@ -8,7 +8,7 @@ import { ApiError } from '../../../error';
|
||||
export const meta = {
|
||||
tags: ['notes'],
|
||||
|
||||
requireCredential: true as const,
|
||||
requireCredential: true,
|
||||
|
||||
kind: 'write:account',
|
||||
|
||||
@ -25,7 +25,7 @@ export const meta = {
|
||||
id: '09b3695c-f72c-4731-a428-7cff825fc82e',
|
||||
},
|
||||
},
|
||||
};
|
||||
} as const;
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default define(meta, async (ps, user) => {
|
||||
|
Reference in New Issue
Block a user