style: use space indentation
feat: no new users allowed fix: change base language to Korean fix: change gacha to random text from devs
This commit is contained in:
parent
320dfc0696
commit
b6a3b0cd53
35 changed files with 335 additions and 367 deletions
|
@ -6,4 +6,4 @@ end_of_line = lf
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
indent_size = 4
|
indent_size = 2
|
|
@ -16,35 +16,9 @@ export const misskeyAppInfo = {
|
||||||
permission: [
|
permission: [
|
||||||
'read:account',
|
'read:account',
|
||||||
'write:account',
|
'write:account',
|
||||||
'read:blocks',
|
|
||||||
'write:blocks',
|
|
||||||
'read:drive',
|
|
||||||
'write:drive',
|
|
||||||
'read:favorites',
|
|
||||||
'write:favorites',
|
|
||||||
'read:following',
|
|
||||||
'write:following',
|
|
||||||
'read:messaging',
|
|
||||||
'write:messaging',
|
|
||||||
'read:mutes',
|
|
||||||
'write:mutes',
|
|
||||||
'write:notes',
|
'write:notes',
|
||||||
'read:notifications',
|
'read:notifications',
|
||||||
'write:notifications',
|
'write:notifications',
|
||||||
'read:reactions',
|
|
||||||
'write:reactions',
|
|
||||||
'write:votes',
|
|
||||||
'read:pages',
|
|
||||||
'write:pages',
|
|
||||||
'write:page-likes',
|
|
||||||
'read:page-likes',
|
|
||||||
'read:user-groups',
|
|
||||||
'write:user-groups',
|
|
||||||
'read:channels',
|
'read:channels',
|
||||||
'write:channels',
|
|
||||||
'read:gallery',
|
|
||||||
'write:gallery',
|
|
||||||
'read:gallery-likes',
|
|
||||||
'write:gallery-likes',
|
|
||||||
],
|
],
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
@ -180,8 +180,12 @@ router.get('(.*)', async (ctx) => {
|
||||||
|
|
||||||
async function login(ctx: Context, user: Record<string, unknown>, host: string, token: string) {
|
async function login(ctx: Context, user: Record<string, unknown>, host: string, token: string) {
|
||||||
const isNewcomer = !(await getUser(user.username as string, host));
|
const isNewcomer = !(await getUser(user.username as string, host));
|
||||||
await upsertUser(user.username as string, host, token);
|
if (isNewcomer) {
|
||||||
|
await die(ctx, 'noNewUserAllowed', 403);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await upsertUser(user.username as string, host, token);
|
||||||
const u = await getUser(user.username as string, host);
|
const u = await getUser(user.username as string, host);
|
||||||
|
|
||||||
if (!u) {
|
if (!u) {
|
||||||
|
|
|
@ -1,25 +1,11 @@
|
||||||
const allKatakana = [
|
const allTexts: string[] = [
|
||||||
...('アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨ'.split('')),
|
'아무말 빔----',
|
||||||
'ウィ', 'ウェ',
|
'휴대폰용 보험은 가입하셨나요?',
|
||||||
'キャ', 'キュ', 'キョ',
|
|
||||||
'クァ', 'クォ',
|
|
||||||
'シャ', 'シュ', 'ショ',
|
|
||||||
'チャ', 'チュ', 'チョ',
|
|
||||||
'ヒャ', 'ヒュ', 'ヒョ',
|
|
||||||
'ミャ', 'ミュ', 'ミョ'
|
|
||||||
];
|
];
|
||||||
|
|
||||||
const allInfix = [ '', 'ー', 'ッ' ];
|
const getRandomText = () => allTexts[Math.floor(Math.random() * allTexts.length)];
|
||||||
|
|
||||||
const getRandomKatakana = () => allKatakana[Math.floor(Math.random() * allKatakana.length)];
|
|
||||||
const getRandomInfix = () => allInfix[Math.floor(Math.random() * allInfix.length)];
|
|
||||||
|
|
||||||
export const createGacha = () => {
|
export const createGacha = () => {
|
||||||
return [
|
const result = getRandomText();
|
||||||
getRandomKatakana(),
|
return result;
|
||||||
getRandomInfix(),
|
|
||||||
getRandomKatakana(),
|
|
||||||
getRandomInfix(),
|
|
||||||
...(new Array(Math.floor(Math.random() * 2 + 1)).fill('').map(() => getRandomKatakana()))
|
|
||||||
].join('');
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -47,7 +47,7 @@ export const format = (user: IUser, count: Count): string => {
|
||||||
return !v ? m : typeof v === 'function' ? v(score, user) : v;
|
return !v ? m : typeof v === 'function' ? v(score, user) : v;
|
||||||
});
|
});
|
||||||
if (user.appendHashtag) {
|
if (user.appendHashtag) {
|
||||||
result = result + '\n\n#misshaialert'
|
result = result + '\n\n#misshaialert';
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,6 +7,7 @@ export const errorCodes = [
|
||||||
'notAuthorized',
|
'notAuthorized',
|
||||||
'hostNotFound',
|
'hostNotFound',
|
||||||
'invalidHostFormat',
|
'invalidHostFormat',
|
||||||
|
'noNewUserAllowed',
|
||||||
'other',
|
'other',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"update": "Update",
|
"update": "Update",
|
||||||
"shareMisskeyTools": "Share #MisskeyTools",
|
"shareMisskeyTools": "Share #MisskeyTools",
|
||||||
"shareMisskeyToolsNote": "Try #MisskeyTools !\n\nhttps://t.psec.dev",
|
"shareMisskeyToolsNote": "Try #MisskeyTools !\n\nhttps://t.psec.dev",
|
||||||
"instanceUrlPlaceholder": "e.g. misskey.io",
|
"instanceUrlPlaceholder": "k.lapy.link, stella.place, psec.dev...",
|
||||||
"settings": "Settings",
|
"settings": "Settings",
|
||||||
"accentColor": "Accent Color",
|
"accentColor": "Accent Color",
|
||||||
"changelog": "Changelog",
|
"changelog": "Changelog",
|
||||||
|
@ -156,7 +156,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"_error": {
|
"_error": {
|
||||||
"sorry": "Something went wrong. Please retry again.",
|
"sorry": "We have some small problem. Please try again later.",
|
||||||
"additionalInfo": "Additional Info: ",
|
"additionalInfo": "Additional Info: ",
|
||||||
"hitorisskeyIsDenied": "You cannot integrate with hitorisskey.",
|
"hitorisskeyIsDenied": "You cannot integrate with hitorisskey.",
|
||||||
"teapot": "I'm a teapot.",
|
"teapot": "I'm a teapot.",
|
||||||
|
@ -164,6 +164,7 @@
|
||||||
"tokenRequired": "Token is required.",
|
"tokenRequired": "Token is required.",
|
||||||
"invalidParameter": "Invalid parameter.",
|
"invalidParameter": "Invalid parameter.",
|
||||||
"notAuthorized": "Not authorized.",
|
"notAuthorized": "Not authorized.",
|
||||||
|
"noNewUserAllowed": "You cannot signup to this service for now.",
|
||||||
"hostNotFound": "Could not connect to the instance. Make sure that the host name is correct and the instance is live.",
|
"hostNotFound": "Could not connect to the instance. Make sure that the host name is correct and the instance is live.",
|
||||||
"other": "None"
|
"other": "None"
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,19 +10,19 @@ const merge = (baseData: Record<string, unknown>, newData: Record<string, unknow
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const _enUS = merge(jaJP, enUS);
|
const _enUS = merge(koKR, enUS);
|
||||||
const _koKR = merge(_enUS, koKR)
|
const _jaJP = merge(_enUS, jaJP);
|
||||||
|
|
||||||
export const resources = {
|
export const resources = {
|
||||||
'ja_JP': { translation: jaJP },
|
'ko_KR': { translation: koKR },
|
||||||
'en_US': { translation: _enUS },
|
'en_US': { translation: _enUS },
|
||||||
'ko_KR': { translation: _koKR },
|
'ja_JP': { translation: _jaJP },
|
||||||
};
|
};
|
||||||
|
|
||||||
export const languageName = {
|
export const languageName = {
|
||||||
'ja_JP': '日本語',
|
|
||||||
'en_US': 'English',
|
|
||||||
'ko_KR': '한국어',
|
'ko_KR': '한국어',
|
||||||
|
'en_US': 'English',
|
||||||
|
'ja_JP': '日本語',
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type LanguageCode = keyof typeof resources;
|
export type LanguageCode = keyof typeof resources;
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"update": "更新する",
|
"update": "更新する",
|
||||||
"shareMisskeyTools": "#MisskeyTools をシェアする",
|
"shareMisskeyTools": "#MisskeyTools をシェアする",
|
||||||
"shareMisskeyToolsNote": "#MisskeyTools はいいぞ\n\nhttps://t.psec.dev",
|
"shareMisskeyToolsNote": "#MisskeyTools はいいぞ\n\nhttps://t.psec.dev",
|
||||||
"instanceUrlPlaceholder": "例:misskey.io",
|
"instanceUrlPlaceholder": "k.lapy.link, stella.place, psec.dev...",
|
||||||
"settings": "設定",
|
"settings": "設定",
|
||||||
"accentColor": "アクセントカラー",
|
"accentColor": "アクセントカラー",
|
||||||
"changelog": "更新履歴",
|
"changelog": "更新履歴",
|
||||||
|
@ -164,6 +164,7 @@
|
||||||
"tokenRequired": "トークンがありません。",
|
"tokenRequired": "トークンがありません。",
|
||||||
"invalidParameter": "パラメータが不正です。",
|
"invalidParameter": "パラメータが不正です。",
|
||||||
"notAuthorized": "権限がありません。",
|
"notAuthorized": "権限がありません。",
|
||||||
|
"noNewUserAllowed": "現在、新規登録はできません。",
|
||||||
"hostNotFound": "インスタンスに接続できませんでした。ホスト名が正しく入力されているか、接続先のインスタンスが正常に動作しているかご確認ください。",
|
"hostNotFound": "インスタンスに接続できませんでした。ホスト名が正しく入力されているか、接続先のインスタンスが正常に動作しているかご確認ください。",
|
||||||
"other": "不明なエラーです。"
|
"other": "不明なエラーです。"
|
||||||
},
|
},
|
||||||
|
|
|
@ -164,6 +164,7 @@
|
||||||
"tokenRequired": "잘못된 토큰이거나, 세션이 존재하지 않습니다.",
|
"tokenRequired": "잘못된 토큰이거나, 세션이 존재하지 않습니다.",
|
||||||
"invalidParameter": "잘못된 요청 내용입니다. 값을 확인 후 다시 시도하세요.",
|
"invalidParameter": "잘못된 요청 내용입니다. 값을 확인 후 다시 시도하세요.",
|
||||||
"notAuthorized": "이 리소스에 접근할 권한이 없습니다.",
|
"notAuthorized": "이 리소스에 접근할 권한이 없습니다.",
|
||||||
|
"noNewUserAllowed": "현재 본 서비스에 신규 가입하실 수 없습니다.",
|
||||||
"hostNotFound": "인스턴스에 접속할 수 없습니다. 입력한 인스턴스 주소가 올바른지, API 요청이 가능한지 확인해주세요.",
|
"hostNotFound": "인스턴스에 접속할 수 없습니다. 입력한 인스턴스 주소가 올바른지, API 요청이 가능한지 확인해주세요.",
|
||||||
"other": "알 수 없는 오류가 발생했습니다. Mastodon 인스턴스로 로그인을 시도했을 수 있습니다."
|
"other": "알 수 없는 오류가 발생했습니다. Mastodon 인스턴스로 로그인을 시도했을 수 있습니다."
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue