0
0
This commit is contained in:
syuilo 2018-03-28 16:46:11 +09:00
parent 3d5cdb8d2d
commit 1acc30822d
90 changed files with 286 additions and 286 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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'
},

View File

@ -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
});

View File

@ -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<any>}
*/
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({

View File

@ -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<any>}
*/
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({

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -13,13 +13,13 @@ import User from '../../models/user';
* @return {Promise<any>}
*/
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);

View File

@ -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({

View File

@ -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 = {

View File

@ -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: {

View File

@ -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 = {

View File

@ -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 ? {

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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);
}
});

View File

@ -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);
}
});

View File

@ -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

View File

@ -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).$;

View File

@ -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({

View File

@ -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

View File

@ -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;

View File

@ -137,7 +137,7 @@ export default async (req: express.Request, res: express.Response) => {
weight: null
},
settings: {
auto_watch: true
autoWatch: true
},
clientSettings: {
home: homeData

View File

@ -15,8 +15,8 @@
</div>
<div class="accepted" v-if="state == 'accepted'">
<h1>{{ session.app.is_authorized ? 'このアプリは既に連携済みです' : 'アプリケーションの連携を許可しました'}}</h1>
<p v-if="session.app.callback_url">アプリケーションに戻っています<mk-ellipsis/></p>
<p v-if="!session.app.callback_url">アプリケーションに戻ってやっていってください</p>
<p v-if="session.app.callbackUrl">アプリケーションに戻っています<mk-ellipsis/></p>
<p v-if="!session.app.callbackUrl">アプリケーションに戻ってやっていってください</p>
</div>
<div class="error" v-if="state == 'fetch-session-error'">
<p>セッションが存在しません</p>
@ -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;
}
}
}

View File

@ -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:

View File

@ -2,7 +2,7 @@
<div class="mk-autocomplete" @contextmenu.prevent="() => {}">
<ol class="users" ref="suggests" v-if="users.length > 0">
<li v-for="user in users" @click="complete(type, user)" @keydown="onKeydown" tabindex="-1">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=32`" alt=""/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=32`" alt=""/>
<span class="name">{{ user.name }}</span>
<span class="username">@{{ getAcct(user) }}</span>
</li>

View File

@ -1,7 +1,7 @@
<template>
<div class="message" :data-is-me="isMe">
<router-link class="avatar-anchor" :to="`/@${acct}`" :title="acct" target="_blank">
<img class="avatar" :src="`${message.user.avatar_url}?thumbnail&size=80`" alt=""/>
<img class="avatar" :src="`${message.user.avatarUrl}?thumbnail&size=80`" alt=""/>
</router-link>
<div class="content">
<div class="balloon" :data-no-text="message.text == null">

View File

@ -125,7 +125,7 @@ export default Vue.extend({
(this as any).api('messaging/messages', {
userId: this.user.id,
limit: max + 1,
until_id: this.existMoreMessages ? this.messages[0].id : undefined
untilId: this.existMoreMessages ? this.messages[0].id : undefined
}).then(messages => {
if (messages.length == max + 1) {
this.existMoreMessages = true;

View File

@ -13,7 +13,7 @@
@click="navigate(user)"
tabindex="-1"
>
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=32`" alt=""/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=32`" alt=""/>
<span class="name">{{ user.name }}</span>
<span class="username">@{{ getAcct(user) }}</span>
</li>
@ -31,7 +31,7 @@
:key="message.id"
>
<div>
<img class="avatar" :src="`${isMe(message) ? message.recipient.avatar_url : message.user.avatar_url}?thumbnail&size=64`" alt=""/>
<img class="avatar" :src="`${isMe(message) ? message.recipient.avatarUrl : message.user.avatarUrl}?thumbnail&size=64`" alt=""/>
<header>
<span class="name">{{ isMe(message) ? message.recipient.name : message.user.name }}</span>
<span class="username">@{{ getAcct(isMe(message) ? message.recipient : message.user) }}</span>

View File

@ -19,8 +19,8 @@
@click="set(i)"
:title="'[' + (o.transformPosToXy(i)[0] + 1) + ', ' + (o.transformPosToXy(i)[1] + 1) + '] (' + i + ')'"
>
<img v-if="stone === true" :src="`${blackUser.avatar_url}?thumbnail&size=128`" alt="">
<img v-if="stone === false" :src="`${whiteUser.avatar_url}?thumbnail&size=128`" alt="">
<img v-if="stone === true" :src="`${blackUser.avatarUrl}?thumbnail&size=128`" alt="">
<img v-if="stone === false" :src="`${whiteUser.avatarUrl}?thumbnail&size=128`" alt="">
</div>
</div>

View File

@ -31,7 +31,7 @@
<section v-if="invitations.length > 0">
<h2>対局の招待があります:</h2>
<div class="invitation" v-for="i in invitations" tabindex="-1" @click="accept(i)">
<img :src="`${i.parent.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${i.parent.avatarUrl}?thumbnail&size=32`" alt="">
<span class="name"><b>{{ i.parent.name }}</b></span>
<span class="username">@{{ i.parent.username }}</span>
<mk-time :time="i.createdAt"/>
@ -40,8 +40,8 @@
<section v-if="myGames.length > 0">
<h2>自分の対局</h2>
<a class="game" v-for="g in myGames" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
<img :src="`${g.user1.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
</a>
@ -49,8 +49,8 @@
<section v-if="games.length > 0">
<h2>みんなの対局</h2>
<a class="game" v-for="g in games" tabindex="-1" @click.prevent="go(g)" :href="`/othello/${g.id}`">
<img :src="`${g.user1.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatar_url}?thumbnail&size=32`" alt="">
<img :src="`${g.user1.avatarUrl}?thumbnail&size=32`" alt="">
<img :src="`${g.user2.avatarUrl}?thumbnail&size=32`" alt="">
<span><b>{{ g.user1.name }}</b> vs <b>{{ g.user2.name }}</b></span>
<span class="state">{{ g.isEnded ? '終了' : '進行中' }}</span>
</a>

View File

@ -2,7 +2,7 @@
<div class="mk-welcome-timeline">
<div v-for="post in posts">
<router-link class="avatar-anchor" :to="`/@${getAcct(post.user)}`" v-user-preview="post.user.id">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=96`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
</router-link>
<div class="body">
<header>

View File

@ -71,7 +71,7 @@ export default (os: OS) => (cb, file = null) => {
avatarId: file.id
}).then(i => {
os.i.avatarId = i.avatarId;
os.i.avatar_url = i.avatar_url;
os.i.avatarUrl = i.avatarUrl;
os.apis.dialog({
title: '%fa:info-circle%アバターを更新しました',

View File

@ -71,7 +71,7 @@ export default (os: OS) => (cb, file = null) => {
bannerId: file.id
}).then(i => {
os.i.bannerId = i.bannerId;
os.i.banner_url = i.banner_url;
os.i.bannerUrl = i.bannerUrl;
os.apis.dialog({
title: '%fa:info-circle%バナーを更新しました',

View File

@ -1,7 +1,7 @@
<template>
<mk-window width="400px" height="550px" @closed="$destroy">
<span slot="header" :class="$style.header">
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロワー
<img :src="`${user.avatarUrl}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロワー
</span>
<mk-followers :user="user"/>
</mk-window>

View File

@ -1,7 +1,7 @@
<template>
<mk-window width="400px" height="550px" @closed="$destroy">
<span slot="header" :class="$style.header">
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロー
<img :src="`${user.avatarUrl}?thumbnail&size=64`" alt=""/>{{ user.name }}のフォロー
</span>
<mk-following :user="user"/>
</mk-window>

View File

@ -4,7 +4,7 @@
<div class="users" v-if="!fetching && users.length > 0">
<div class="user" v-for="user in users" :key="user.id">
<router-link class="avatar-anchor" :to="`/@${getAcct(user)}`">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="user.id"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="user.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="`/@${getAcct(user)}`" v-user-preview="user.id">{{ user.name }}</router-link>

View File

@ -70,7 +70,7 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('posts/mentions', {
following: this.mode == 'following',
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
this.posts = this.posts.concat(posts);
this.moreFetching = false;

View File

@ -6,7 +6,7 @@
<mk-time :time="notification.createdAt"/>
<template v-if="notification.type == 'reaction'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -20,7 +20,7 @@
</template>
<template v-if="notification.type == 'repost'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:retweet%
@ -33,7 +33,7 @@
</template>
<template v-if="notification.type == 'quote'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:quote-left%
@ -44,7 +44,7 @@
</template>
<template v-if="notification.type == 'follow'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:user-plus%
@ -54,7 +54,7 @@
</template>
<template v-if="notification.type == 'reply'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:reply%
@ -65,7 +65,7 @@
</template>
<template v-if="notification.type == 'mention'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.post.user)}`" v-user-preview="notification.post.userId">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:at%
@ -76,7 +76,7 @@
</template>
<template v-if="notification.type == 'poll_vote'">
<router-link class="avatar-anchor" :to="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=48`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=48`" alt="avatar"/>
</router-link>
<div class="text">
<p>%fa:chart-pie%<a :href="`/@${getAcct(notification.user)}`" v-user-preview="notification.user.id">{{ notification.user.name }}</a></p>
@ -161,7 +161,7 @@ export default Vue.extend({
(this as any).api('i/notifications', {
limit: max + 1,
until_id: this.notifications[this.notifications.length - 1].id
untilId: this.notifications[this.notifications.length - 1].id
}).then(notifications => {
if (notifications.length == max + 1) {
this.moreNotifications = true;

View File

@ -1,7 +1,7 @@
<template>
<div class="sub" :title="title">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
</router-link>
<div class="main">
<header>

View File

@ -19,7 +19,7 @@
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="post.userId">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
</router-link>
%fa:retweet%
<router-link class="name" :href="`/@${acct}`">{{ post.user.name }}</router-link>
@ -28,7 +28,7 @@
</div>
<article>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
</router-link>
<header>
<router-link class="name" :to="`/@${acct}`" v-user-preview="p.user.id">{{ p.user.name }}</router-link>

View File

@ -1,7 +1,7 @@
<template>
<div class="mk-post-preview" :title="title">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
</router-link>
<div class="main">
<header>

View File

@ -1,7 +1,7 @@
<template>
<div class="sub" :title="title">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="post.userId"/>
</router-link>
<div class="main">
<header>

View File

@ -6,7 +6,7 @@
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="post.userId">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
</router-link>
%fa:retweet%
<span>{{ '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.substr(0, '%i18n:desktop.tags.mk-timeline-post.reposted-by%'.indexOf('{')) }}</span>
@ -17,7 +17,7 @@
</div>
<article>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar" v-user-preview="p.user.id"/>
</router-link>
<div class="main">
<header>

View File

@ -33,8 +33,8 @@ export default Vue.extend({
return;
}
(this as any).api('i/change_password', {
current_password: currentPassword,
new_password: newPassword
currentPasword: currentPassword,
newPassword: newPassword
}).then(() => {
(this as any).apis.notify('%i18n:desktop.tags.mk-password-setting.changed%');
});

View File

@ -2,7 +2,7 @@
<div class="profile">
<label class="avatar ui from group">
<p>%i18n:desktop.tags.mk-profile-setting.avatar%</p>
<img class="avatar" :src="`${os.i.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${os.i.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<button class="ui" @click="updateAvatar">%i18n:desktop.tags.mk-profile-setting.choice-avatar%</button>
</label>
<label class="ui from group">

View File

@ -86,7 +86,7 @@
<section class="notification" v-show="page == 'notification'">
<h1>通知</h1>
<mk-switch v-model="os.i.account.settings.auto_watch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
<mk-switch v-model="os.i.account.settings.autoWatch" @change="onChangeAutoWatch" text="投稿の自動ウォッチ">
<span>リアクションしたり返信したりした投稿に関する通知を自動的に受け取るようにします</span>
</mk-switch>
</section>
@ -283,7 +283,7 @@ export default Vue.extend({
},
onChangeAutoWatch(v) {
(this as any).api('i/update', {
auto_watch: v
autoWatch: v
});
},
onChangeShowPostFormOnTopOfTl(v) {

View File

@ -65,7 +65,7 @@ export default Vue.extend({
(this as any).api('posts/timeline', {
limit: 11,
until_date: this.date ? this.date.getTime() : undefined
untilDate: this.date ? this.date.getTime() : undefined
}).then(posts => {
if (posts.length == 11) {
posts.pop();
@ -82,7 +82,7 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('posts/timeline', {
limit: 11,
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
if (posts.length == 11) {
posts.pop();

View File

@ -2,7 +2,7 @@
<div class="account">
<button class="header" :data-active="isOpen" @click="toggle">
<span class="username">{{ os.i.username }}<template v-if="!isOpen">%fa:angle-down%</template><template v-if="isOpen">%fa:angle-up%</template></span>
<img class="avatar" :src="`${ os.i.avatar_url }?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${ os.i.avatarUrl }?thumbnail&size=64`" alt="avatar"/>
</button>
<transition name="zoom-in-top">
<div class="menu" v-if="isOpen">

View File

@ -1,9 +1,9 @@
<template>
<div class="mk-user-preview">
<template v-if="u != null">
<div class="banner" :style="u.banner_url ? `background-image: url(${u.banner_url}?thumbnail&size=512)` : ''"></div>
<div class="banner" :style="u.bannerUrl ? `background-image: url(${u.bannerUrl}?thumbnail&size=512)` : ''"></div>
<router-link class="avatar" :to="`/@${acct}`">
<img :src="`${u.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img :src="`${u.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="title">
<router-link class="name" :to="`/@${acct}`">{{ u.name }}</router-link>

View File

@ -1,7 +1,7 @@
<template>
<div class="root item">
<router-link class="avatar-anchor" :to="`/@${acct}`" v-user-preview="user.id">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="main">
<header>

View File

@ -4,7 +4,7 @@
<p class="initializing" v-if="fetching">%fa:spinner .pulse .fw%%i18n:desktop.tags.mk-user.followers-you-know.loading%<mk-ellipsis/></p>
<div v-if="!fetching && users.length > 0">
<router-link v-for="user in users" :to="`/@${getAcct(user)}`" :key="user.id">
<img :src="`${user.avatar_url}?thumbnail&size=64`" :alt="user.name" v-user-preview="user.id"/>
<img :src="`${user.avatarUrl}?thumbnail&size=64`" :alt="user.name" v-user-preview="user.id"/>
</router-link>
</div>
<p class="empty" v-if="!fetching && users.length == 0">%i18n:desktop.tags.mk-user.followers-you-know.no-users%</p>

View File

@ -5,7 +5,7 @@
<template v-if="!fetching && users.length != 0">
<div class="user" v-for="friend in users">
<router-link class="avatar-anchor" :to="`/@${getAcct(friend)}`">
<img class="avatar" :src="`${friend.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="friend.id"/>
<img class="avatar" :src="`${friend.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="friend.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="`/@${getAcct(friend)}`" v-user-preview="friend.id">{{ friend.name }}</router-link>

View File

@ -1,11 +1,11 @@
<template>
<div class="header" :data-is-dark-background="user.banner_url != null">
<div class="banner-container" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=2048)` : ''">
<div class="banner" ref="banner" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=2048)` : ''" @click="onBannerClick"></div>
<div class="header" :data-is-dark-background="user.bannerUrl != null">
<div class="banner-container" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''">
<div class="banner" ref="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=2048)` : ''" @click="onBannerClick"></div>
</div>
<div class="fade"></div>
<div class="container">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=150`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=150`" alt="avatar"/>
<div class="title">
<p class="name">{{ user.name }}</p>
<p class="username">@{{ acct }}</p>
@ -59,7 +59,7 @@ export default Vue.extend({
if (!(this as any).os.isSignedIn || (this as any).os.i.id != this.user.id) return;
(this as any).apis.updateBanner((this as any).os.i, i => {
this.user.banner_url = i.banner_url;
this.user.bannerUrl = i.bannerUrl;
});
}
}

View File

@ -62,7 +62,7 @@ export default Vue.extend({
fetch(cb?) {
(this as any).api('users/posts', {
userId: this.user.id,
until_date: this.date ? this.date.getTime() : undefined,
untilDate: this.date ? this.date.getTime() : undefined,
with_replies: this.mode == 'with-replies'
}).then(posts => {
this.posts = posts;
@ -76,7 +76,7 @@ export default Vue.extend({
(this as any).api('users/posts', {
userId: this.user.id,
with_replies: this.mode == 'with-replies',
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
this.moreFetching = false;
this.posts = this.posts.concat(posts);

View File

@ -9,7 +9,7 @@
<p><button class="signup" @click="signup">はじめる</button><button class="signin" @click="signin">ログイン</button></p>
<div class="users">
<router-link v-for="user in users" :key="user.id" class="avatar-anchor" :to="`/@${getAcct(user)}`" v-user-preview="user.id">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
</div>
</div>

View File

@ -4,12 +4,12 @@
:data-melt="props.design == 2"
>
<div class="banner"
:style="os.i.banner_url ? `background-image: url(${os.i.banner_url}?thumbnail&size=256)` : ''"
:style="os.i.bannerUrl ? `background-image: url(${os.i.bannerUrl}?thumbnail&size=256)` : ''"
title="クリックでバナー編集"
@click="os.apis.updateBanner"
></div>
<img class="avatar"
:src="`${os.i.avatar_url}?thumbnail&size=96`"
:src="`${os.i.avatarUrl}?thumbnail&size=96`"
@click="os.apis.updateAvatar"
alt="avatar"
title="クリックでアバター編集"

View File

@ -8,7 +8,7 @@
<template v-else-if="users.length != 0">
<div class="user" v-for="_user in users">
<router-link class="avatar-anchor" :to="`/@${getAcct(_user)}`">
<img class="avatar" :src="`${_user.avatar_url}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
<img class="avatar" :src="`${_user.avatarUrl}?thumbnail&size=42`" alt="" v-user-preview="_user.id"/>
</router-link>
<div class="body">
<router-link class="name" :to="`/@${getAcct(_user)}`" v-user-preview="_user.id">{{ _user.name }}</router-link>

View File

@ -92,7 +92,7 @@ export default Vue.extend({
name: this.name,
nameId: this.nid,
description: this.description,
callback_url: this.cb,
callbackUrl: this.cb,
permission: this.permission
}).then(() => {
location.href = '/apps';

View File

@ -320,7 +320,7 @@ export default Vue.extend({
(this as any).api('drive/files', {
folderId: this.folder ? this.folder.id : null,
limit: max + 1,
until_id: this.files[this.files.length - 1].id
untilId: this.files[this.files.length - 1].id
}).then(files => {
if (files.length == max + 1) {
this.moreFiles = true;

View File

@ -1,7 +1,7 @@
<template>
<div class="mk-notification-preview" :class="notification.type">
<template v-if="notification.type == 'reaction'">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p><mk-reaction-icon :reaction="notification.reaction"/>{{ notification.user.name }}</p>
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%</p>
@ -9,7 +9,7 @@
</template>
<template v-if="notification.type == 'repost'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:retweet%{{ notification.post.user.name }}</p>
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post.repost) }}%fa:quote-right%</p>
@ -17,7 +17,7 @@
</template>
<template v-if="notification.type == 'quote'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:quote-left%{{ notification.post.user.name }}</p>
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
@ -25,14 +25,14 @@
</template>
<template v-if="notification.type == 'follow'">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:user-plus%{{ notification.user.name }}</p>
</div>
</template>
<template v-if="notification.type == 'reply'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:reply%{{ notification.post.user.name }}</p>
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
@ -40,7 +40,7 @@
</template>
<template v-if="notification.type == 'mention'">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:at%{{ notification.post.user.name }}</p>
<p class="post-preview">{{ getPostSummary(notification.post) }}</p>
@ -48,7 +48,7 @@
</template>
<template v-if="notification.type == 'poll_vote'">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
<div class="text">
<p>%fa:chart-pie%{{ notification.user.name }}</p>
<p class="post-ref">%fa:quote-left%{{ getPostSummary(notification.post) }}%fa:quote-right%</p>

View File

@ -3,7 +3,7 @@
<div class="notification reaction" v-if="notification.type == 'reaction'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -20,7 +20,7 @@
<div class="notification repost" v-if="notification.type == 'repost'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -40,7 +40,7 @@
<div class="notification follow" v-if="notification.type == 'follow'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>
@ -61,7 +61,7 @@
<div class="notification poll_vote" v-if="notification.type == 'poll_vote'">
<mk-time :time="notification.createdAt"/>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${notification.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${notification.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="text">
<p>

View File

@ -75,7 +75,7 @@ export default Vue.extend({
(this as any).api('i/notifications', {
limit: max + 1,
until_id: this.notifications[this.notifications.length - 1].id
untilId: this.notifications[this.notifications.length - 1].id
}).then(notifications => {
if (notifications.length == max + 1) {
this.moreNotifications = true;

View File

@ -1,7 +1,7 @@
<template>
<div class="root sub">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="main">
<header>

View File

@ -18,7 +18,7 @@
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=32`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=32`" alt="avatar"/>
</router-link>
%fa:retweet%
<router-link class="name" :to="`/@${acct}`">
@ -30,7 +30,7 @@
<article>
<header>
<router-link class="avatar-anchor" :to="`/@${pAcct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div>
<router-link class="name" :to="`/@${pAcct}`">{{ p.user.name }}</router-link>

View File

@ -1,7 +1,7 @@
<template>
<div class="mk-post-preview">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="main">
<header>

View File

@ -1,7 +1,7 @@
<template>
<div class="sub">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=96`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
</router-link>
<div class="main">
<header>

View File

@ -6,7 +6,7 @@
<div class="repost" v-if="isRepost">
<p>
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${post.user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${post.user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
%fa:retweet%
<span>{{ '%i18n:mobile.tags.mk-timeline-post.reposted-by%'.substr(0, '%i18n:mobile.tags.mk-timeline-post.reposted-by%'.indexOf('{')) }}</span>
@ -17,7 +17,7 @@
</div>
<article>
<router-link class="avatar-anchor" :to="`/@${pAcct}`">
<img class="avatar" :src="`${p.user.avatar_url}?thumbnail&size=96`" alt="avatar"/>
<img class="avatar" :src="`${p.user.avatarUrl}?thumbnail&size=96`" alt="avatar"/>
</router-link>
<div class="main">
<header>

View File

@ -65,7 +65,7 @@ export default Vue.extend({
this.fetching = true;
(this as any).api('posts/timeline', {
limit: limit + 1,
until_date: this.date ? (this.date as any).getTime() : undefined
untilDate: this.date ? (this.date as any).getTime() : undefined
}).then(posts => {
if (posts.length == limit + 1) {
posts.pop();
@ -81,7 +81,7 @@ export default Vue.extend({
this.moreFetching = true;
(this as any).api('posts/timeline', {
limit: limit + 1,
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
if (posts.length == limit + 1) {
posts.pop();

View File

@ -10,7 +10,7 @@
<transition name="nav">
<div class="body" v-if="isOpen">
<router-link class="me" v-if="os.isSignedIn" :to="`/@${os.i.username}`">
<img class="avatar" :src="`${os.i.avatar_url}?thumbnail&size=128`" alt="avatar"/>
<img class="avatar" :src="`${os.i.avatarUrl}?thumbnail&size=128`" alt="avatar"/>
<p class="name">{{ os.i.name }}</p>
</router-link>
<div class="links">

View File

@ -1,8 +1,8 @@
<template>
<div class="mk-user-card">
<header :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=1024)` : ''">
<header :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''">
<a :href="`/@${acct}`">
<img :src="`${user.avatar_url}?thumbnail&size=200`" alt="avatar"/>
<img :src="`${user.avatarUrl}?thumbnail&size=200`" alt="avatar"/>
</a>
</header>
<a class="name" :href="`/@${acct}`" target="_blank">{{ user.name }}</a>

View File

@ -1,7 +1,7 @@
<template>
<div class="mk-user-preview">
<router-link class="avatar-anchor" :to="`/@${acct}`">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<div class="main">
<header>

View File

@ -53,7 +53,7 @@ export default Vue.extend({
userId: this.user.id,
with_media: this.withMedia,
limit: limit + 1,
until_id: this.posts[this.posts.length - 1].id
untilId: this.posts[this.posts.length - 1].id
}).then(posts => {
if (posts.length == limit + 1) {
posts.pop();

View File

@ -1,7 +1,7 @@
<template>
<mk-ui>
<template slot="header" v-if="!fetching">
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt="">
<img :src="`${user.avatarUrl}?thumbnail&size=64`" alt="">
{{ '%i18n:mobile.tags.mk-user-followers-page.followers-of%'.replace('{}', user.name) }}
</template>
<mk-users-list

View File

@ -1,7 +1,7 @@
<template>
<mk-ui>
<template slot="header" v-if="!fetching">
<img :src="`${user.avatar_url}?thumbnail&size=64`" alt="">
<img :src="`${user.avatarUrl}?thumbnail&size=64`" alt="">
{{ '%i18n:mobile.tags.mk-user-following-page.following-of%'.replace('{}', user.name) }}
</template>
<mk-users-list

View File

@ -22,7 +22,7 @@ export default Vue.extend({
const ok = window.confirm('%i18n:mobile.tags.mk-notifications-page.read-all%');
if (!ok) return;
(this as any).api('notifications/mark_as_read_all');
(this as any).api('notifications/markAsRead_all');
},
onFetched() {
Progress.done();

View File

@ -4,8 +4,8 @@
<div :class="$style.content">
<p>%fa:info-circle%%i18n:mobile.tags.mk-profile-setting.will-be-published%</p>
<div :class="$style.form">
<div :style="os.i.banner_url ? `background-image: url(${os.i.banner_url}?thumbnail&size=1024)` : ''" @click="setBanner">
<img :src="`${os.i.avatar_url}?thumbnail&size=200`" alt="avatar" @click="setAvatar"/>
<div :style="os.i.bannerUrl ? `background-image: url(${os.i.bannerUrl}?thumbnail&size=1024)` : ''" @click="setBanner">
<img :src="`${os.i.avatarUrl}?thumbnail&size=200`" alt="avatar" @click="setAvatar"/>
</div>
<label>
<p>%i18n:mobile.tags.mk-profile-setting.name%</p>

View File

@ -3,11 +3,11 @@
<span slot="header" v-if="!fetching">%fa:user% {{ user.name }}</span>
<main v-if="!fetching">
<header>
<div class="banner" :style="user.banner_url ? `background-image: url(${user.banner_url}?thumbnail&size=1024)` : ''"></div>
<div class="banner" :style="user.bannerUrl ? `background-image: url(${user.bannerUrl}?thumbnail&size=1024)` : ''"></div>
<div class="body">
<div class="top">
<a class="avatar">
<img :src="`${user.avatar_url}?thumbnail&size=200`" alt="avatar"/>
<img :src="`${user.avatarUrl}?thumbnail&size=200`" alt="avatar"/>
</a>
<mk-follow-button v-if="os.isSignedIn && os.i.id != user.id" :user="user"/>
</div>

View File

@ -3,7 +3,7 @@
<p class="initializing" v-if="fetching">%fa:spinner .pulse .fw%%i18n:mobile.tags.mk-user-overview-followers-you-know.loading%<mk-ellipsis/></p>
<div v-if="!fetching && users.length > 0">
<a v-for="user in users" :key="user.id" :href="`/@${getAcct(user)}`">
<img :src="`${user.avatar_url}?thumbnail&size=64`" :alt="user.name"/>
<img :src="`${user.avatarUrl}?thumbnail&size=64`" :alt="user.name"/>
</a>
</div>
<p class="empty" v-if="!fetching && users.length == 0">%i18n:mobile.tags.mk-user-overview-followers-you-know.no-users%</p>

View File

@ -22,7 +22,7 @@
</div>
<div class="users">
<router-link v-for="user in users" :key="user.id" class="avatar-anchor" :to="`/@${user.username}`">
<img class="avatar" :src="`${user.avatar_url}?thumbnail&size=64`" alt="avatar"/>
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
</div>
<footer>

View File

@ -2,10 +2,10 @@
<div class="mkw-profile">
<mk-widget-container>
<div :class="$style.banner"
:style="os.i.banner_url ? `background-image: url(${os.i.banner_url}?thumbnail&size=256)` : ''"
:style="os.i.bannerUrl ? `background-image: url(${os.i.bannerUrl}?thumbnail&size=256)` : ''"
></div>
<img :class="$style.avatar"
:src="`${os.i.avatar_url}?thumbnail&size=96`"
:src="`${os.i.avatarUrl}?thumbnail&size=96`"
alt="avatar"
/>
<router-link :class="$style.name" :to="`/@${os.i.username}`">{{ os.i.name }}</router-link>

View File

@ -54,7 +54,7 @@ section
h3 2.ユーザーに認証させる
p あなたのアプリを使ってもらうには、ユーザーにアカウントへのアクセスの許可をもらう必要があります。
p
| 認証セッションを開始するには、#{common.config.api_url}/auth/session/generate へパラメータに app_secret としてシークレットキーを含めたリクエストを送信します。
| 認証セッションを開始するには、#{common.config.api_url}/auth/session/generate へパラメータに appSecret としてシークレットキーを含めたリクエストを送信します。
| リクエスト形式はJSONで、メソッドはPOSTです。
| レスポンスとして認証セッションのトークンや認証フォームのURLが取得できるので、認証フォームのURLをブラウザで表示し、ユーザーにフォームを提示してください。
@ -76,7 +76,7 @@ section
th 説明
tbody
tr
td app_secret
td appSecret
td string
td あなたのアプリのシークレットキー
tr

View File

@ -10,22 +10,22 @@ params:
optional: true
desc:
ja: "取得する最大の数"
- name: "since_id"
- name: "sinceId"
type: "id(Post)"
optional: true
desc:
ja: "指定すると、この投稿を基点としてより新しい投稿を取得します"
- name: "until_id"
- name: "untilId"
type: "id(Post)"
optional: true
desc:
ja: "指定すると、この投稿を基点としてより古い投稿を取得します"
- name: "since_date"
- name: "sinceDate"
type: "number"
optional: true
desc:
ja: "指定した時間を基点としてより新しい投稿を取得します。数値は、1970 年 1 月 1 日 00:00:00 UTC から指定した日時までの経過時間をミリ秒単位で表します。"
- name: "until_date"
- name: "untilDate"
type: "number"
optional: true
desc:

View File

@ -35,7 +35,7 @@ props:
desc:
ja: "アバターのID"
en: "The ID of the avatar of this user"
- name: "avatar_url"
- name: "avatarUrl"
type: "string"
optional: false
desc:
@ -47,7 +47,7 @@ props:
desc:
ja: "バナーのID"
en: "The ID of the banner of this user"
- name: "banner_url"
- name: "bannerUrl"
type: "string"
optional: false
desc:

View File

@ -83,7 +83,7 @@ const defaultSwagger = {
"type": "string",
"description": "アバターに設定しているドライブのファイルのID"
},
"avatar_url": {
"avatarUrl": {
"type": "string",
"description": "アバターURL"
},
@ -91,7 +91,7 @@ const defaultSwagger = {
"type": "string",
"description": "バナーに設定しているドライブのファイルのID"
},
"banner_url": {
"bannerUrl": {
"type": "string",
"description": "バナーURL"
},