diff --git a/src/api/bot/core.ts b/src/api/bot/core.ts index 9e699572d..ec7c935f9 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 dc600125c..296b42a28 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 c7100bd03..979d8ac29 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 cde4846e0..713078463 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 81db188ee..a087b46d8 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 74f025c8a..5d9983af6 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 b9a7d1b78..a4acc0660 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 753666405..348dbb108 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 1ce855932..f982ef62e 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 c25964635..c314837f7 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 0f9cea9f1..71db38f3b 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 88fb36b1f..e3b0127e7 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 e3447c17e..7119bf6ea 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 5b794d0a4..a4ba22790 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 664575187..45dfddcfe 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 ba8ca7d1c..dd80e41d0 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 5c71f9882..37fa38418 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 7e9ff3ad7..bee1de02d 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 2a3d974fe..b99d1fbbc 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 da90583bb..1b342e8de 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 e87474ae6..734a3a3c4 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 7031d28e5..6f75a923c 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 c1645117f..51af41f52 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 e7906c95c..f90b9aa0d 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 c7cb8032e..a3e915f16 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 f08be91c4..9ece429b6 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 8c68b06df..9ee413e0d 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 1304ccb54..9178c0eb8 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 17e5cc610..690cc4f28 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 e1dbd3bc1..273579cbc 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 8afa291e3..79bd2ba02 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 d21cce1a0..8d35b5039 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 @@