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:
オスカー、 2024-02-02 01:35:17 +09:00
parent 320dfc0696
commit b6a3b0cd53
35 changed files with 335 additions and 367 deletions

View File

@ -6,4 +6,4 @@ end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_size = 4
indent_size = 2

View File

@ -16,35 +16,9 @@ export const misskeyAppInfo = {
permission: [
'read: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',
'read: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',
'write:channels',
'read:gallery',
'write:gallery',
'read:gallery-likes',
'write:gallery-likes',
],
} as const;

View File

@ -180,8 +180,12 @@ router.get('(.*)', async (ctx) => {
async function login(ctx: Context, user: Record<string, unknown>, host: string, token: string) {
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);
if (!u) {

View File

@ -1,25 +1,11 @@
const allKatakana = [
...('アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨ'.split('')),
'ウィ', 'ウェ',
'キャ', 'キュ', 'キョ',
'クァ', 'クォ',
'シャ', 'シュ', 'ショ',
'チャ', 'チュ', 'チョ',
'ヒャ', 'ヒュ', 'ヒョ',
'ミャ', 'ミュ', 'ミョ'
const allTexts: string[] = [
'아무말 빔----',
'휴대폰용 보험은 가입하셨나요?',
];
const allInfix = [ '', 'ー', 'ッ' ];
const getRandomKatakana = () => allKatakana[Math.floor(Math.random() * allKatakana.length)];
const getRandomInfix = () => allInfix[Math.floor(Math.random() * allInfix.length)];
const getRandomText = () => allTexts[Math.floor(Math.random() * allTexts.length)];
export const createGacha = () => {
return [
getRandomKatakana(),
getRandomInfix(),
getRandomKatakana(),
getRandomInfix(),
...(new Array(Math.floor(Math.random() * 2 + 1)).fill('').map(() => getRandomKatakana()))
].join('');
const result = getRandomText();
return result;
};

View File

@ -47,7 +47,7 @@ export const format = (user: IUser, count: Count): string => {
return !v ? m : typeof v === 'function' ? v(score, user) : v;
});
if (user.appendHashtag) {
result = result + '\n\n#misshaialert'
result = result + '\n\n#misshaialert';
}
return result;
};

View File

@ -7,6 +7,7 @@ export const errorCodes = [
'notAuthorized',
'hostNotFound',
'invalidHostFormat',
'noNewUserAllowed',
'other',
] as const;

View File

@ -50,7 +50,7 @@
"update": "Update",
"shareMisskeyTools": "Share #MisskeyTools",
"shareMisskeyToolsNote": "Try #MisskeyTools !\n\nhttps://t.psec.dev",
"instanceUrlPlaceholder": "e.g. misskey.io",
"instanceUrlPlaceholder": "k.lapy.link, stella.place, psec.dev...",
"settings": "Settings",
"accentColor": "Accent Color",
"changelog": "Changelog",
@ -156,7 +156,7 @@
}
},
"_error": {
"sorry": "Something went wrong. Please retry again.",
"sorry": "We have some small problem. Please try again later.",
"additionalInfo": "Additional Info: ",
"hitorisskeyIsDenied": "You cannot integrate with hitorisskey.",
"teapot": "I'm a teapot.",
@ -164,6 +164,7 @@
"tokenRequired": "Token is required.",
"invalidParameter": "Invalid parameter.",
"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.",
"other": "None"
},

View File

@ -10,19 +10,19 @@ const merge = (baseData: Record<string, unknown>, newData: Record<string, unknow
});
};
const _enUS = merge(jaJP, enUS);
const _koKR = merge(_enUS, koKR)
const _enUS = merge(koKR, enUS);
const _jaJP = merge(_enUS, jaJP);
export const resources = {
'ja_JP': { translation: jaJP },
'ko_KR': { translation: koKR },
'en_US': { translation: _enUS },
'ko_KR': { translation: _koKR },
'ja_JP': { translation: _jaJP },
};
export const languageName = {
'ja_JP': '日本語',
'en_US': 'English',
'ko_KR': '한국어',
'en_US': 'English',
'ja_JP': '日本語',
} as const;
export type LanguageCode = keyof typeof resources;

View File

@ -50,7 +50,7 @@
"update": "更新する",
"shareMisskeyTools": "#MisskeyTools をシェアする",
"shareMisskeyToolsNote": "#MisskeyTools はいいぞ\n\nhttps://t.psec.dev",
"instanceUrlPlaceholder": "misskey.io",
"instanceUrlPlaceholder": "k.lapy.link, stella.place, psec.dev...",
"settings": "設定",
"accentColor": "アクセントカラー",
"changelog": "更新履歴",
@ -164,6 +164,7 @@
"tokenRequired": "トークンがありません。",
"invalidParameter": "パラメータが不正です。",
"notAuthorized": "権限がありません。",
"noNewUserAllowed": "現在、新規登録はできません。",
"hostNotFound": "インスタンスに接続できませんでした。ホスト名が正しく入力されているか、接続先のインスタンスが正常に動作しているかご確認ください。",
"other": "不明なエラーです。"
},

View File

@ -164,6 +164,7 @@
"tokenRequired": "잘못된 토큰이거나, 세션이 존재하지 않습니다.",
"invalidParameter": "잘못된 요청 내용입니다. 값을 확인 후 다시 시도하세요.",
"notAuthorized": "이 리소스에 접근할 권한이 없습니다.",
"noNewUserAllowed": "현재 본 서비스에 신규 가입하실 수 없습니다.",
"hostNotFound": "인스턴스에 접속할 수 없습니다. 입력한 인스턴스 주소가 올바른지, API 요청이 가능한지 확인해주세요.",
"other": "알 수 없는 오류가 발생했습니다. Mastodon 인스턴스로 로그인을 시도했을 수 있습니다."
},