@lobehub/chat 1.105.1 → 1.105.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/changelog/v1.json +9 -0
- package/locales/ar/auth.json +54 -0
- package/locales/bg-BG/auth.json +54 -0
- package/locales/de-DE/auth.json +54 -0
- package/locales/en-US/auth.json +54 -0
- package/locales/es-ES/auth.json +54 -0
- package/locales/fa-IR/auth.json +54 -0
- package/locales/fr-FR/auth.json +54 -0
- package/locales/it-IT/auth.json +54 -0
- package/locales/ja-JP/auth.json +54 -0
- package/locales/ko-KR/auth.json +54 -0
- package/locales/nl-NL/auth.json +54 -0
- package/locales/pl-PL/auth.json +54 -0
- package/locales/pt-BR/auth.json +54 -0
- package/locales/ru-RU/auth.json +54 -0
- package/locales/tr-TR/auth.json +54 -0
- package/locales/vi-VN/auth.json +54 -0
- package/locales/zh-CN/auth.json +54 -0
- package/locales/zh-TW/auth.json +54 -0
- package/package.json +2 -2
- package/src/app/(backend)/middleware/auth/index.test.ts +5 -5
- package/src/app/(backend)/middleware/auth/index.ts +6 -6
- package/src/app/(backend)/webapi/chat/[provider]/route.test.ts +11 -9
- package/src/app/(backend)/webapi/plugin/gateway/route.ts +2 -2
- package/src/app/sitemap.tsx +1 -10
- package/src/config/aiModels/giteeai.ts +269 -2
- package/src/config/aiModels/siliconcloud.ts +24 -2
- package/src/config/aiModels/stepfun.ts +67 -2
- package/src/config/aiModels/volcengine.ts +56 -2
- package/src/config/aiModels/wenxin.ts +62 -2
- package/src/config/aiModels/xai.ts +19 -2
- package/src/const/auth.ts +2 -3
- package/src/libs/model-runtime/ModelRuntime.test.ts +3 -3
- package/src/libs/trpc/async/context.ts +3 -3
- package/src/libs/trpc/edge/context.ts +7 -2
- package/src/libs/trpc/edge/middleware/jwtPayload.test.ts +4 -4
- package/src/libs/trpc/edge/middleware/jwtPayload.ts +2 -2
- package/src/libs/trpc/lambda/context.ts +2 -2
- package/src/libs/trpc/lambda/middleware/keyVaults.ts +2 -2
- package/src/server/modules/AgentRuntime/index.test.ts +28 -25
- package/src/server/modules/AgentRuntime/index.ts +3 -3
- package/src/server/routers/async/caller.ts +2 -2
- package/src/server/routers/lambda/market/index.ts +0 -14
- package/src/server/routers/tools/search.test.ts +2 -2
- package/src/server/services/chunk/index.ts +3 -3
- package/src/server/services/discover/index.ts +0 -13
- package/src/server/sitemap.test.ts +0 -52
- package/src/server/sitemap.ts +1 -38
- package/src/services/_auth.ts +3 -3
- package/src/services/discover.ts +0 -4
- package/src/store/discover/slices/mcp/action.ts +0 -8
- package/src/utils/client/xor-obfuscation.test.ts +370 -0
- package/src/utils/client/xor-obfuscation.ts +39 -0
- package/src/utils/server/xor.test.ts +123 -0
- package/src/utils/server/xor.ts +42 -0
- package/src/utils/jwt.test.ts +0 -27
- package/src/utils/jwt.ts +0 -37
- package/src/utils/server/jwt.test.ts +0 -62
- package/src/utils/server/jwt.ts +0 -28
package/locales/ko-KR/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "자동 생성",
|
5
|
+
"copy": "복사",
|
6
|
+
"copyError": "복사 실패",
|
7
|
+
"copySuccess": "API 키가 클립보드에 복사되었습니다",
|
8
|
+
"enterPlaceholder": "입력하세요",
|
9
|
+
"hide": "숨기기",
|
10
|
+
"neverExpires": "만료되지 않음",
|
11
|
+
"neverUsed": "한 번도 사용되지 않음",
|
12
|
+
"show": "표시"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "만료 시간",
|
18
|
+
"placeholder": "만료되지 않음"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "이름",
|
22
|
+
"placeholder": "API 키 이름을 입력하세요"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "생성",
|
26
|
+
"title": "API 키 생성"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "API 키 생성",
|
31
|
+
"delete": "삭제",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "취소",
|
35
|
+
"ok": "확인"
|
36
|
+
},
|
37
|
+
"content": "이 API 키를 삭제하시겠습니까?",
|
38
|
+
"title": "작업 확인"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "작업",
|
43
|
+
"expiresAt": "만료 시간",
|
44
|
+
"key": "키",
|
45
|
+
"lastUsedAt": "마지막 사용 시간",
|
46
|
+
"name": "이름",
|
47
|
+
"status": "활성 상태"
|
48
|
+
},
|
49
|
+
"title": "API 키 목록"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "내용을 비워둘 수 없습니다"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "지난 달",
|
4
57
|
"recent30Days": "최근 30일"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "단어"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "API 키 관리",
|
92
146
|
"profile": "프로필",
|
93
147
|
"security": "보안",
|
94
148
|
"stats": "통계"
|
package/locales/nl-NL/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "Automatisch gegenereerd",
|
5
|
+
"copy": "Kopiëren",
|
6
|
+
"copyError": "Kopiëren mislukt",
|
7
|
+
"copySuccess": "API-sleutel is gekopieerd naar het klembord",
|
8
|
+
"enterPlaceholder": "Voer in",
|
9
|
+
"hide": "Verbergen",
|
10
|
+
"neverExpires": "Verloopt nooit",
|
11
|
+
"neverUsed": "Nooit gebruikt",
|
12
|
+
"show": "Weergeven"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "Vervaldatum",
|
18
|
+
"placeholder": "Verloopt nooit"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "Naam",
|
22
|
+
"placeholder": "Voer de naam van de API-sleutel in"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "Aanmaken",
|
26
|
+
"title": "API-sleutel aanmaken"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "API-sleutel aanmaken",
|
31
|
+
"delete": "Verwijderen",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "Annuleren",
|
35
|
+
"ok": "Bevestigen"
|
36
|
+
},
|
37
|
+
"content": "Weet u zeker dat u deze API-sleutel wilt verwijderen?",
|
38
|
+
"title": "Bevestig actie"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "Acties",
|
43
|
+
"expiresAt": "Vervaldatum",
|
44
|
+
"key": "Sleutel",
|
45
|
+
"lastUsedAt": "Laatst gebruikt",
|
46
|
+
"name": "Naam",
|
47
|
+
"status": "Status"
|
48
|
+
},
|
49
|
+
"title": "API-sleutellijst"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "Inhoud mag niet leeg zijn"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "Vorige maand",
|
4
57
|
"recent30Days": "Laatste 30 dagen"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "Woorden"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "API-sleutelbeheer",
|
92
146
|
"profile": "Profiel",
|
93
147
|
"security": "Beveiliging",
|
94
148
|
"stats": "Statistieken"
|
package/locales/pl-PL/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "Automatycznie wygenerowany",
|
5
|
+
"copy": "Kopiuj",
|
6
|
+
"copyError": "Kopiowanie nie powiodło się",
|
7
|
+
"copySuccess": "Klucz API został skopiowany do schowka",
|
8
|
+
"enterPlaceholder": "Wpisz",
|
9
|
+
"hide": "Ukryj",
|
10
|
+
"neverExpires": "Nigdy nie wygasa",
|
11
|
+
"neverUsed": "Nigdy nie używany",
|
12
|
+
"show": "Pokaż"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "Data wygaśnięcia",
|
18
|
+
"placeholder": "Nigdy nie wygasa"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "Nazwa",
|
22
|
+
"placeholder": "Wpisz nazwę klucza API"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "Utwórz",
|
26
|
+
"title": "Utwórz klucz API"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "Utwórz klucz API",
|
31
|
+
"delete": "Usuń",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "Anuluj",
|
35
|
+
"ok": "Potwierdź"
|
36
|
+
},
|
37
|
+
"content": "Czy na pewno chcesz usunąć ten klucz API?",
|
38
|
+
"title": "Potwierdź operację"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "Akcje",
|
43
|
+
"expiresAt": "Data wygaśnięcia",
|
44
|
+
"key": "Klucz",
|
45
|
+
"lastUsedAt": "Ostatnie użycie",
|
46
|
+
"name": "Nazwa",
|
47
|
+
"status": "Status aktywacji"
|
48
|
+
},
|
49
|
+
"title": "Lista kluczy API"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "Pole nie może być puste"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "Poprzedni miesiąc",
|
4
57
|
"recent30Days": "Ostatnie 30 dni"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "Słowa"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "Zarządzanie kluczami API",
|
92
146
|
"profile": "Profil",
|
93
147
|
"security": "Bezpieczeństwo",
|
94
148
|
"stats": "Statystyki"
|
package/locales/pt-BR/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "Gerado automaticamente",
|
5
|
+
"copy": "Copiar",
|
6
|
+
"copyError": "Falha ao copiar",
|
7
|
+
"copySuccess": "Chave API copiada para a área de transferência",
|
8
|
+
"enterPlaceholder": "Por favor, insira",
|
9
|
+
"hide": "Ocultar",
|
10
|
+
"neverExpires": "Nunca expira",
|
11
|
+
"neverUsed": "Nunca usado",
|
12
|
+
"show": "Mostrar"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "Data de expiração",
|
18
|
+
"placeholder": "Nunca expira"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "Nome",
|
22
|
+
"placeholder": "Por favor, insira o nome da Chave API"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "Criar",
|
26
|
+
"title": "Criar Chave API"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "Criar Chave API",
|
31
|
+
"delete": "Excluir",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "Cancelar",
|
35
|
+
"ok": "Confirmar"
|
36
|
+
},
|
37
|
+
"content": "Tem certeza de que deseja excluir esta Chave API?",
|
38
|
+
"title": "Confirmar ação"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "Ações",
|
43
|
+
"expiresAt": "Data de expiração",
|
44
|
+
"key": "Chave",
|
45
|
+
"lastUsedAt": "Último uso",
|
46
|
+
"name": "Nome",
|
47
|
+
"status": "Status de ativação"
|
48
|
+
},
|
49
|
+
"title": "Lista de Chaves API"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "O conteúdo não pode estar vazio"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "Último Mês",
|
4
57
|
"recent30Days": "Últimos 30 Dias"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "Palavras"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "Gerenciamento de Chave API",
|
92
146
|
"profile": "Perfil",
|
93
147
|
"security": "Segurança",
|
94
148
|
"stats": "Estatísticas"
|
package/locales/ru-RU/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "Автоматически сгенерировано",
|
5
|
+
"copy": "Копировать",
|
6
|
+
"copyError": "Ошибка копирования",
|
7
|
+
"copySuccess": "API ключ скопирован в буфер обмена",
|
8
|
+
"enterPlaceholder": "Пожалуйста, введите",
|
9
|
+
"hide": "Скрыть",
|
10
|
+
"neverExpires": "Никогда не истекает",
|
11
|
+
"neverUsed": "Никогда не использовался",
|
12
|
+
"show": "Показать"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "Срок действия",
|
18
|
+
"placeholder": "Никогда не истекает"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "Название",
|
22
|
+
"placeholder": "Пожалуйста, введите название API ключа"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "Создать",
|
26
|
+
"title": "Создать API ключ"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "Создать API ключ",
|
31
|
+
"delete": "Удалить",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "Отмена",
|
35
|
+
"ok": "Подтвердить"
|
36
|
+
},
|
37
|
+
"content": "Вы уверены, что хотите удалить этот API ключ?",
|
38
|
+
"title": "Подтверждение действия"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "Действия",
|
43
|
+
"expiresAt": "Срок действия",
|
44
|
+
"key": "Ключ",
|
45
|
+
"lastUsedAt": "Последнее использование",
|
46
|
+
"name": "Название",
|
47
|
+
"status": "Статус активации"
|
48
|
+
},
|
49
|
+
"title": "Список API ключей"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "Поле не может быть пустым"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "Прошлый месяц",
|
4
57
|
"recent30Days": "Последние 30 дней"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "Слова"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "Управление API ключами",
|
92
146
|
"profile": "Профиль",
|
93
147
|
"security": "Безопасность",
|
94
148
|
"stats": "Статистика"
|
package/locales/tr-TR/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "Otomatik Oluşturuldu",
|
5
|
+
"copy": "Kopyala",
|
6
|
+
"copyError": "Kopyalama Başarısız",
|
7
|
+
"copySuccess": "API Anahtarı panoya kopyalandı",
|
8
|
+
"enterPlaceholder": "Lütfen giriniz",
|
9
|
+
"hide": "Gizle",
|
10
|
+
"neverExpires": "Asla Süresi Dolmaz",
|
11
|
+
"neverUsed": "Hiç Kullanılmadı",
|
12
|
+
"show": "Göster"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "Son Kullanma Tarihi",
|
18
|
+
"placeholder": "Asla Süresi Dolmaz"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "Ad",
|
22
|
+
"placeholder": "Lütfen API Anahtarı adını giriniz"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "Oluştur",
|
26
|
+
"title": "API Anahtarı Oluştur"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "API Anahtarı Oluştur",
|
31
|
+
"delete": "Sil",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "İptal",
|
35
|
+
"ok": "Onayla"
|
36
|
+
},
|
37
|
+
"content": "Bu API Anahtarını silmek istediğinize emin misiniz?",
|
38
|
+
"title": "İşlemi Onayla"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "İşlemler",
|
43
|
+
"expiresAt": "Son Kullanma Tarihi",
|
44
|
+
"key": "Anahtar",
|
45
|
+
"lastUsedAt": "Son Kullanım Tarihi",
|
46
|
+
"name": "Ad",
|
47
|
+
"status": "Etkinlik Durumu"
|
48
|
+
},
|
49
|
+
"title": "API Anahtarı Listesi"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "Bu alan boş bırakılamaz"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "Geçen Ay",
|
4
57
|
"recent30Days": "Son 30 Gün"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "Toplam kelime sayısı"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "API Anahtarı Yönetimi",
|
92
146
|
"profile": "Profil",
|
93
147
|
"security": "Güvenlik",
|
94
148
|
"stats": "İstatistikler"
|
package/locales/vi-VN/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "Tự động tạo",
|
5
|
+
"copy": "Sao chép",
|
6
|
+
"copyError": "Sao chép thất bại",
|
7
|
+
"copySuccess": "API Key đã được sao chép vào bộ nhớ tạm",
|
8
|
+
"enterPlaceholder": "Vui lòng nhập",
|
9
|
+
"hide": "Ẩn",
|
10
|
+
"neverExpires": "Không bao giờ hết hạn",
|
11
|
+
"neverUsed": "Chưa từng sử dụng",
|
12
|
+
"show": "Hiển thị"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "Thời gian hết hạn",
|
18
|
+
"placeholder": "Không bao giờ hết hạn"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "Tên",
|
22
|
+
"placeholder": "Vui lòng nhập tên API Key"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "Tạo",
|
26
|
+
"title": "Tạo API Key"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "Tạo API Key",
|
31
|
+
"delete": "Xóa",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "Hủy",
|
35
|
+
"ok": "Xác nhận"
|
36
|
+
},
|
37
|
+
"content": "Bạn có chắc chắn muốn xóa API Key này không?",
|
38
|
+
"title": "Xác nhận thao tác"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "Thao tác",
|
43
|
+
"expiresAt": "Thời gian hết hạn",
|
44
|
+
"key": "Khóa",
|
45
|
+
"lastUsedAt": "Lần sử dụng cuối",
|
46
|
+
"name": "Tên",
|
47
|
+
"status": "Trạng thái kích hoạt"
|
48
|
+
},
|
49
|
+
"title": "Danh sách API Key"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "Nội dung không được để trống"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "Tháng trước",
|
4
57
|
"recent30Days": "30 ngày qua"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "Từ"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "Quản lý API Key",
|
92
146
|
"profile": "Hồ sơ",
|
93
147
|
"security": "Bảo mật",
|
94
148
|
"stats": "Thống kê"
|
package/locales/zh-CN/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "自动生成",
|
5
|
+
"copy": "复制",
|
6
|
+
"copyError": "复制失败",
|
7
|
+
"copySuccess": "API Key 已复制到剪贴板",
|
8
|
+
"enterPlaceholder": "请输入",
|
9
|
+
"hide": "隐藏",
|
10
|
+
"neverExpires": "永不过期",
|
11
|
+
"neverUsed": "从未使用",
|
12
|
+
"show": "显示"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "过期时间",
|
18
|
+
"placeholder": "永不过期"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "名称",
|
22
|
+
"placeholder": "请输入 API Key 名称"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "创建",
|
26
|
+
"title": "创建 API Key"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "创建 API Key",
|
31
|
+
"delete": "删除",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "取消",
|
35
|
+
"ok": "确认"
|
36
|
+
},
|
37
|
+
"content": "确认删除该 API Key 吗?",
|
38
|
+
"title": "确认操作"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "操作",
|
43
|
+
"expiresAt": "过期时间",
|
44
|
+
"key": "密钥",
|
45
|
+
"lastUsedAt": "最后使用时间",
|
46
|
+
"name": "名称",
|
47
|
+
"status": "启用状态"
|
48
|
+
},
|
49
|
+
"title": "API Key 列表"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "内容不得为空"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "上个月",
|
4
57
|
"recent30Days": "最近30天"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "累计字数"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "API Key 管理",
|
92
146
|
"profile": "个人资料",
|
93
147
|
"security": "安全",
|
94
148
|
"stats": "数据统计"
|
package/locales/zh-TW/auth.json
CHANGED
@@ -1,4 +1,57 @@
|
|
1
1
|
{
|
2
|
+
"apikey": {
|
3
|
+
"display": {
|
4
|
+
"autoGenerated": "自動生成",
|
5
|
+
"copy": "複製",
|
6
|
+
"copyError": "複製失敗",
|
7
|
+
"copySuccess": "API Key 已複製到剪貼簿",
|
8
|
+
"enterPlaceholder": "請輸入",
|
9
|
+
"hide": "隱藏",
|
10
|
+
"neverExpires": "永不過期",
|
11
|
+
"neverUsed": "從未使用",
|
12
|
+
"show": "顯示"
|
13
|
+
},
|
14
|
+
"form": {
|
15
|
+
"fields": {
|
16
|
+
"expiresAt": {
|
17
|
+
"label": "過期時間",
|
18
|
+
"placeholder": "永不過期"
|
19
|
+
},
|
20
|
+
"name": {
|
21
|
+
"label": "名稱",
|
22
|
+
"placeholder": "請輸入 API Key 名稱"
|
23
|
+
}
|
24
|
+
},
|
25
|
+
"submit": "建立",
|
26
|
+
"title": "建立 API Key"
|
27
|
+
},
|
28
|
+
"list": {
|
29
|
+
"actions": {
|
30
|
+
"create": "建立 API Key",
|
31
|
+
"delete": "刪除",
|
32
|
+
"deleteConfirm": {
|
33
|
+
"actions": {
|
34
|
+
"cancel": "取消",
|
35
|
+
"ok": "確認"
|
36
|
+
},
|
37
|
+
"content": "確認刪除該 API Key 嗎?",
|
38
|
+
"title": "確認操作"
|
39
|
+
}
|
40
|
+
},
|
41
|
+
"columns": {
|
42
|
+
"actions": "操作",
|
43
|
+
"expiresAt": "過期時間",
|
44
|
+
"key": "密鑰",
|
45
|
+
"lastUsedAt": "最後使用時間",
|
46
|
+
"name": "名稱",
|
47
|
+
"status": "啟用狀態"
|
48
|
+
},
|
49
|
+
"title": "API Key 列表"
|
50
|
+
},
|
51
|
+
"validation": {
|
52
|
+
"required": "內容不得為空"
|
53
|
+
}
|
54
|
+
},
|
2
55
|
"date": {
|
3
56
|
"prevMonth": "上個月",
|
4
57
|
"recent30Days": "最近30天"
|
@@ -89,6 +142,7 @@
|
|
89
142
|
"words": "總字數"
|
90
143
|
},
|
91
144
|
"tab": {
|
145
|
+
"apikey": "API Key 管理",
|
92
146
|
"profile": "個人資料",
|
93
147
|
"security": "安全",
|
94
148
|
"stats": "數據統計"
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.105.
|
3
|
+
"version": "1.105.2",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -196,7 +196,7 @@
|
|
196
196
|
"i18next-resources-to-backend": "^1.2.1",
|
197
197
|
"idb-keyval": "^6.2.2",
|
198
198
|
"immer": "^10.1.1",
|
199
|
-
"jose": "^
|
199
|
+
"jose": "^6.0.12",
|
200
200
|
"js-sha256": "^0.11.1",
|
201
201
|
"jsonl-parse-stringify": "^1.0.3",
|
202
202
|
"keyv": "^4.5.4",
|
@@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
3
|
import { AgentRuntimeError } from '@/libs/model-runtime';
|
4
4
|
import { ChatErrorType } from '@/types/fetch';
|
5
5
|
import { createErrorResponse } from '@/utils/errorResponse';
|
6
|
-
import {
|
6
|
+
import { getXorPayload } from '@/utils/server/xor';
|
7
7
|
|
8
8
|
import { RequestHandler, checkAuth } from './index';
|
9
9
|
import { checkAuthMethod } from './utils';
|
@@ -20,8 +20,8 @@ vi.mock('./utils', () => ({
|
|
20
20
|
checkAuthMethod: vi.fn(),
|
21
21
|
}));
|
22
22
|
|
23
|
-
vi.mock('@/utils/server/
|
24
|
-
|
23
|
+
vi.mock('@/utils/server/xor', () => ({
|
24
|
+
getXorPayload: vi.fn(),
|
25
25
|
}));
|
26
26
|
|
27
27
|
describe('checkAuth', () => {
|
@@ -50,7 +50,7 @@ describe('checkAuth', () => {
|
|
50
50
|
it('should return error response on getJWTPayload error', async () => {
|
51
51
|
const mockError = AgentRuntimeError.createError(ChatErrorType.Unauthorized);
|
52
52
|
mockRequest.headers.set('Authorization', 'invalid');
|
53
|
-
vi.mocked(
|
53
|
+
vi.mocked(getXorPayload).mockRejectedValueOnce(mockError);
|
54
54
|
|
55
55
|
await checkAuth(mockHandler)(mockRequest, mockOptions);
|
56
56
|
|
@@ -64,7 +64,7 @@ describe('checkAuth', () => {
|
|
64
64
|
it('should return error response on checkAuthMethod error', async () => {
|
65
65
|
const mockError = AgentRuntimeError.createError(ChatErrorType.Unauthorized);
|
66
66
|
mockRequest.headers.set('Authorization', 'valid');
|
67
|
-
vi.mocked(
|
67
|
+
vi.mocked(getXorPayload).mockResolvedValueOnce({});
|
68
68
|
vi.mocked(checkAuthMethod).mockImplementationOnce(() => {
|
69
69
|
throw mockError;
|
70
70
|
});
|