From 1acc30822d869fcd4edf70fd8a8dca72f21c8730 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 28 Mar 2018 16:46:11 +0900 Subject: [PATCH] wip --- src/api/bot/core.ts | 4 +-- src/api/bot/interfaces/line.ts | 2 +- src/api/endpoints.ts | 2 +- src/api/endpoints/app/create.ts | 10 +++---- src/api/endpoints/auth/session/generate.ts | 8 +++--- src/api/endpoints/auth/session/userkey.ts | 8 +++--- src/api/endpoints/channels.ts | 16 +++++------ src/api/endpoints/channels/posts.ts | 16 +++++------ src/api/endpoints/drive/files.ts | 16 +++++------ src/api/endpoints/drive/folders.ts | 16 +++++------ src/api/endpoints/drive/stream.ts | 16 +++++------ src/api/endpoints/i/change_password.ts | 12 ++++---- src/api/endpoints/i/notifications.ts | 22 +++++++-------- src/api/endpoints/i/signin_history.ts | 16 +++++------ src/api/endpoints/i/update.ts | 8 +++--- src/api/endpoints/messaging/messages.ts | 22 +++++++-------- src/api/endpoints/othello/games.ts | 16 +++++------ src/api/endpoints/posts.ts | 16 +++++------ src/api/endpoints/posts/create.ts | 2 +- src/api/endpoints/posts/mentions.ts | 16 +++++------ src/api/endpoints/posts/polls/vote.ts | 2 +- src/api/endpoints/posts/reactions/create.ts | 2 +- src/api/endpoints/posts/reposts.ts | 16 +++++------ src/api/endpoints/posts/search.ts | 12 ++++---- src/api/endpoints/posts/timeline.ts | 28 +++++++++---------- src/api/endpoints/users/posts.ts | 28 +++++++++---------- src/api/models/user.ts | 4 +-- src/api/private/signup.ts | 2 +- src/web/app/auth/views/index.vue | 8 +++--- .../common/scripts/compose-notification.ts | 12 ++++---- .../common/views/components/autocomplete.vue | 2 +- .../components/messaging-room.message.vue | 2 +- .../views/components/messaging-room.vue | 2 +- .../app/common/views/components/messaging.vue | 4 +-- .../common/views/components/othello.game.vue | 4 +-- .../app/common/views/components/othello.vue | 10 +++---- .../views/components/welcome-timeline.vue | 2 +- src/web/app/desktop/api/update-avatar.ts | 2 +- src/web/app/desktop/api/update-banner.ts | 2 +- .../views/components/followers-window.vue | 2 +- .../views/components/following-window.vue | 2 +- .../views/components/friends-maker.vue | 2 +- .../app/desktop/views/components/mentions.vue | 2 +- .../views/components/notifications.vue | 16 +++++------ .../views/components/post-detail.sub.vue | 2 +- .../desktop/views/components/post-detail.vue | 4 +-- .../desktop/views/components/post-preview.vue | 2 +- .../views/components/posts.post.sub.vue | 2 +- .../desktop/views/components/posts.post.vue | 4 +-- .../views/components/settings.password.vue | 4 +-- .../views/components/settings.profile.vue | 2 +- .../app/desktop/views/components/settings.vue | 4 +-- .../app/desktop/views/components/timeline.vue | 4 +-- .../views/components/ui.header.account.vue | 2 +- .../desktop/views/components/user-preview.vue | 4 +-- .../views/components/users-list.item.vue | 2 +- .../pages/user/user.followers-you-know.vue | 2 +- .../desktop/views/pages/user/user.friends.vue | 2 +- .../desktop/views/pages/user/user.header.vue | 10 +++---- .../views/pages/user/user.timeline.vue | 4 +-- src/web/app/desktop/views/pages/welcome.vue | 2 +- src/web/app/desktop/views/widgets/profile.vue | 4 +-- src/web/app/desktop/views/widgets/users.vue | 2 +- src/web/app/dev/views/new-app.vue | 2 +- src/web/app/mobile/views/components/drive.vue | 2 +- .../views/components/notification-preview.vue | 14 +++++----- .../mobile/views/components/notification.vue | 8 +++--- .../mobile/views/components/notifications.vue | 2 +- .../views/components/post-detail.sub.vue | 2 +- .../mobile/views/components/post-detail.vue | 4 +-- .../mobile/views/components/post-preview.vue | 2 +- .../app/mobile/views/components/post.sub.vue | 2 +- src/web/app/mobile/views/components/post.vue | 4 +-- .../app/mobile/views/components/timeline.vue | 4 +-- .../app/mobile/views/components/ui.nav.vue | 2 +- .../app/mobile/views/components/user-card.vue | 4 +-- .../mobile/views/components/user-preview.vue | 2 +- .../mobile/views/components/user-timeline.vue | 2 +- src/web/app/mobile/views/pages/followers.vue | 2 +- src/web/app/mobile/views/pages/following.vue | 2 +- .../app/mobile/views/pages/notifications.vue | 2 +- .../mobile/views/pages/profile-setting.vue | 4 +-- src/web/app/mobile/views/pages/user.vue | 4 +-- .../pages/user/home.followers-you-know.vue | 2 +- src/web/app/mobile/views/pages/welcome.vue | 2 +- src/web/app/mobile/views/widgets/profile.vue | 4 +-- src/web/docs/api.ja.pug | 4 +-- .../docs/api/endpoints/posts/timeline.yaml | 8 +++--- src/web/docs/api/entities/user.yaml | 4 +-- swagger.js | 4 +-- 90 files changed, 286 insertions(+), 286 deletions(-) diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts index 9e699572de..ec7c935f9e 100644 --- a/src/api/bot/core.ts +++ b/src/api/bot/core.ts @@ -297,7 +297,7 @@ class TlContext extends Context { private async getTl() { const tl = await require('../endpoints/posts/timeline')({ limit: 5, - until_id: this.next ? this.next : undefined + untilId: this.next ? this.next : undefined }, this.bot.user); if (tl.length > 0) { @@ -349,7 +349,7 @@ class NotificationsContext extends Context { private async getNotifications() { const notifications = await require('../endpoints/i/notifications')({ limit: 5, - until_id: this.next ? this.next : undefined + untilId: this.next ? this.next : undefined }, this.bot.user); if (notifications.length > 0) { diff --git a/src/api/bot/interfaces/line.ts b/src/api/bot/interfaces/line.ts index dc600125c5..296b42a284 100644 --- a/src/api/bot/interfaces/line.ts +++ b/src/api/bot/interfaces/line.ts @@ -130,7 +130,7 @@ class LineBot extends BotCore { altText: await super.showUserCommand(q), template: { type: 'buttons', - thumbnailImageUrl: `${user.avatar_url}?thumbnail&size=1024`, + thumbnailImageUrl: `${user.avatarUrl}?thumbnail&size=1024`, title: `${user.name} (@${acct})`, text: user.description || '(no description)', actions: actions diff --git a/src/api/endpoints.ts b/src/api/endpoints.ts index c7100bd036..979d8ac295 100644 --- a/src/api/endpoints.ts +++ b/src/api/endpoints.ts @@ -289,7 +289,7 @@ const endpoints: Endpoint[] = [ kind: 'notification-write' }, { - name: 'notifications/mark_as_read_all', + name: 'notifications/markAsRead_all', withCredential: true, kind: 'notification-write' }, diff --git a/src/api/endpoints/app/create.ts b/src/api/endpoints/app/create.ts index cde4846e0f..713078463d 100644 --- a/src/api/endpoints/app/create.ts +++ b/src/api/endpoints/app/create.ts @@ -40,7 +40,7 @@ import App, { isValidNameId, pack } from '../../models/app'; * type: string * collectionFormat: csv * - - * name: callback_url + * name: callbackUrl * description: URL called back after authentication * in: formData * required: false @@ -82,10 +82,10 @@ module.exports = async (params, user) => new Promise(async (res, rej) => { const [permission, permissionErr] = $(params.permission).array('string').unique().$; if (permissionErr) return rej('invalid permission param'); - // Get 'callback_url' parameter + // Get 'callbackUrl' parameter // TODO: Check it is valid url - const [callbackUrl = null, callbackUrlErr] = $(params.callback_url).optional.nullable.string().$; - if (callbackUrlErr) return rej('invalid callback_url param'); + const [callbackUrl = null, callbackUrlErr] = $(params.callbackUrl).optional.nullable.string().$; + if (callbackUrlErr) return rej('invalid callbackUrl param'); // Generate secret const secret = rndstr('a-zA-Z0-9', 32); @@ -99,7 +99,7 @@ module.exports = async (params, user) => new Promise(async (res, rej) => { nameIdLower: nameId.toLowerCase(), description: description, permission: permission, - callback_url: callbackUrl, + callbackUrl: callbackUrl, secret: secret }); diff --git a/src/api/endpoints/auth/session/generate.ts b/src/api/endpoints/auth/session/generate.ts index 81db188ee5..a087b46d82 100644 --- a/src/api/endpoints/auth/session/generate.ts +++ b/src/api/endpoints/auth/session/generate.ts @@ -14,7 +14,7 @@ import config from '../../../../conf'; * summary: Generate a session * parameters: * - - * name: app_secret + * name: appSecret * description: App Secret * in: formData * required: true @@ -45,9 +45,9 @@ import config from '../../../../conf'; * @return {Promise} */ module.exports = (params) => new Promise(async (res, rej) => { - // Get 'app_secret' parameter - const [appSecret, appSecretErr] = $(params.app_secret).string().$; - if (appSecretErr) return rej('invalid app_secret param'); + // Get 'appSecret' parameter + const [appSecret, appSecretErr] = $(params.appSecret).string().$; + if (appSecretErr) return rej('invalid appSecret param'); // Lookup app const app = await App.findOne({ diff --git a/src/api/endpoints/auth/session/userkey.ts b/src/api/endpoints/auth/session/userkey.ts index 74f025c8a5..5d9983af67 100644 --- a/src/api/endpoints/auth/session/userkey.ts +++ b/src/api/endpoints/auth/session/userkey.ts @@ -14,7 +14,7 @@ import { pack } from '../../../models/user'; * summary: Get an access token(userkey) * parameters: * - - * name: app_secret + * name: appSecret * description: App Secret * in: formData * required: true @@ -50,9 +50,9 @@ import { pack } from '../../../models/user'; * @return {Promise} */ module.exports = (params) => new Promise(async (res, rej) => { - // Get 'app_secret' parameter - const [appSecret, appSecretErr] = $(params.app_secret).string().$; - if (appSecretErr) return rej('invalid app_secret param'); + // Get 'appSecret' parameter + const [appSecret, appSecretErr] = $(params.appSecret).string().$; + if (appSecretErr) return rej('invalid appSecret param'); // Lookup app const app = await App.findOne({ diff --git a/src/api/endpoints/channels.ts b/src/api/endpoints/channels.ts index b9a7d1b788..a4acc06605 100644 --- a/src/api/endpoints/channels.ts +++ b/src/api/endpoints/channels.ts @@ -16,17 +16,17 @@ module.exports = (params, me) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Construct query diff --git a/src/api/endpoints/channels/posts.ts b/src/api/endpoints/channels/posts.ts index 7536664051..348dbb108b 100644 --- a/src/api/endpoints/channels/posts.ts +++ b/src/api/endpoints/channels/posts.ts @@ -17,17 +17,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 1000, limitErr] = $(params.limit).optional.number().range(1, 1000).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Get 'channelId' parameter diff --git a/src/api/endpoints/drive/files.ts b/src/api/endpoints/drive/files.ts index 1ce855932b..f982ef62e0 100644 --- a/src/api/endpoints/drive/files.ts +++ b/src/api/endpoints/drive/files.ts @@ -17,17 +17,17 @@ module.exports = async (params, user, app) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) throw 'invalid limit param'; - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) throw 'invalid since_id param'; + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) throw 'invalid sinceId param'; - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) throw 'invalid until_id param'; + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) throw 'invalid untilId param'; - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - throw 'cannot set since_id and until_id'; + throw 'cannot set sinceId and untilId'; } // Get 'folderId' parameter diff --git a/src/api/endpoints/drive/folders.ts b/src/api/endpoints/drive/folders.ts index c259646352..c314837f72 100644 --- a/src/api/endpoints/drive/folders.ts +++ b/src/api/endpoints/drive/folders.ts @@ -17,17 +17,17 @@ module.exports = (params, user, app) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Get 'folderId' parameter diff --git a/src/api/endpoints/drive/stream.ts b/src/api/endpoints/drive/stream.ts index 0f9cea9f1d..71db38f3b3 100644 --- a/src/api/endpoints/drive/stream.ts +++ b/src/api/endpoints/drive/stream.ts @@ -16,17 +16,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Get 'type' parameter diff --git a/src/api/endpoints/i/change_password.ts b/src/api/endpoints/i/change_password.ts index 88fb36b1fb..e3b0127e7d 100644 --- a/src/api/endpoints/i/change_password.ts +++ b/src/api/endpoints/i/change_password.ts @@ -13,13 +13,13 @@ import User from '../../models/user'; * @return {Promise} */ module.exports = async (params, user) => new Promise(async (res, rej) => { - // Get 'current_password' parameter - const [currentPassword, currentPasswordErr] = $(params.current_password).string().$; - if (currentPasswordErr) return rej('invalid current_password param'); + // Get 'currentPasword' parameter + const [currentPassword, currentPasswordErr] = $(params.currentPasword).string().$; + if (currentPasswordErr) return rej('invalid currentPasword param'); - // Get 'new_password' parameter - const [newPassword, newPasswordErr] = $(params.new_password).string().$; - if (newPasswordErr) return rej('invalid new_password param'); + // Get 'newPassword' parameter + const [newPassword, newPasswordErr] = $(params.newPassword).string().$; + if (newPasswordErr) return rej('invalid newPassword param'); // Compare password const same = await bcrypt.compare(currentPassword, user.account.password); diff --git a/src/api/endpoints/i/notifications.ts b/src/api/endpoints/i/notifications.ts index e3447c17ec..7119bf6ea3 100644 --- a/src/api/endpoints/i/notifications.ts +++ b/src/api/endpoints/i/notifications.ts @@ -21,9 +21,9 @@ module.exports = (params, user) => new Promise(async (res, rej) => { $(params.following).optional.boolean().$; if (followingError) return rej('invalid following param'); - // Get 'mark_as_read' parameter - const [markAsRead = true, markAsReadErr] = $(params.mark_as_read).optional.boolean().$; - if (markAsReadErr) return rej('invalid mark_as_read param'); + // Get 'markAsRead' parameter + const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().$; + if (markAsReadErr) return rej('invalid markAsRead param'); // Get 'type' parameter const [type, typeErr] = $(params.type).optional.array('string').unique().$; @@ -33,17 +33,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } const mute = await Mute.find({ diff --git a/src/api/endpoints/i/signin_history.ts b/src/api/endpoints/i/signin_history.ts index 5b794d0a4b..a4ba22790c 100644 --- a/src/api/endpoints/i/signin_history.ts +++ b/src/api/endpoints/i/signin_history.ts @@ -16,17 +16,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } const query = { diff --git a/src/api/endpoints/i/update.ts b/src/api/endpoints/i/update.ts index 6645751871..45dfddcfe7 100644 --- a/src/api/endpoints/i/update.ts +++ b/src/api/endpoints/i/update.ts @@ -51,10 +51,10 @@ module.exports = async (params, user, _, isSecure) => new Promise(async (res, re if (isBotErr) return rej('invalid isBot param'); if (isBot != null) user.account.isBot = isBot; - // Get 'auto_watch' parameter - const [autoWatch, autoWatchErr] = $(params.auto_watch).optional.boolean().$; - if (autoWatchErr) return rej('invalid auto_watch param'); - if (autoWatch != null) user.account.settings.auto_watch = autoWatch; + // Get 'autoWatch' parameter + const [autoWatch, autoWatchErr] = $(params.autoWatch).optional.boolean().$; + if (autoWatchErr) return rej('invalid autoWatch param'); + if (autoWatch != null) user.account.settings.autoWatch = autoWatch; await User.update(user._id, { $set: { diff --git a/src/api/endpoints/messaging/messages.ts b/src/api/endpoints/messaging/messages.ts index ba8ca7d1c2..dd80e41d03 100644 --- a/src/api/endpoints/messaging/messages.ts +++ b/src/api/endpoints/messaging/messages.ts @@ -32,25 +32,25 @@ module.exports = (params, user) => new Promise(async (res, rej) => { return rej('user not found'); } - // Get 'mark_as_read' parameter - const [markAsRead = true, markAsReadErr] = $(params.mark_as_read).optional.boolean().$; - if (markAsReadErr) return rej('invalid mark_as_read param'); + // Get 'markAsRead' parameter + const [markAsRead = true, markAsReadErr] = $(params.markAsRead).optional.boolean().$; + if (markAsReadErr) return rej('invalid markAsRead param'); // Get 'limit' parameter const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } const query = { diff --git a/src/api/endpoints/othello/games.ts b/src/api/endpoints/othello/games.ts index 5c71f98828..37fa384189 100644 --- a/src/api/endpoints/othello/games.ts +++ b/src/api/endpoints/othello/games.ts @@ -10,17 +10,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } const q: any = my ? { diff --git a/src/api/endpoints/posts.ts b/src/api/endpoints/posts.ts index 7e9ff3ad74..bee1de02d4 100644 --- a/src/api/endpoints/posts.ts +++ b/src/api/endpoints/posts.ts @@ -35,17 +35,17 @@ module.exports = (params) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Construct query diff --git a/src/api/endpoints/posts/create.ts b/src/api/endpoints/posts/create.ts index 2a3d974fe8..b99d1fbbc1 100644 --- a/src/api/endpoints/posts/create.ts +++ b/src/api/endpoints/posts/create.ts @@ -392,7 +392,7 @@ module.exports = (params, user: IUser, app) => new Promise(async (res, rej) => { }); // この投稿をWatchする - if ((user.account as ILocalAccount).settings.auto_watch !== false) { + if ((user.account as ILocalAccount).settings.autoWatch !== false) { watch(user._id, reply); } diff --git a/src/api/endpoints/posts/mentions.ts b/src/api/endpoints/posts/mentions.ts index da90583bbd..1b342e8de9 100644 --- a/src/api/endpoints/posts/mentions.ts +++ b/src/api/endpoints/posts/mentions.ts @@ -23,17 +23,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Construct query diff --git a/src/api/endpoints/posts/polls/vote.ts b/src/api/endpoints/posts/polls/vote.ts index e87474ae6e..734a3a3c45 100644 --- a/src/api/endpoints/posts/polls/vote.ts +++ b/src/api/endpoints/posts/polls/vote.ts @@ -100,7 +100,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => { }); // この投稿をWatchする - if (user.account.settings.auto_watch !== false) { + if (user.account.settings.autoWatch !== false) { watch(user._id, post); } }); diff --git a/src/api/endpoints/posts/reactions/create.ts b/src/api/endpoints/posts/reactions/create.ts index 7031d28e56..6f75a923cd 100644 --- a/src/api/endpoints/posts/reactions/create.ts +++ b/src/api/endpoints/posts/reactions/create.ts @@ -116,7 +116,7 @@ module.exports = (params, user) => new Promise(async (res, rej) => { }); // この投稿をWatchする - if (user.account.settings.auto_watch !== false) { + if (user.account.settings.autoWatch !== false) { watch(user._id, post); } }); diff --git a/src/api/endpoints/posts/reposts.ts b/src/api/endpoints/posts/reposts.ts index c1645117f0..51af41f523 100644 --- a/src/api/endpoints/posts/reposts.ts +++ b/src/api/endpoints/posts/reposts.ts @@ -20,17 +20,17 @@ module.exports = (params, user) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Check if both of since_id and until_id is specified + // Check if both of sinceId and untilId is specified if (sinceId && untilId) { - return rej('cannot set since_id and until_id'); + return rej('cannot set sinceId and untilId'); } // Lookup post diff --git a/src/api/endpoints/posts/search.ts b/src/api/endpoints/posts/search.ts index e7906c95c8..f90b9aa0dd 100644 --- a/src/api/endpoints/posts/search.ts +++ b/src/api/endpoints/posts/search.ts @@ -61,13 +61,13 @@ module.exports = (params, me) => new Promise(async (res, rej) => { const [poll = null, pollErr] = $(params.poll).optional.nullable.boolean().$; if (pollErr) return rej('invalid poll param'); - // Get 'since_date' parameter - const [sinceDate, sinceDateErr] = $(params.since_date).optional.number().$; - if (sinceDateErr) throw 'invalid since_date param'; + // Get 'sinceDate' parameter + const [sinceDate, sinceDateErr] = $(params.sinceDate).optional.number().$; + if (sinceDateErr) throw 'invalid sinceDate param'; - // Get 'until_date' parameter - const [untilDate, untilDateErr] = $(params.until_date).optional.number().$; - if (untilDateErr) throw 'invalid until_date param'; + // Get 'untilDate' parameter + const [untilDate, untilDateErr] = $(params.untilDate).optional.number().$; + if (untilDateErr) throw 'invalid untilDate param'; // Get 'offset' parameter const [offset = 0, offsetErr] = $(params.offset).optional.number().min(0).$; diff --git a/src/api/endpoints/posts/timeline.ts b/src/api/endpoints/posts/timeline.ts index c7cb8032e3..a3e915f16a 100644 --- a/src/api/endpoints/posts/timeline.ts +++ b/src/api/endpoints/posts/timeline.ts @@ -22,25 +22,25 @@ module.exports = async (params, user, app) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) throw 'invalid limit param'; - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) throw 'invalid since_id param'; + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) throw 'invalid sinceId param'; - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) throw 'invalid until_id param'; + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) throw 'invalid untilId param'; - // Get 'since_date' parameter - const [sinceDate, sinceDateErr] = $(params.since_date).optional.number().$; - if (sinceDateErr) throw 'invalid since_date param'; + // Get 'sinceDate' parameter + const [sinceDate, sinceDateErr] = $(params.sinceDate).optional.number().$; + if (sinceDateErr) throw 'invalid sinceDate param'; - // Get 'until_date' parameter - const [untilDate, untilDateErr] = $(params.until_date).optional.number().$; - if (untilDateErr) throw 'invalid until_date param'; + // Get 'untilDate' parameter + const [untilDate, untilDateErr] = $(params.untilDate).optional.number().$; + if (untilDateErr) throw 'invalid untilDate param'; - // Check if only one of since_id, until_id, since_date, until_date specified + // Check if only one of sinceId, untilId, sinceDate, untilDate specified if ([sinceId, untilId, sinceDate, untilDate].filter(x => x != null).length > 1) { - throw 'only one of since_id, until_id, since_date, until_date can be specified'; + throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified'; } const { followingIds, watchingChannelIds, mutedUserIds } = await rap({ diff --git a/src/api/endpoints/users/posts.ts b/src/api/endpoints/users/posts.ts index f08be91c4d..9ece429b60 100644 --- a/src/api/endpoints/users/posts.ts +++ b/src/api/endpoints/users/posts.ts @@ -46,25 +46,25 @@ module.exports = (params, me) => new Promise(async (res, rej) => { const [limit = 10, limitErr] = $(params.limit).optional.number().range(1, 100).$; if (limitErr) return rej('invalid limit param'); - // Get 'since_id' parameter - const [sinceId, sinceIdErr] = $(params.since_id).optional.id().$; - if (sinceIdErr) return rej('invalid since_id param'); + // Get 'sinceId' parameter + const [sinceId, sinceIdErr] = $(params.sinceId).optional.id().$; + if (sinceIdErr) return rej('invalid sinceId param'); - // Get 'until_id' parameter - const [untilId, untilIdErr] = $(params.until_id).optional.id().$; - if (untilIdErr) return rej('invalid until_id param'); + // Get 'untilId' parameter + const [untilId, untilIdErr] = $(params.untilId).optional.id().$; + if (untilIdErr) return rej('invalid untilId param'); - // Get 'since_date' parameter - const [sinceDate, sinceDateErr] = $(params.since_date).optional.number().$; - if (sinceDateErr) throw 'invalid since_date param'; + // Get 'sinceDate' parameter + const [sinceDate, sinceDateErr] = $(params.sinceDate).optional.number().$; + if (sinceDateErr) throw 'invalid sinceDate param'; - // Get 'until_date' parameter - const [untilDate, untilDateErr] = $(params.until_date).optional.number().$; - if (untilDateErr) throw 'invalid until_date param'; + // Get 'untilDate' parameter + const [untilDate, untilDateErr] = $(params.untilDate).optional.number().$; + if (untilDateErr) throw 'invalid untilDate param'; - // Check if only one of since_id, until_id, since_date, until_date specified + // Check if only one of sinceId, untilId, sinceDate, untilDate specified if ([sinceId, untilId, sinceDate, untilDate].filter(x => x != null).length > 1) { - throw 'only one of since_id, until_id, since_date, until_date can be specified'; + throw 'only one of sinceId, untilId, sinceDate, untilDate can be specified'; } const q = userId !== undefined diff --git a/src/api/models/user.ts b/src/api/models/user.ts index 8c68b06dfa..9ee413e0d8 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -195,11 +195,11 @@ export const pack = ( } } - _user.avatar_url = _user.avatarId != null + _user.avatarUrl = _user.avatarId != null ? `${config.drive_url}/${_user.avatarId}` : `${config.drive_url}/default-avatar.jpg`; - _user.banner_url = _user.bannerId != null + _user.bannerUrl = _user.bannerId != null ? `${config.drive_url}/${_user.bannerId}` : null; diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index 1304ccb54c..9178c0eb89 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -137,7 +137,7 @@ export default async (req: express.Request, res: express.Response) => { weight: null }, settings: { - auto_watch: true + autoWatch: true }, clientSettings: { home: homeData diff --git a/src/web/app/auth/views/index.vue b/src/web/app/auth/views/index.vue index 17e5cc6108..690cc4f28e 100644 --- a/src/web/app/auth/views/index.vue +++ b/src/web/app/auth/views/index.vue @@ -15,8 +15,8 @@

{{ session.app.is_authorized ? 'このアプリは既に連携済みです' : 'アプリケーションの連携を許可しました'}}

-

アプリケーションに戻っています

-

アプリケーションに戻って、やっていってください。

+

アプリケーションに戻っています

+

アプリケーションに戻って、やっていってください。

セッションが存在しません。

@@ -77,8 +77,8 @@ export default Vue.extend({ methods: { accepted() { this.state = 'accepted'; - if (this.session.app.callback_url) { - location.href = this.session.app.callback_url + '?token=' + this.session.token; + if (this.session.app.callbackUrl) { + location.href = this.session.app.callbackUrl + '?token=' + this.session.token; } } } diff --git a/src/web/app/common/scripts/compose-notification.ts b/src/web/app/common/scripts/compose-notification.ts index e1dbd3bc13..273579cbc6 100644 --- a/src/web/app/common/scripts/compose-notification.ts +++ b/src/web/app/common/scripts/compose-notification.ts @@ -23,42 +23,42 @@ export default function(type, data): Notification { return { title: `${data.user.name}さんから:`, body: getPostSummary(data), - icon: data.user.avatar_url + '?thumbnail&size=64' + icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'reply': return { title: `${data.user.name}さんから返信:`, body: getPostSummary(data), - icon: data.user.avatar_url + '?thumbnail&size=64' + icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'quote': return { title: `${data.user.name}さんが引用:`, body: getPostSummary(data), - icon: data.user.avatar_url + '?thumbnail&size=64' + icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'reaction': return { title: `${data.user.name}: ${getReactionEmoji(data.reaction)}:`, body: getPostSummary(data.post), - icon: data.user.avatar_url + '?thumbnail&size=64' + icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'unread_messaging_message': return { title: `${data.user.name}さんからメッセージ:`, body: data.text, // TODO: getMessagingMessageSummary(data), - icon: data.user.avatar_url + '?thumbnail&size=64' + icon: data.user.avatarUrl + '?thumbnail&size=64' }; case 'othello_invited': return { title: '対局への招待があります', body: `${data.parent.name}さんから`, - icon: data.parent.avatar_url + '?thumbnail&size=64' + icon: data.parent.avatarUrl + '?thumbnail&size=64' }; default: diff --git a/src/web/app/common/views/components/autocomplete.vue b/src/web/app/common/views/components/autocomplete.vue index 8afa291e3c..79bd2ba023 100644 --- a/src/web/app/common/views/components/autocomplete.vue +++ b/src/web/app/common/views/components/autocomplete.vue @@ -2,7 +2,7 @@
  1. - + {{ user.name }} @{{ getAcct(user) }}
  2. diff --git a/src/web/app/common/views/components/messaging-room.message.vue b/src/web/app/common/views/components/messaging-room.message.vue index d21cce1a0a..8d35b50391 100644 --- a/src/web/app/common/views/components/messaging-room.message.vue +++ b/src/web/app/common/views/components/messaging-room.message.vue @@ -1,7 +1,7 @@