Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
syuilo committed Apr 3, 2022
2 parents 5abe05d + 395fe7e commit 090f8ef
Show file tree
Hide file tree
Showing 39 changed files with 315 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
submodules: true
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 16.x
- uses: actions/cache@v2
with:
path: '**/node_modules'
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
You should also include the user name that made the change.
-->

## 12.109.2 (2022/04/03)

### Bugfixes
- API: admin/update-meta was not working @syuilo
- Client: テーマを切り替えたり読み込んだりするとmeta[name="theme-color"]のcontentがundefinedになる問題を修正 @tamaina

## 12.109.1 (2022/04/02)

### Bugfixes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "12.109.1",
"version": "12.109.2",
"codename": "indigo",
"repository": {
"type": "git",
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"build": "tsc -p tsconfig.json || echo done. && tsc-alias -p tsconfig.json",
"watch": "node watch.mjs",
"lint": "eslint --quiet src/**/*.ts",
"lint": "eslint --quiet 'src/**/*.ts'",
"mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
"test": "npm run mocha"
},
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/models/schema/emoji.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const packedEmojiSchema = {
host: {
type: 'string',
optional: false, nullable: true,
description: 'The local host is represented with `null`.',
},
url: {
type: 'string',
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/models/schema/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const packedUserLiteSchema = {
type: 'string',
nullable: true, optional: false,
example: 'misskey.example.com',
description: 'The local host is represented with `null`.',
},
avatarUrl: {
type: 'string',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ export const paramDef = {
untilId: { type: 'string', format: 'misskey:id' },
type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) },
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: "local" },
hostname: { type: 'string', nullable: true, default: null },
hostname: {
type: 'string',
nullable: true,
default: null,
description: 'The local host is represented with `null`.',
},
},
required: [],
} as const;
Expand Down
20 changes: 15 additions & 5 deletions packages/backend/src/server/api/endpoints/admin/drive/show-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const meta = {
userHost: {
type: 'string',
optional: false, nullable: true,
description: 'The local host is represented with `null`.',
},
md5: {
type: 'string',
Expand Down Expand Up @@ -151,11 +152,20 @@ export const meta = {

export const paramDef = {
type: 'object',
properties: {
fileId: { type: 'string', format: 'misskey:id' },
url: { type: 'string' },
},
required: [],
anyOf: [
{
properties: {
fileId: { type: 'string', format: 'misskey:id' },
},
required: ['fileId'],
},
{
properties: {
url: { type: 'string' },
},
required: ['url'],
},
],
} as const;

// eslint-disable-next-line import/no-default-export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const meta = {
host: {
type: 'string',
optional: false, nullable: true,
description: 'The local host is represented with `null`.',
},
url: {
type: 'string',
Expand All @@ -54,7 +55,12 @@ export const paramDef = {
type: 'object',
properties: {
query: { type: 'string', nullable: true, default: null },
host: { type: 'string', nullable: true, default: null },
host: {
type: 'string',
nullable: true,
default: null,
description: 'Use `null` to represent the local host.',
},
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' },
Expand Down
5 changes: 3 additions & 2 deletions packages/backend/src/server/api/endpoints/admin/emoji/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ export const meta = {
optional: false, nullable: true,
},
host: {
type: 'string',
optional: false, nullable: true,
type: 'null',
optional: false,
description: 'The local host is represented with `null`. The field exists for compatibility with other API endpoints that return files.',
},
url: {
type: 'string',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export const paramDef = {
ids: { type: 'array', items: {
type: 'string', format: 'misskey:id',
} },
category: { type: 'string', nullable: true },
category: {
type: 'string',
nullable: true,
description: 'Use `null` to reset the category.',
},
},
required: ['ids'],
} as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export const paramDef = {
properties: {
id: { type: 'string', format: 'misskey:id' },
name: { type: 'string' },
category: { type: 'string', nullable: true },
category: {
type: 'string',
nullable: true,
description: 'Use `null` to reset the category.',
},
aliases: { type: 'array', items: {
type: 'string',
} },
Expand Down
9 changes: 7 additions & 2 deletions packages/backend/src/server/api/endpoints/admin/show-users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ export const paramDef = {
sort: { type: 'string', enum: ['+follower', '-follower', '+createdAt', '-createdAt', '+updatedAt', '-updatedAt'] },
state: { type: 'string', enum: ['all', 'available', 'admin', 'moderator', 'adminOrModerator', 'silenced', 'suspended'], default: "all" },
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: "local" },
username: { type: 'string', default: null },
hostname: { type: 'string', default: null },
username: { type: 'string', nullable: true, default: null },
hostname: {
type: 'string',
nullable: true,
default: null,
description: 'The local host is represented with `null`.',
},
},
required: [],
} as const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,14 @@ export default define(meta, paramDef, async (ps, me) => {
}

await db.transaction(async transactionalEntityManager => {
const meta = await transactionalEntityManager.findOne(Meta, {
const metas = await transactionalEntityManager.find(Meta, {
order: {
id: 'DESC',
},
});

const meta = metas[0];

if (meta) {
await transactionalEntityManager.update(Meta, meta.id, set);
} else {
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion packages/backend/src/server/api/endpoints/clips/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const paramDef = {
type: 'object',
properties: {
name: { type: 'string', minLength: 1, maxLength: 100 },
isPublic: { type: 'boolean' },
isPublic: { type: 'boolean', default: false },
description: { type: 'string', nullable: true, minLength: 1, maxLength: 2048 },
},
required: ['name'],
Expand Down
27 changes: 14 additions & 13 deletions packages/backend/src/server/api/endpoints/drive/files/show.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,25 @@ export const meta = {
code: 'ACCESS_DENIED',
id: '25b73c73-68b1-41d0-bad1-381cfdf6579f',
},

fileIdOrUrlRequired: {
message: 'fileId or url required.',
code: 'INVALID_PARAM',
id: '89674805-722c-440c-8d88-5641830dc3e4',
},
},
} as const;

export const paramDef = {
type: 'object',
properties: {
fileId: { type: 'string', format: 'misskey:id' },
url: { type: 'string' },
},
required: [],
anyOf: [
{
properties: {
fileId: { type: 'string', format: 'misskey:id' },
},
required: ['fileId'],
},
{
properties: {
url: { type: 'string' },
},
required: ['url'],
},
],
} as const;

// eslint-disable-next-line import/no-default-export
Expand All @@ -62,8 +65,6 @@ export default define(meta, paramDef, async (ps, user) => {
thumbnailUrl: ps.url,
}],
});
} else {
throw new ApiError(meta.errors.fileIdOrUrlRequired);
}

if (file == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const meta = {
export const paramDef = {
type: 'object',
properties: {
host: { type: 'string', nullable: true },
host: { type: 'string', nullable: true, description: 'Omit or use `null` to not filter by host.' },
blocked: { type: 'boolean', nullable: true },
notResponding: { type: 'boolean', nullable: true },
suspended: { type: 'boolean', nullable: true },
Expand Down
19 changes: 14 additions & 5 deletions packages/backend/src/server/api/endpoints/messaging/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,25 @@ export const meta = {
export const paramDef = {
type: 'object',
properties: {
userId: { type: 'string', format: 'misskey:id' },
groupId: { type: 'string', format: 'misskey:id' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' },
markAsRead: { type: 'boolean', default: true },
},
required: [],
anyOf: [
{
properties: {
userId: { type: 'string', format: 'misskey:id' },
},
required: ['userId'],
},
{
properties: {
groupId: { type: 'string', format: 'misskey:id' },
},
required: ['groupId'],
},
],
} as const;

// eslint-disable-next-line import/no-default-export
Expand Down Expand Up @@ -126,7 +137,5 @@ export default define(meta, paramDef, async (ps, user) => {
return await Promise.all(messages.map(message => MessagingMessages.pack(message, user, {
populateGroup: false,
})));
} else {
throw new Error();
}
});
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,23 @@ export const meta = {
export const paramDef = {
type: 'object',
properties: {
userId: { type: 'string', format: 'misskey:id' },
groupId: { type: 'string', format: 'misskey:id' },
text: { type: 'string', nullable: true, maxLength: 3000 },
fileId: { type: 'string', format: 'misskey:id' },
},
required: [],
anyOf: [
{
properties: {
userId: { type: 'string', format: 'misskey:id' },
},
required: ['userId'],
},
{
properties: {
groupId: { type: 'string', format: 'misskey:id' },
},
required: ['groupId'],
},
],
} as const;

// eslint-disable-next-line import/no-default-export
Expand Down
1 change: 1 addition & 0 deletions packages/backend/src/server/api/endpoints/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export const meta = {
host: {
type: 'string',
optional: false, nullable: true,
description: 'The local host is represented with `null`.',
},
url: {
type: 'string',
Expand Down
6 changes: 5 additions & 1 deletion packages/backend/src/server/api/endpoints/mute/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ export const paramDef = {
type: 'object',
properties: {
userId: { type: 'string', format: 'misskey:id' },
expiresAt: { type: 'integer', nullable: true },
expiresAt: {
type: 'integer',
nullable: true,
description: 'A Unix Epoch timestamp that must lie in the future. `null` means an indefinite mute.',
},
},
required: ['userId'],
} as const;
Expand Down
2 changes: 1 addition & 1 deletion packages/backend/src/server/api/endpoints/notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const meta = {
export const paramDef = {
type: 'object',
properties: {
local: { type: 'boolean' },
local: { type: 'boolean', default: false },
reply: { type: 'boolean' },
renote: { type: 'boolean' },
withFiles: { type: 'boolean' },
Expand Down
Loading

0 comments on commit 090f8ef

Please sign in to comment.