Skip to content

Commit ba6668c

Browse files
authoredJun 25, 2024··
✨ feat: support midjourney-proxy API secret (#29)
* ✨ feat: support passing `Mj-Api-Secret` through server- or client-side settings * ✨ feat: add `MIDJOURNEY_PROXY_API_SECRET` setting to Midjourney plugin * 🌐 chore: update translations * 💄 chore: use password input for API secret field in settings
1 parent 2389501 commit ba6668c

File tree

25 files changed

+187
-68
lines changed

25 files changed

+187
-68
lines changed
 

‎locales/ar/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "يرجى الرجوع إلى <1>midjourney-proxy</1> ونشر الخدمة الخادمية لاستخدامها",
33-
"title": "عنوان وكيل Midjourney API"
32+
"apiSecret": {
33+
"title": "سر وكيل Midjourney API"
34+
},
35+
"baseUrl": {
36+
"title": "عنوان وكيل Midjourney API"
37+
},
38+
"description": "يرجى الرجوع إلى <1>midjourney-proxy</1> ونشر الخدمة الخادمية لاستخدامها"
3439
},
3540
"modalTitle": "الإعدادات",
3641
"save": "حفظ"

‎locales/de-DE/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "Bitte installieren Sie den <1>midjourney-proxy</1>-Server und verwenden Sie ihn",
33-
"title": "Midjourney API-Proxy-Adresse"
32+
"apiSecret": {
33+
"title": "Midjourney API Proxy Secret"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API Proxy-URL"
37+
},
38+
"description": "Bitte installieren Sie den <1>midjourney-proxy</1>-Server und verwenden Sie ihn"
3439
},
3540
"modalTitle": "Einstellungen",
3641
"save": "Speichern"

‎locales/en-US/common.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
"deleteAll": "Delete All Images",
1717
"deleteAllConfirm": "Are you sure you want to delete all images?",
1818
"deleteConfirm": "Are you sure you want to delete this image?",
19-
"deleteCurrent": "Delete Current Image",
20-
"task": {
21-
"actions": {
22-
"download": "Download",
23-
"info": "Image Details"
24-
}
25-
}
19+
"deleteCurrent": "Delete Current Image"
2620
},
2721
"input": {
2822
"placeholder": "Enter Midjourney prompt word...",
@@ -35,14 +29,21 @@
3529
},
3630
"settings": {
3731
"MidjourneyAPIProxy": {
38-
"description": "Please refer to <1>midjourney-proxy</1> for deploying the server and then use",
39-
"title": "Midjourney API Proxy Address"
32+
"apiSecret": {
33+
"title": "Midjourney API Proxy Secret"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API Proxy Address"
37+
},
38+
"description": "Please refer to <1>midjourney-proxy</1> for deploying the server and then use"
4039
},
4140
"modalTitle": "Settings",
4241
"save": "Save"
4342
},
4443
"task": {
4544
"actions": {
45+
"download": "Download",
46+
"info": "Image Details",
4647
"reroll": "Reroll",
4748
"upscale": "Upscale",
4849
"variant": "Diversify"

‎locales/es-ES/common.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
"deleteAll": "Eliminar todas las imágenes",
1717
"deleteAllConfirm": "¿Estás seguro de que quieres eliminar todas las imágenes?",
1818
"deleteConfirm": "¿Estás seguro de que quieres eliminar esta imagen?",
19-
"deleteCurrent": "Eliminar imagen actual",
20-
"task": {
21-
"actions": {
22-
"download": "Descargar",
23-
"info": "Detalles de la imagen"
24-
}
25-
}
19+
"deleteCurrent": "Eliminar imagen actual"
2620
},
2721
"input": {
2822
"placeholder": "Ingrese las palabras clave de Midjourney...",
@@ -35,14 +29,21 @@
3529
},
3630
"settings": {
3731
"MidjourneyAPIProxy": {
38-
"description": "Por favor consulta <1>midjourney-proxy</1> para desplegar el servidor y luego utilizarlo",
39-
"title": "Dirección del proxy de la API de Midjourney"
32+
"apiSecret": {
33+
"title": "Secreto de la API de Midjourney"
34+
},
35+
"baseUrl": {
36+
"title": "Dirección de proxy de la API de Midjourney"
37+
},
38+
"description": "Por favor consulta <1>midjourney-proxy</1> para desplegar el servidor y luego utilizarlo"
4039
},
4140
"modalTitle": "Configuración",
4241
"save": "Guardar"
4342
},
4443
"task": {
4544
"actions": {
45+
"download": "Descargar",
46+
"info": "Detalles de la imagen",
4647
"reroll": "Volver a generar",
4748
"upscale": "Mejorar la calidad",
4849
"variant": "Variar"

‎locales/fr-FR/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "Veuillez consulter <1>midjourney-proxy</1> pour déployer le service côté serveur avant utilisation",
33-
"title": "Adresse du proxy Midjourney API"
32+
"apiSecret": {
33+
"title": "Secret du proxy API Midjourney"
34+
},
35+
"baseUrl": {
36+
"title": "Adresse du proxy API Midjourney"
37+
},
38+
"description": "Veuillez consulter <1>midjourney-proxy</1> pour déployer le service côté serveur avant utilisation"
3439
},
3540
"modalTitle": "Paramètres",
3641
"save": "Enregistrer"

‎locales/it-IT/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@
3535
},
3636
"settings": {
3737
"MidjourneyAPIProxy": {
38-
"description": "Si prega di fare riferimento a <1>midjourney-proxy</1> per utilizzare il servizio lato server",
39-
"title": "Indirizzo del proxy API di Midjourney"
38+
"apiSecret": {
39+
"title": "Segreto del proxy API di Midjourney"
40+
},
41+
"baseUrl": {
42+
"title": "Indirizzo del proxy API di Midjourney"
43+
},
44+
"description": "Si prega di fare riferimento a <1>midjourney-proxy</1> per utilizzare il servizio lato server"
4045
},
4146
"modalTitle": "Impostazioni",
4247
"save": "Salva"

‎locales/ja-JP/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "サーバーをデプロイした後、<1>midjourney-proxy</1> を参照して使用してください",
33-
"title": "Midjourney APIプロキシアドレス"
32+
"apiSecret": {
33+
"title": "Midjourney API プロキシシークレット"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API プロキシアドレス"
37+
},
38+
"description": "サーバーをデプロイした後、<1>midjourney-proxy</1> を参照して使用してください"
3439
},
3540
"modalTitle": "設定",
3641
"save": "保存"

‎locales/ko-KR/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "<1>midjourney-proxy</1>를 참조하여 서버를 배포한 후 사용하세요",
33-
"title": "Midjourney API 프록시 주소"
32+
"apiSecret": {
33+
"title": "Midjourney API 프록시 비밀번호"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API 프록시 주소"
37+
},
38+
"description": "<1>midjourney-proxy</1>를 참조하여 서버를 배포한 후 사용하세요"
3439
},
3540
"modalTitle": "설정",
3641
"save": "저장"

‎locales/nl-NL/common.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
"deleteAll": "Alle afbeeldingen verwijderen",
1717
"deleteAllConfirm": "Weet je zeker dat je alle afbeeldingen wilt verwijderen?",
1818
"deleteConfirm": "Weet je zeker dat je deze afbeelding wilt verwijderen?",
19-
"deleteCurrent": "Huidige afbeelding verwijderen",
20-
"task": {
21-
"actions": {
22-
"download": "Downloaden",
23-
"info": "Afbeeldingsdetails"
24-
}
25-
}
19+
"deleteCurrent": "Huidige afbeelding verwijderen"
2620
},
2721
"input": {
2822
"placeholder": "Voer een suggestiewoord voor Midjourney in...",
@@ -35,14 +29,21 @@
3529
},
3630
"settings": {
3731
"MidjourneyAPIProxy": {
38-
"description": "Raadpleeg <1>midjourney-proxy</1> voor het implementeren van de serverzijde service",
39-
"title": "Adres van de Midjourney API-proxy"
32+
"apiSecret": {
33+
"title": "Midjourney API Proxy-geheim"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API Proxy-adres"
37+
},
38+
"description": "Raadpleeg <1>midjourney-proxy</1> voor het implementeren van de serverzijde service"
4039
},
4140
"modalTitle": "Instellingen",
4241
"save": "Opslaan"
4342
},
4443
"task": {
4544
"actions": {
45+
"download": "Downloaden",
46+
"info": "Afbeeldingsdetails",
4647
"reroll": "Opnieuw genereren",
4748
"upscale": "Opschalen",
4849
"variant": "Diversifiëren"

‎locales/pl-PL/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "Proszę skonsultować się z <1>midjourney-proxy</1> w celu skonfigurowania serwera",
33-
"title": "Adres proxy API Midjourney"
32+
"apiSecret": {
33+
"title": "Sekret proxy Midjourney API"
34+
},
35+
"baseUrl": {
36+
"title": "Adres proxy Midjourney API"
37+
},
38+
"description": "Proszę skonsultować się z <1>midjourney-proxy</1> w celu skonfigurowania serwera"
3439
},
3540
"modalTitle": "Ustawienia",
3641
"save": "Zapisz"

‎locales/pt-BR/common.json

+10-9
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@
1616
"deleteAll": "Excluir todas as imagens",
1717
"deleteAllConfirm": "Tem certeza de que deseja excluir todas as imagens?",
1818
"deleteConfirm": "Tem certeza de que deseja excluir esta imagem?",
19-
"deleteCurrent": "Excluir imagem atual",
20-
"task": {
21-
"actions": {
22-
"download": "Baixar",
23-
"info": "Detalhes da imagem"
24-
}
25-
}
19+
"deleteCurrent": "Excluir imagem atual"
2620
},
2721
"input": {
2822
"placeholder": "Digite as palavras-chave do Midjourney...",
@@ -35,14 +29,21 @@
3529
},
3630
"settings": {
3731
"MidjourneyAPIProxy": {
38-
"description": "Consulte <1>midjourney-proxy</1> para implantar o servidor e usá-lo",
39-
"title": "Endereço do proxy da API Midjourney"
32+
"apiSecret": {
33+
"title": "Segredo do Proxy da API Midjourney"
34+
},
35+
"baseUrl": {
36+
"title": "Endereço do Proxy da API Midjourney"
37+
},
38+
"description": "Consulte <1>midjourney-proxy</1> para implantar o servidor e usá-lo"
4039
},
4140
"modalTitle": "Configurações",
4241
"save": "Salvar"
4342
},
4443
"task": {
4544
"actions": {
45+
"download": "Baixar",
46+
"info": "Detalhes da Imagem",
4647
"reroll": "Rolar novamente",
4748
"upscale": "Aprimorar",
4849
"variant": "Variar"

‎locales/ru-RU/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "Пожалуйста, укажите адрес сервера для использования <1>midjourney-proxy</1>",
33-
"title": "Адрес прокси Midjourney API"
32+
"apiSecret": {
33+
"title": "Секрет прокси Midjourney API"
34+
},
35+
"baseUrl": {
36+
"title": "Адрес прокси Midjourney API"
37+
},
38+
"description": "Пожалуйста, укажите адрес сервера для использования <1>midjourney-proxy</1>"
3439
},
3540
"modalTitle": "Настройки",
3641
"save": "Сохранить"

‎locales/tr-TR/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "Lütfen <1>midjourney-proxy</1> bağlantısına giderek sunucu tarafını kurduktan sonra kullanın",
33-
"title": "Midjourney API Vekil Adresi"
32+
"apiSecret": {
33+
"title": "Midjourney API Proxy Gizlisi"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API Proxy Adresi"
37+
},
38+
"description": "Lütfen <1>midjourney-proxy</1> bağlantısına giderek sunucu tarafını kurduktan sonra kullanın"
3439
},
3540
"modalTitle": "Ayarlar",
3641
"save": "Kaydet"

‎locales/vi-VN/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "Vui lòng tham khảo <1>midjourney-proxy</1> để triển khai dịch vụ máy chủ trước khi sử dụng",
33-
"title": "Địa chỉ proxy API Midjourney"
32+
"apiSecret": {
33+
"title": "Bí mật proxy API Midjourney"
34+
},
35+
"baseUrl": {
36+
"title": "Địa chỉ proxy API Midjourney"
37+
},
38+
"description": "Vui lòng tham khảo <1>midjourney-proxy</1> để triển khai dịch vụ máy chủ trước khi sử dụng"
3439
},
3540
"modalTitle": "Cài đặt",
3641
"save": "Lưu"

‎locales/zh-CN/common.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"title": "Midjourney API 代理地址",
32+
"baseUrl": {
33+
"title": "Midjourney API 代理地址"
34+
},
35+
"apiSecret": {
36+
"title": "Midjourney API 代理 Secret"
37+
},
3338
"description": "请参考 <1>midjourney-proxy</1> 部署好服务端后使用"
3439
},
3540
"modalTitle": "设置",

‎locales/zh-TW/common.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,13 @@
2929
},
3030
"settings": {
3131
"MidjourneyAPIProxy": {
32-
"description": "請參考 <1>midjourney-proxy</1> 部署好服務端後使用",
33-
"title": "Midjourney API 代理地址"
32+
"apiSecret": {
33+
"title": "Midjourney API 代理密鑰"
34+
},
35+
"baseUrl": {
36+
"title": "Midjourney API 代理位址"
37+
},
38+
"description": "請參考 <1>midjourney-proxy</1> 部署好服務端後使用"
3439
},
3540
"modalTitle": "設定",
3641
"save": "保存"

‎public/manifest-dev.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@
2929
"type": "object",
3030
"properties": {
3131
"MIDJOURNEY_PROXY_URL": {
32+
"title": "Midjourney Proxy URL",
3233
"type": "string",
33-
"description": "please add url of deployment of [midjourney-proxy](https://github.com/novicezk/midjourney-proxy)"
34+
"description": "Please add URL of deployment of [midjourney-proxy](https://github.com/novicezk/midjourney-proxy)"
35+
},
36+
"MIDJOURNEY_PROXY_API_SECRET": {
37+
"title": "Midjourney Proxy API Secret",
38+
"type": "string",
39+
"description": "Please add API secret of [midjourney-proxy](https://github.com/novicezk/midjourney-proxy)",
40+
"format": "password"
3441
}
3542
},
3643
"required": ["MIDJOURNEY_PROXY_URL"]

‎public/manifest.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@
2929
"type": "object",
3030
"properties": {
3131
"MIDJOURNEY_PROXY_URL": {
32+
"title": "Midjourney Proxy URL",
3233
"type": "string",
33-
"description": "please add url of deployment of [midjourney-proxy](https://github.com/novicezk/midjourney-proxy)"
34+
"description": "Please add URL of deployment of [midjourney-proxy](https://github.com/novicezk/midjourney-proxy)"
35+
},
36+
"MIDJOURNEY_PROXY_API_SECRET": {
37+
"title": "Midjourney Proxy API Secret",
38+
"type": "string",
39+
"description": "Please add API secret of [midjourney-proxy](https://github.com/novicezk/midjourney-proxy)",
40+
"format": "password"
3441
}
3542
},
3643
"required": ["MIDJOURNEY_PROXY_URL"]

‎src/app/api/midjourney/route.ts

+27-3
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,60 @@ import { getServerConfig } from '@/config/server';
44

55
export const runtime = 'edge';
66

7-
const { MIDJOURNEY_PROXY_URL: base } = getServerConfig();
7+
const { MIDJOURNEY_PROXY_URL: base, MIDJOURNEY_PROXY_API_SECRET: apiSecret } = getServerConfig();
88

99
const getBase = (req: Request) => {
1010
const userDefineBaseUrl = req.headers.get('X-Midjourney-Proxy-Url');
1111

1212
return userDefineBaseUrl || base;
1313
};
1414

15+
const getAPISecret = (req: Request) => {
16+
const userDefinedAPISecret = req.headers.get('X-Midjourney-Proxy-Api-Secret');
17+
18+
return userDefinedAPISecret || apiSecret;
19+
};
20+
1521
export const POST = async (req: Request) => {
1622
const baseUrl = getBase(req);
23+
const apiSecret = getAPISecret(req);
1724

1825
if (!baseUrl) return new Response(JSON.stringify({ type: 'NO_BASE_URL' }), { status: 400 });
1926

2027
const path = new URL(req.url).searchParams.get('path')!;
2128

2229
const body = await req.text();
2330

31+
const headers: Record<string, string> = {
32+
'Content-Type': 'application/json',
33+
};
34+
if (apiSecret) {
35+
headers['Mj-Api-Secret'] = apiSecret;
36+
}
37+
2438
return fetch(urlJoin(baseUrl, path), {
2539
body,
26-
headers: { 'Content-Type': 'application/json' },
40+
headers,
2741
method: 'POST',
2842
});
2943
};
3044

3145
export const GET = async (req: Request) => {
3246
const baseUrl = getBase(req);
47+
const apiSecret = getAPISecret(req);
3348

3449
if (!baseUrl) return new Response(JSON.stringify({ type: 'NO_BASE_URL' }), { status: 400 });
3550

3651
const path = new URL(req.url).searchParams.get('path')!;
3752

38-
return fetch(urlJoin(baseUrl, path), { headers: { 'Content-Type': 'application/json' } });
53+
const headers: Record<string, string> = {
54+
'Content-Type': 'application/json',
55+
};
56+
if (apiSecret) {
57+
headers['Mj-Api-Secret'] = apiSecret;
58+
}
59+
60+
return fetch(urlJoin(baseUrl, path), {
61+
headers,
62+
});
3963
};

‎src/config/server.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ declare global {
55
namespace NodeJS {
66
interface ProcessEnv {
77
MIDJOURNEY_PROXY_URL?: string;
8+
MIDJOURNEY_PROXY_API_SECRET?: string;
89
METADATA_BASE_URL?: string;
910

1011
IMGUR_CLIENT_ID?: string;
@@ -23,6 +24,7 @@ export const getServerConfig = () => {
2324

2425
return {
2526
MIDJOURNEY_PROXY_URL: process.env.MIDJOURNEY_PROXY_URL,
27+
MIDJOURNEY_PROXY_API_SECRET: process.env.MIDJOURNEY_PROXY_API_SECRET,
2628

2729
METADATA_BASE_URL: process.env.METADATA_BASE_URL,
2830

‎src/features/Settings.tsx

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ActionIcon, Alert, Icon, Input, Modal } from '@lobehub/ui';
2-
import { Button, Typography } from 'antd';
1+
import { ActionIcon, Alert, Icon, Modal } from '@lobehub/ui';
2+
import { Button, Input, Typography } from 'antd';
33
import isEqual from 'fast-deep-equal';
44
import { LucideSettings, Save } from 'lucide-react';
55
import Link from 'next/link';
@@ -12,9 +12,10 @@ import { settingsSelectors } from '@/store/global/selectors';
1212

1313
const Settings = memo(() => {
1414
const { t } = useTranslation('common');
15-
const [isSettingsModalOpen, proxyURL, updateSettings] = useGlobalStore((s) => [
15+
const [isSettingsModalOpen, proxyURL, proxyAPISecret, updateSettings] = useGlobalStore((s) => [
1616
s.isSettingsModalOpen,
1717
settingsSelectors.proxyURL(s),
18+
settingsSelectors.proxyAPISecret(s),
1819
s.updateSettings,
1920
]);
2021

@@ -72,14 +73,22 @@ const Settings = memo(() => {
7273
/>
7374
)}
7475
<Flexbox gap={12}>
75-
<div>{t('settings.MidjourneyAPIProxy.title')}</div>
76+
<div>{t('settings.MidjourneyAPIProxy.baseUrl.title')}</div>
7677
<Input
7778
onChange={(e) => {
7879
updateSettings({ MIDJOURNEY_PROXY_URL: e.target.value });
7980
}}
8081
placeholder={'https://your-midjourney-proxy'}
8182
value={proxyURL}
8283
/>
84+
<div>{t('settings.MidjourneyAPIProxy.apiSecret.title')}</div>
85+
<Input.Password
86+
onChange={(e) => {
87+
updateSettings({ MIDJOURNEY_PROXY_API_SECRET: e.target.value });
88+
}}
89+
placeholder={'your-midjourney-api-secret'}
90+
value={proxyAPISecret}
91+
/>
8392
<Typography.Text type={'secondary'}>
8493
<Trans i18nKey={'settings.MidjourneyAPIProxy.description'} ns={'common'}>
8594
请参考

‎src/services/midjourney.ts

+2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ class MidjourneyService {
6565
body: data ? JSON.stringify(data) : undefined,
6666
headers: {
6767
'Content-Type': 'application/json',
68+
'X-Midjourney-Proxy-Api-Secret':
69+
useGlobalStore.getState().settings.MIDJOURNEY_PROXY_API_SECRET || '',
6870
'X-Midjourney-Proxy-Url': useGlobalStore.getState().settings.MIDJOURNEY_PROXY_URL || '',
6971
},
7072
method,

‎src/store/global/initialState.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { LocaleMode } from '@/types/locale';
22

33
export interface AppSettings {
4+
MIDJOURNEY_PROXY_API_SECRET?: string;
45
MIDJOURNEY_PROXY_URL?: string;
56
}
67

‎src/store/global/selectors.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { SettingsStore } from './store';
22

3+
export const proxyAPISecret = (s: SettingsStore) => s.settings.MIDJOURNEY_PROXY_API_SECRET;
34
export const proxyURL = (s: SettingsStore) => s.settings.MIDJOURNEY_PROXY_URL;
45

56
export const settingsSelectors = {
7+
proxyAPISecret,
68
proxyURL,
79
};

‎src/store/midjourney/initialState.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { MidjourneyTask } from '@/types/task';
22

33
export interface AppSettings {
4+
MIDJOURNEY_PROXY_API_SECRET?: string;
45
MIDJOURNEY_PROXY_URL?: string;
56
}
67

0 commit comments

Comments
 (0)
Please sign in to comment.