Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: Support OAuth 2.1 for the built-in MCP server https://github.com/siyuan-note/siyuan/issues/19867

Daniela294a583caab
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index fc70a32e7a..5bc0ba0f33 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth لخادم MCP",
+ "mcpOAuthTip": "يتطلب كلمة مرور قفل الشاشة أو تسجيل دخول OIDC وأصل HTTPS عامًا؛ يؤدي التعطيل أو تغيير الأصل إلى إلغاء جميع التفويضات",
+ "mcpOAuthPublicURL": "أصل HTTPS العام",
+ "mcpOAuthRedirectURI": "عنوان رد الاتصال الدقيق للعميل",
+ "mcpOAuthRegister": "تسجيل عميل",
+ "mcpOAuthClientID": "معرّف العميل",
+ "mcpOAuthClientSecret": "سر العميل",
+ "mcpOAuthSecretTip": "احفظ هذا السر الآن. يُعرض مرة واحدة فقط.",
+ "mcpOAuthRevokeAll": "إلغاء جميع التفويضات",
+ "mcpOAuthConsentTip": "السماح لهذا العميل باستخدام جميع أدوات MCP المتاحة في مساحة العمل هذه، بما فيها إمكانات القراءة والكتابة والحذف والإدارة. تظل قيود القراءة فقط وأقفال دفاتر الملاحظات المشفرة سارية.",
+ "mcpOAuthError": "تعذر إعداد MCP OAuth أو التفويض به. تحقق من أصل HTTPS وعنوان رد الاتصال وتسجيل الدخول وأذونات الملفات.",
+ "mcpOAuthEndpoint": "عنوان MCP",
"removeList": "إلغاء تنسيق القائمة",
"entryWindowTopBar": "الشريط العلوي للنافذة الجديدة",
"archiveEncryptedNotebooks": "أرشفة وإزالة",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index bee232a988..cec9d4e7b4 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth für MCP-Server",
+ "mcpOAuthTip": "Erfordert ein Sperrbildschirmpasswort oder eine OIDC-Anmeldung und einen öffentlichen HTTPS-Ursprung; Deaktivieren oder Ändern des Ursprungs widerruft alle Autorisierungen",
+ "mcpOAuthPublicURL": "Öffentlicher HTTPS-Ursprung",
+ "mcpOAuthRedirectURI": "Exakte Rückruf-URL des Clients",
+ "mcpOAuthRegister": "Client registrieren",
+ "mcpOAuthClientID": "Client-ID",
+ "mcpOAuthClientSecret": "Client-Geheimnis",
+ "mcpOAuthSecretTip": "Speichern Sie dieses Geheimnis jetzt. Es wird nur einmal angezeigt.",
+ "mcpOAuthRevokeAll": "Alle Autorisierungen widerrufen",
+ "mcpOAuthConsentTip": "Diesem Client die Nutzung aller freigegebenen MCP-Werkzeuge dieses Arbeitsbereichs erlauben, einschließlich Lesen, Schreiben, Löschen und Verwaltung. Schreibschutz und Sperren verschlüsselter Notizbücher gelten weiterhin.",
+ "mcpOAuthError": "MCP OAuth konnte nicht eingerichtet oder autorisiert werden. Prüfen Sie HTTPS-Ursprung, Rückruf-URL, Anmeldung und Dateiberechtigungen.",
+ "mcpOAuthEndpoint": "MCP-URL",
"removeList": "Liste auflösen",
"entryWindowTopBar": "Obere Leiste neuer Fenster",
"archiveEncryptedNotebooks": "Archivieren und entfernen",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index 0526ecef8c..cd1229229f 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP server OAuth",
+ "mcpOAuthTip": "Requires a lock screen password or OIDC login and a public HTTPS origin; disabling or changing the origin revokes all authorizations",
+ "mcpOAuthPublicURL": "Public HTTPS origin",
+ "mcpOAuthRedirectURI": "Exact client callback URL",
+ "mcpOAuthRegister": "Register client",
+ "mcpOAuthClientID": "Client ID",
+ "mcpOAuthClientSecret": "Client secret",
+ "mcpOAuthSecretTip": "Save this secret now. It is shown only once.",
+ "mcpOAuthRevokeAll": "Revoke all authorizations",
+ "mcpOAuthConsentTip": "Allow this client to use all exposed MCP tools in this workspace, including their read, write, delete and administration capabilities. Read-only restrictions and encrypted notebook locks still apply.",
+ "mcpOAuthError": "Unable to configure or authorize MCP OAuth. Check the HTTPS origin, callback URL, login and file permissions.",
+ "mcpOAuthEndpoint": "MCP URL",
"removeList": "Remove list",
"entryWindowTopBar": "New window top bar",
"archiveEncryptedNotebooks": "Archive and remove",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 7d1b088091..301e2cd02b 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth del servidor MCP",
+ "mcpOAuthTip": "Requiere una contraseña de bloqueo o inicio de sesión OIDC y un origen HTTPS público; desactivarlo o cambiar el origen revoca todas las autorizaciones",
+ "mcpOAuthPublicURL": "Origen HTTPS público",
+ "mcpOAuthRedirectURI": "URL de retorno exacta del cliente",
+ "mcpOAuthRegister": "Registrar cliente",
+ "mcpOAuthClientID": "ID del cliente",
+ "mcpOAuthClientSecret": "Secreto del cliente",
+ "mcpOAuthSecretTip": "Guarde este secreto ahora. Solo se muestra una vez.",
+ "mcpOAuthRevokeAll": "Revocar todas las autorizaciones",
+ "mcpOAuthConsentTip": "Permitir que este cliente use todas las herramientas MCP expuestas en este espacio de trabajo, incluidas sus funciones de lectura, escritura, eliminación y administración. Siguen vigentes las restricciones de solo lectura y los bloqueos de cuadernos cifrados.",
+ "mcpOAuthError": "No se puede configurar o autorizar MCP OAuth. Compruebe el origen HTTPS, la URL de retorno, el inicio de sesión y los permisos de archivo.",
+ "mcpOAuthEndpoint": "URL de MCP",
"removeList": "Quitar formato de lista",
"entryWindowTopBar": "Barra superior de ventanas nuevas",
"archiveEncryptedNotebooks": "Archivar y retirar",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index d97c62609e..82657ca3c0 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth du serveur MCP",
+ "mcpOAuthTip": "Nécessite un mot de passe de verrouillage ou une connexion OIDC et une origine HTTPS publique ; désactiver ou modifier cette origine révoque toutes les autorisations",
+ "mcpOAuthPublicURL": "Origine HTTPS publique",
+ "mcpOAuthRedirectURI": "URL de rappel exacte du client",
+ "mcpOAuthRegister": "Enregistrer un client",
+ "mcpOAuthClientID": "Identifiant du client",
+ "mcpOAuthClientSecret": "Secret du client",
+ "mcpOAuthSecretTip": "Enregistrez ce secret maintenant. Il ne sera affiché qu’une fois.",
+ "mcpOAuthRevokeAll": "Révoquer toutes les autorisations",
+ "mcpOAuthConsentTip": "Autoriser ce client à utiliser tous les outils MCP exposés dans cet espace de travail, notamment leurs fonctions de lecture, écriture, suppression et administration. Les restrictions de lecture seule et le verrouillage des carnets chiffrés restent applicables.",
+ "mcpOAuthError": "Impossible de configurer ou d’autoriser MCP OAuth. Vérifiez l’origine HTTPS, l’URL de rappel, la connexion et les droits sur les fichiers.",
+ "mcpOAuthEndpoint": "URL MCP",
"removeList": "Retirer la mise en forme de liste",
"entryWindowTopBar": "Barre supérieure des nouvelles fenêtres",
"archiveEncryptedNotebooks": "Archiver et retirer",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index cc9945e587..6600970f78 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth של שרת MCP",
+ "mcpOAuthTip": "נדרשים סיסמת נעילת מסך או כניסת OIDC ומקור HTTPS ציבורי; השבתה או שינוי המקור מבטלים את כל ההרשאות",
+ "mcpOAuthPublicURL": "מקור HTTPS ציבורי",
+ "mcpOAuthRedirectURI": "כתובת החזרה המדויקת של הלקוח",
+ "mcpOAuthRegister": "רישום לקוח",
+ "mcpOAuthClientID": "מזהה לקוח",
+ "mcpOAuthClientSecret": "סוד לקוח",
+ "mcpOAuthSecretTip": "יש לשמור את הסוד כעת. הוא מוצג פעם אחת בלבד.",
+ "mcpOAuthRevokeAll": "ביטול כל ההרשאות",
+ "mcpOAuthConsentTip": "לאפשר ללקוח זה להשתמש בכל כלי MCP החשופים בסביבת העבודה הזו, כולל יכולות קריאה, כתיבה, מחיקה וניהול. מגבלות קריאה בלבד ונעילת מחברות מוצפנות ימשיכו לחול.",
+ "mcpOAuthError": "לא ניתן להגדיר או לאשר את MCP OAuth. יש לבדוק את מקור HTTPS, כתובת החזרה, הכניסה והרשאות הקבצים.",
+ "mcpOAuthEndpoint": "כתובת MCP",
"removeList": "הסרת עיצוב רשימה",
"entryWindowTopBar": "הסרגל העליון של חלון חדש",
"archiveEncryptedNotebooks": "ארכוב והסרה",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index 379a0e3e29..37c856019b 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP सर्वर OAuth",
+ "mcpOAuthTip": "लॉक स्क्रीन पासवर्ड या OIDC लॉगिन और सार्वजनिक HTTPS ओरिजिन आवश्यक है; बंद करने या ओरिजिन बदलने से सभी प्राधिकरण रद्द हो जाते हैं",
+ "mcpOAuthPublicURL": "सार्वजनिक HTTPS ओरिजिन",
+ "mcpOAuthRedirectURI": "क्लाइंट का सटीक कॉलबैक URL",
+ "mcpOAuthRegister": "क्लाइंट पंजीकृत करें",
+ "mcpOAuthClientID": "क्लाइंट ID",
+ "mcpOAuthClientSecret": "क्लाइंट सीक्रेट",
+ "mcpOAuthSecretTip": "यह सीक्रेट अभी सहेजें। इसे केवल एक बार दिखाया जाता है।",
+ "mcpOAuthRevokeAll": "सभी प्राधिकरण रद्द करें",
+ "mcpOAuthConsentTip": "इस क्लाइंट को इस कार्यक्षेत्र के सभी उपलब्ध MCP टूल का उपयोग करने दें, जिसमें पढ़ना, लिखना, हटाना और प्रबंधन शामिल है। केवल पढ़ने के प्रतिबंध और एन्क्रिप्टेड नोटबुक के लॉक लागू रहेंगे।",
+ "mcpOAuthError": "MCP OAuth को कॉन्फ़िगर या अधिकृत नहीं किया जा सका। HTTPS ओरिजिन, कॉलबैक URL, लॉगिन और फ़ाइल अनुमतियाँ जाँचें।",
+ "mcpOAuthEndpoint": "MCP URL",
"removeList": "सूची का स्वरूप हटाएँ",
"entryWindowTopBar": "नई विंडो की शीर्ष पट्टी",
"archiveEncryptedNotebooks": "संग्रहित करके हटाएँ",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index f37c788ff2..4a6d4f8562 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth server MCP",
+ "mcpOAuthTip": "Memerlukan kata sandi layar kunci atau login OIDC dan origin HTTPS publik; menonaktifkan atau mengubah origin mencabut semua otorisasi",
+ "mcpOAuthPublicURL": "Origin HTTPS publik",
+ "mcpOAuthRedirectURI": "URL callback klien yang tepat",
+ "mcpOAuthRegister": "Daftarkan klien",
+ "mcpOAuthClientID": "ID klien",
+ "mcpOAuthClientSecret": "Rahasia klien",
+ "mcpOAuthSecretTip": "Simpan rahasia ini sekarang. Hanya ditampilkan sekali.",
+ "mcpOAuthRevokeAll": "Cabut semua otorisasi",
+ "mcpOAuthConsentTip": "Izinkan klien ini menggunakan semua alat MCP yang diekspos di ruang kerja ini, termasuk kemampuan membaca, menulis, menghapus, dan administrasi. Pembatasan hanya baca dan kunci buku catatan terenkripsi tetap berlaku.",
+ "mcpOAuthError": "Tidak dapat mengonfigurasi atau mengotorisasi MCP OAuth. Periksa origin HTTPS, URL callback, login, dan izin berkas.",
+ "mcpOAuthEndpoint": "URL MCP",
"removeList": "Hapus format daftar",
"entryWindowTopBar": "Bilah atas jendela baru",
"archiveEncryptedNotebooks": "Arsipkan dan keluarkan",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index dbc6221260..a6b022f290 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth del server MCP",
+ "mcpOAuthTip": "Richiede una password di blocco o un accesso OIDC e un’origine HTTPS pubblica; disattivare o modificare l’origine revoca tutte le autorizzazioni",
+ "mcpOAuthPublicURL": "Origine HTTPS pubblica",
+ "mcpOAuthRedirectURI": "URL di callback esatto del client",
+ "mcpOAuthRegister": "Registra client",
+ "mcpOAuthClientID": "ID client",
+ "mcpOAuthClientSecret": "Segreto client",
+ "mcpOAuthSecretTip": "Salva subito questo segreto. Viene mostrato una sola volta.",
+ "mcpOAuthRevokeAll": "Revoca tutte le autorizzazioni",
+ "mcpOAuthConsentTip": "Consenti a questo client di usare tutti gli strumenti MCP esposti in questo spazio di lavoro, comprese le funzioni di lettura, scrittura, eliminazione e amministrazione. Restano validi i vincoli di sola lettura e i blocchi dei quaderni cifrati.",
+ "mcpOAuthError": "Impossibile configurare o autorizzare MCP OAuth. Controlla origine HTTPS, URL di callback, accesso e permessi dei file.",
+ "mcpOAuthEndpoint": "URL MCP",
"removeList": "Rimuovi formattazione elenco",
"entryWindowTopBar": "Barra superiore delle nuove finestre",
"archiveEncryptedNotebooks": "Archivia e rimuovi",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 4aaee9ee2e..8b09d16c20 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP サーバー OAuth",
+ "mcpOAuthTip": "画面ロックのパスワードまたは OIDC ログインと公開 HTTPS オリジンが必要です。無効化またはオリジンの変更で全認可が取り消されます",
+ "mcpOAuthPublicURL": "公開 HTTPS オリジン",
+ "mcpOAuthRedirectURI": "クライアントの正確なコールバック URL",
+ "mcpOAuthRegister": "クライアントを登録",
+ "mcpOAuthClientID": "クライアント ID",
+ "mcpOAuthClientSecret": "クライアントシークレット",
+ "mcpOAuthSecretTip": "シークレットを今すぐ保存してください。表示は一度だけです。",
+ "mcpOAuthRevokeAll": "すべての認可を取り消す",
+ "mcpOAuthConsentTip": "このクライアントに、このワークスペースで公開されている全 MCP ツールの使用を許可します。読み取り、書き込み、削除、管理機能が含まれます。読み取り専用の制限と暗号化ノートブックのロックは引き続き適用されます。",
+ "mcpOAuthError": "MCP OAuth を設定または認可できません。HTTPS オリジン、コールバック URL、ログイン状態、ファイル権限を確認してください。",
+ "mcpOAuthEndpoint": "MCP URL",
"removeList": "リストを解除",
"entryWindowTopBar": "新しいウィンドウのトップバー",
"archiveEncryptedNotebooks": "アーカイブして移出",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index e22ff91265..9c73db666d 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP 서버 OAuth",
+ "mcpOAuthTip": "화면 잠금 암호 또는 OIDC 로그인과 공개 HTTPS 출처가 필요하며, 비활성화하거나 출처를 변경하면 모든 승인이 취소됩니다",
+ "mcpOAuthPublicURL": "공개 HTTPS 출처",
+ "mcpOAuthRedirectURI": "클라이언트의 정확한 콜백 URL",
+ "mcpOAuthRegister": "클라이언트 등록",
+ "mcpOAuthClientID": "클라이언트 ID",
+ "mcpOAuthClientSecret": "클라이언트 비밀키",
+ "mcpOAuthSecretTip": "지금 비밀키를 저장하세요. 한 번만 표시됩니다.",
+ "mcpOAuthRevokeAll": "모든 승인 취소",
+ "mcpOAuthConsentTip": "이 클라이언트가 이 작업 공간에서 공개된 모든 MCP 도구의 읽기, 쓰기, 삭제 및 관리 기능을 사용하도록 허용합니다. 읽기 전용 제한과 암호화된 노트북 잠금은 계속 적용됩니다.",
+ "mcpOAuthError": "MCP OAuth를 설정하거나 승인할 수 없습니다. HTTPS 출처, 콜백 URL, 로그인 상태 및 파일 권한을 확인하세요.",
+ "mcpOAuthEndpoint": "MCP URL",
"removeList": "목록 해제",
"entryWindowTopBar": "새 창 상단 표시줄",
"archiveEncryptedNotebooks": "보관 후 내보내기",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 0ba69e2be9..87f7e267d2 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth voor MCP-server",
+ "mcpOAuthTip": "Vereist een vergrendelwachtwoord of OIDC-aanmelding en een openbare HTTPS-oorsprong; uitschakelen of wijzigen van de oorsprong trekt alle machtigingen in",
+ "mcpOAuthPublicURL": "Openbare HTTPS-oorsprong",
+ "mcpOAuthRedirectURI": "Exacte callback-URL van de client",
+ "mcpOAuthRegister": "Client registreren",
+ "mcpOAuthClientID": "Client-ID",
+ "mcpOAuthClientSecret": "Clientgeheim",
+ "mcpOAuthSecretTip": "Bewaar dit geheim nu. Het wordt slechts eenmaal getoond.",
+ "mcpOAuthRevokeAll": "Alle machtigingen intrekken",
+ "mcpOAuthConsentTip": "Deze client toestaan alle beschikbaar gestelde MCP-tools in deze werkruimte te gebruiken, inclusief lezen, schrijven, verwijderen en beheer. Alleen-lezenbeperkingen en vergrendelingen van versleutelde notitieboeken blijven gelden.",
+ "mcpOAuthError": "MCP OAuth kan niet worden ingesteld of geautoriseerd. Controleer de HTTPS-oorsprong, callback-URL, aanmelding en bestandsrechten.",
+ "mcpOAuthEndpoint": "MCP-URL",
"removeList": "Lijstopmaak verwijderen",
"entryWindowTopBar": "Bovenbalk van nieuwe vensters",
"archiveEncryptedNotebooks": "Archiveren en verwijderen",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 0ad7ede697..93a5b23231 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth serwera MCP",
+ "mcpOAuthTip": "Wymaga hasła blokady lub logowania OIDC oraz publicznego adresu HTTPS; wyłączenie lub zmiana adresu cofa wszystkie autoryzacje",
+ "mcpOAuthPublicURL": "Publiczny adres HTTPS",
+ "mcpOAuthRedirectURI": "Dokładny adres zwrotny klienta",
+ "mcpOAuthRegister": "Zarejestruj klienta",
+ "mcpOAuthClientID": "ID klienta",
+ "mcpOAuthClientSecret": "Sekret klienta",
+ "mcpOAuthSecretTip": "Zapisz teraz ten sekret. Jest wyświetlany tylko raz.",
+ "mcpOAuthRevokeAll": "Cofnij wszystkie autoryzacje",
+ "mcpOAuthConsentTip": "Zezwól temu klientowi na korzystanie ze wszystkich udostępnionych narzędzi MCP w tym obszarze roboczym, w tym odczytu, zapisu, usuwania i administracji. Ograniczenia tylko do odczytu i blokady szyfrowanych notatników nadal obowiązują.",
+ "mcpOAuthError": "Nie można skonfigurować lub autoryzować MCP OAuth. Sprawdź adres HTTPS, adres zwrotny, logowanie i uprawnienia plików.",
+ "mcpOAuthEndpoint": "Adres MCP",
"removeList": "Usuń formatowanie listy",
"entryWindowTopBar": "Górny pasek nowego okna",
"archiveEncryptedNotebooks": "Archiwizuj i usuń",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 65faff3ba1..e45113f82b 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth do servidor MCP",
+ "mcpOAuthTip": "Exige uma senha de bloqueio ou login OIDC e uma origem HTTPS pública; desativar ou alterar a origem revoga todas as autorizações",
+ "mcpOAuthPublicURL": "Origem HTTPS pública",
+ "mcpOAuthRedirectURI": "URL de retorno exata do cliente",
+ "mcpOAuthRegister": "Registrar cliente",
+ "mcpOAuthClientID": "ID do cliente",
+ "mcpOAuthClientSecret": "Segredo do cliente",
+ "mcpOAuthSecretTip": "Salve este segredo agora. Ele será exibido apenas uma vez.",
+ "mcpOAuthRevokeAll": "Revogar todas as autorizações",
+ "mcpOAuthConsentTip": "Permitir que este cliente use todas as ferramentas MCP expostas neste espaço de trabalho, incluindo suas funções de leitura, escrita, exclusão e administração. As restrições de somente leitura e os bloqueios de cadernos criptografados continuam em vigor.",
+ "mcpOAuthError": "Não foi possível configurar ou autorizar o MCP OAuth. Verifique a origem HTTPS, a URL de retorno, o login e as permissões dos arquivos.",
+ "mcpOAuthEndpoint": "URL do MCP",
"removeList": "Remover formatação de lista",
"entryWindowTopBar": "Barra superior de novas janelas",
"archiveEncryptedNotebooks": "Arquivar e remover",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 208a9bca2b..d1c25a24af 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth сервера MCP",
+ "mcpOAuthTip": "Требуется пароль блокировки или вход через OIDC и публичный адрес HTTPS; отключение или изменение адреса отзывает все разрешения",
+ "mcpOAuthPublicURL": "Публичный адрес HTTPS",
+ "mcpOAuthRedirectURI": "Точный URL обратного вызова клиента",
+ "mcpOAuthRegister": "Зарегистрировать клиент",
+ "mcpOAuthClientID": "ID клиента",
+ "mcpOAuthClientSecret": "Секрет клиента",
+ "mcpOAuthSecretTip": "Сохраните секрет сейчас. Он показывается только один раз.",
+ "mcpOAuthRevokeAll": "Отозвать все разрешения",
+ "mcpOAuthConsentTip": "Разрешить этому клиенту использовать все открытые инструменты MCP этого рабочего пространства, включая чтение, запись, удаление и администрирование. Ограничения режима чтения и блокировка зашифрованных блокнотов сохраняются.",
+ "mcpOAuthError": "Не удалось настроить или авторизовать MCP OAuth. Проверьте адрес HTTPS, URL обратного вызова, вход и права доступа к файлам.",
+ "mcpOAuthEndpoint": "Адрес MCP",
"removeList": "Убрать форматирование списка",
"entryWindowTopBar": "Верхняя панель нового окна",
"archiveEncryptedNotebooks": "Архивировать и убрать",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index c14f91884c..4c8510fed3 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth servera MCP",
+ "mcpOAuthTip": "Vyžaduje heslo uzamknutia alebo prihlásenie OIDC a verejný pôvod HTTPS; vypnutie alebo zmena pôvodu odvolá všetky autorizácie",
+ "mcpOAuthPublicURL": "Verejný pôvod HTTPS",
+ "mcpOAuthRedirectURI": "Presná adresa spätného volania klienta",
+ "mcpOAuthRegister": "Zaregistrovať klienta",
+ "mcpOAuthClientID": "ID klienta",
+ "mcpOAuthClientSecret": "Tajný kľúč klienta",
+ "mcpOAuthSecretTip": "Uložte si tento kľúč teraz. Zobrazuje sa iba raz.",
+ "mcpOAuthRevokeAll": "Odvolať všetky autorizácie",
+ "mcpOAuthConsentTip": "Povoliť tomuto klientovi používať všetky sprístupnené nástroje MCP v tomto pracovnom priestore vrátane čítania, zápisu, mazania a správy. Obmedzenia iba na čítanie a uzamknutie šifrovaných zápisníkov zostávajú v platnosti.",
+ "mcpOAuthError": "MCP OAuth sa nedá nastaviť alebo autorizovať. Skontrolujte pôvod HTTPS, spätnú adresu, prihlásenie a oprávnenia súborov.",
+ "mcpOAuthEndpoint": "Adresa MCP",
"removeList": "Zrušiť formátovanie zoznamu",
"entryWindowTopBar": "Horná lišta nového okna",
"archiveEncryptedNotebooks": "Archivovať a odstrániť",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index 2067ea194a..00253ed592 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth MCP сервера",
+ "mcpOAuthTip": "Захтева лозинку за закључавање или OIDC пријаву и јавну HTTPS адресу; искључивање или промена адресе опозива сва овлашћења",
+ "mcpOAuthPublicURL": "Јавна HTTPS адреса",
+ "mcpOAuthRedirectURI": "Тачна повратна адреса клијента",
+ "mcpOAuthRegister": "Региструј клијента",
+ "mcpOAuthClientID": "ID клијента",
+ "mcpOAuthClientSecret": "Тајни кључ клијента",
+ "mcpOAuthSecretTip": "Сачувајте овај кључ сада. Приказује се само једном.",
+ "mcpOAuthRevokeAll": "Опозови сва овлашћења",
+ "mcpOAuthConsentTip": "Дозволите овом клијенту да користи све изложене MCP алате у овом радном простору, укључујући читање, писање, брисање и управљање. Ограничења само за читање и закључавање шифрованих бележница и даље важе.",
+ "mcpOAuthError": "Није могуће подесити или овластити MCP OAuth. Проверите HTTPS адресу, повратну адресу, пријаву и дозволе датотека.",
+ "mcpOAuthEndpoint": "MCP адреса",
"removeList": "Уклони форматирање листе",
"entryWindowTopBar": "Горња трака новог прозора",
"archiveEncryptedNotebooks": "Архивирај и уклони",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 931dbe8bc8..b0a8598846 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth ของเซิร์ฟเวอร์ MCP",
+ "mcpOAuthTip": "ต้องมีรหัสผ่านล็อกหน้าจอหรือการเข้าสู่ระบบ OIDC และต้นทาง HTTPS สาธารณะ การปิดหรือเปลี่ยนต้นทางจะเพิกถอนการอนุญาตทั้งหมด",
+ "mcpOAuthPublicURL": "ต้นทาง HTTPS สาธารณะ",
+ "mcpOAuthRedirectURI": "URL เรียกกลับที่ตรงกันของไคลเอนต์",
+ "mcpOAuthRegister": "ลงทะเบียนไคลเอนต์",
+ "mcpOAuthClientID": "ID ไคลเอนต์",
+ "mcpOAuthClientSecret": "ข้อมูลลับของไคลเอนต์",
+ "mcpOAuthSecretTip": "บันทึกข้อมูลลับนี้ทันที ระบบจะแสดงเพียงครั้งเดียว",
+ "mcpOAuthRevokeAll": "เพิกถอนการอนุญาตทั้งหมด",
+ "mcpOAuthConsentTip": "อนุญาตให้ไคลเอนต์นี้ใช้เครื่องมือ MCP ทั้งหมดที่เปิดให้ใช้ในพื้นที่ทำงานนี้ รวมถึงการอ่าน เขียน ลบ และจัดการ โดยยังคงใช้ข้อจำกัดแบบอ่านอย่างเดียวและการล็อกสมุดบันทึกที่เข้ารหัส",
+ "mcpOAuthError": "ไม่สามารถตั้งค่าหรืออนุญาต MCP OAuth ได้ โปรดตรวจสอบต้นทาง HTTPS, URL เรียกกลับ, การเข้าสู่ระบบ และสิทธิ์ไฟล์",
+ "mcpOAuthEndpoint": "URL ของ MCP",
"removeList": "ยกเลิกรูปแบบรายการ",
"entryWindowTopBar": "แถบด้านบนของหน้าต่างใหม่",
"archiveEncryptedNotebooks": "เก็บถาวรและนำออก",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index 3c62d883db..cb1ba8ec20 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP sunucusu OAuth",
+ "mcpOAuthTip": "Ekran kilidi parolası veya OIDC oturumu ve herkese açık bir HTTPS kaynağı gerektirir; kapatmak veya kaynağı değiştirmek tüm yetkileri iptal eder",
+ "mcpOAuthPublicURL": "Herkese açık HTTPS kaynağı",
+ "mcpOAuthRedirectURI": "İstemcinin tam geri çağırma URL’si",
+ "mcpOAuthRegister": "İstemci kaydet",
+ "mcpOAuthClientID": "İstemci kimliği",
+ "mcpOAuthClientSecret": "İstemci sırrı",
+ "mcpOAuthSecretTip": "Bu sırrı şimdi kaydedin. Yalnızca bir kez gösterilir.",
+ "mcpOAuthRevokeAll": "Tüm yetkileri iptal et",
+ "mcpOAuthConsentTip": "Bu istemcinin bu çalışma alanındaki tüm kullanıma açık MCP araçlarını okuma, yazma, silme ve yönetim yetenekleriyle kullanmasına izin verin. Salt okunur kısıtlamaları ve şifreli defter kilitleri geçerli kalır.",
+ "mcpOAuthError": "MCP OAuth yapılandırılamadı veya yetkilendirilemedi. HTTPS kaynağını, geri çağırma URL’sini, oturumu ve dosya izinlerini kontrol edin.",
+ "mcpOAuthEndpoint": "MCP URL’si",
"removeList": "Liste biçimini kaldır",
"entryWindowTopBar": "Yeni pencere üst çubuğu",
"archiveEncryptedNotebooks": "Arşivle ve kaldır",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 0f6598eeb5..1b99a89381 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "OAuth сервера MCP",
+ "mcpOAuthTip": "Потрібен пароль блокування або вхід через OIDC та публічна адреса HTTPS; вимкнення або зміна адреси відкликає всі дозволи",
+ "mcpOAuthPublicURL": "Публічна адреса HTTPS",
+ "mcpOAuthRedirectURI": "Точна URL-адреса зворотного виклику клієнта",
+ "mcpOAuthRegister": "Зареєструвати клієнт",
+ "mcpOAuthClientID": "ID клієнта",
+ "mcpOAuthClientSecret": "Секрет клієнта",
+ "mcpOAuthSecretTip": "Збережіть секрет зараз. Він відображається лише один раз.",
+ "mcpOAuthRevokeAll": "Відкликати всі дозволи",
+ "mcpOAuthConsentTip": "Дозволити цьому клієнту використовувати всі відкриті інструменти MCP цього робочого простору, зокрема читання, запис, видалення й адміністрування. Обмеження режиму читання та блокування зашифрованих записників залишаються чинними.",
+ "mcpOAuthError": "Не вдалося налаштувати або авторизувати MCP OAuth. Перевірте адресу HTTPS, URL зворотного виклику, вхід і права доступу до файлів.",
+ "mcpOAuthEndpoint": "Адреса MCP",
"removeList": "Прибрати форматування списку",
"entryWindowTopBar": "Верхня панель нового вікна",
"archiveEncryptedNotebooks": "Архівувати та вилучити",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 9e05df9296..86b81d9daa 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP 服务端 OAuth",
+ "mcpOAuthTip": "需要锁屏密码或 OIDC 登录,以及公开的 HTTPS 地址;关闭或修改地址会撤销全部授权",
+ "mcpOAuthPublicURL": "公开 HTTPS 地址",
+ "mcpOAuthRedirectURI": "客户端的完整回调地址",
+ "mcpOAuthRegister": "注册客户端",
+ "mcpOAuthClientID": "客户端 ID",
+ "mcpOAuthClientSecret": "客户端密钥",
+ "mcpOAuthSecretTip": "请立即保存密钥,仅显示这一次。",
+ "mcpOAuthRevokeAll": "撤销全部授权",
+ "mcpOAuthConsentTip": "允许此客户端使用当前工作空间对外开放的全部 MCP 工具,包括其读取、写入、删除和管理能力。只读限制和加密笔记本锁定仍然生效。",
+ "mcpOAuthError": "无法配置或授权 MCP OAuth,请检查 HTTPS 地址、回调地址、登录状态和文件权限。",
+ "mcpOAuthEndpoint": "MCP 地址",
"removeList": "取消列表",
"entryWindowTopBar": "新窗口顶栏",
"archiveEncryptedNotebooks": "打包移出",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 598a34146f..4a20d184b4 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -1,4 +1,16 @@
{
+ "mcpOAuthServer": "MCP 伺服器 OAuth",
+ "mcpOAuthTip": "需要鎖定畫面密碼或 OIDC 登入,以及公開的 HTTPS 網址;停用或修改網址會撤銷全部授權",
+ "mcpOAuthPublicURL": "公開 HTTPS 網址",
+ "mcpOAuthRedirectURI": "用戶端的完整回呼網址",
+ "mcpOAuthRegister": "註冊用戶端",
+ "mcpOAuthClientID": "用戶端 ID",
+ "mcpOAuthClientSecret": "用戶端密鑰",
+ "mcpOAuthSecretTip": "請立即儲存密鑰,僅顯示這一次。",
+ "mcpOAuthRevokeAll": "撤銷全部授權",
+ "mcpOAuthConsentTip": "允許此用戶端使用目前工作空間對外開放的全部 MCP 工具,包括其讀取、寫入、刪除及管理能力。唯讀限制和加密筆記本鎖定仍然生效。",
+ "mcpOAuthError": "無法設定或授權 MCP OAuth,請檢查 HTTPS 網址、回呼網址、登入狀態及檔案權限。",
+ "mcpOAuthEndpoint": "MCP 網址",
"removeList": "取消列表",
"entryWindowTopBar": "新視窗頂欄",
"archiveEncryptedNotebooks": "封存並移出",
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20230304000547-ibldj1z/20260804223002-mcpsv03.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20230304000547-ibldj1z/20260804223002-mcpsv03.sy
index 82a0ad70ab..e29a3409d8 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20230304000547-ibldj1z/20260804223002-mcpsv03.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20230304000547-ibldj1z/20260804223002-mcpsv03.sy
@@ -6,7 +6,7 @@
"id": "20260804223002-mcpsv03",
"title": "MCP Service",
"type": "doc",
- "updated": "20260804230000"
+ "updated": "20260926135700"
},
"Children": [
{"ID": "20260804223101-mcpen01", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223101-mcpen01", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "Overview"}]},
@@ -21,6 +21,11 @@
{"ID": "20260804223110-mcpen10", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223110-mcpen10", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "Permissions and security"}]},
{"ID": "20260804223111-mcpen11", "Type": "NodeParagraph", "Properties": {"id": "20260804223111-mcpen11", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "The MCP endpoint only accepts authenticated administrator access. The API token represents administrator access to the workspace. A connected client can read data and may modify or delete data, access workspace files, execute SQL, or trigger synchronization, so only connect trusted clients."}]},
{"ID": "20260804223112-mcpen12", "Type": "NodeParagraph", "Properties": {"id": "20260804223112-mcpen12", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "Read-only mode rejects MCP POST and DELETE requests, so tools cannot be used normally. Do not expose the SiYuan service port directly to an untrusted network. For remote access, use HTTPS, a reverse proxy, or a firewall, and replace the token immediately if it is exposed."}]},
- {"ID": "20260804223113-mcpen13", "Type": "NodeParagraph", "Properties": {"id": "20260804223113-mcpen13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "To operate SiYuan directly through HTTP endpoints, see "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20201227201751-gv0fpx2", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "Kernel API"}, {"Type": "NodeText", "Data": ". To configure external MCP services for the SiYuan AI agent, see "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171004-aiagt03", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI Agent"}, {"Type": "NodeText", "Data": "."}]}
+ {"ID": "20260804223113-mcpen13", "Type": "NodeParagraph", "Properties": {"id": "20260804223113-mcpen13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "To operate SiYuan directly through HTTP endpoints, see "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20201227201751-gv0fpx2", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "Kernel API"}, {"Type": "NodeText", "Data": ". To configure external MCP services for the SiYuan AI agent, see "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171004-aiagt03", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI Agent"}, {"Type": "NodeText", "Data": "."}]},
+ {"ID": "20260926135700-qwphgrd", "Type": "NodeHeading", "Properties": {"id": "20260926135700-qwphgrd", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "OAuth connections"}], "HeadingLevel": 2},
+ {"ID": "20260926135700-ob3m8qh", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-ob3m8qh", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "Open "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "Settings"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "AI"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "MCP"}, {"Type": "NodeText", "Data": " to configure MCP server OAuth. It is disabled by default and requires a lock screen password or OIDC login. Enter the public HTTPS origin, such as https://note.example.com, without a path. The MCP address is https://note.example.com/mcp; the reverse proxy must preserve the public Host and forward /.well-known/ and /oauth/mcp/ as well as /mcp and the login page."}]},
+ {"ID": "20260926135700-qek3gz7", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-qek3gz7", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "Register a client using its name and the exact callback URL shown by the MCP client, such as ChatGPT. Save the client ID and secret immediately; the secret is displayed only once. Enter both in the client’s OAuth connection settings, connect to the MCP address, sign in to SiYuan and confirm authorization. Dynamic client registration is not supported."}]},
+ {"ID": "20260926135700-3re293l", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-3re293l", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "Authorization allows all MCP tools currently exposed by this workspace, including read, write, delete and administration capabilities. OAuth tokens work only on /mcp. Read-only mode and encrypted notebook locks still apply; authorization does not unlock notebooks. Existing API token connections continue to work."}]},
+ {"ID": "20260926135700-79q86ot", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-79q86ot", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "Access tokens expire after one hour. Clients requesting offline_access receive rotating refresh tokens valid for up to thirty days from authorization. Removing a client revokes its tokens; Revoke all authorizations retains client registrations. Disabling OAuth, changing the public origin or changing administrator authentication configuration revokes existing authorizations. The configuration and credential hashes are stored locally in conf/mcp-oauth.json; keep this file private and do not share it between workspaces."}]}
]
}
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20230303235619-ex5l63e/20260804223000-mcpsv01.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20230303235619-ex5l63e/20260804223000-mcpsv01.sy
index ab189eb751..2972950182 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20230303235619-ex5l63e/20260804223000-mcpsv01.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20230303235619-ex5l63e/20260804223000-mcpsv01.sy
@@ -6,7 +6,7 @@
"id": "20260804223000-mcpsv01",
"title": "MCP 服务",
"type": "doc",
- "updated": "20260804230000"
+ "updated": "20260926135700"
},
"Children": [
{"ID": "20260804223001-mcpcn01", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223001-mcpcn01", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "概述"}]},
@@ -21,6 +21,11 @@
{"ID": "20260804223010-mcpcn10", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223010-mcpcn10", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "权限和安全"}]},
{"ID": "20260804223011-mcpcn11", "Type": "NodeParagraph", "Properties": {"id": "20260804223011-mcpcn11", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "MCP 端点仅允许通过鉴权的管理员访问。API token 代表工作空间的管理员权限,连接的客户端可以读取数据,也可能修改或删除数据、访问工作空间文件、执行 SQL 或触发同步等操作,因此只应连接可信客户端。"}]},
{"ID": "20260804223012-mcpcn12", "Type": "NodeParagraph", "Properties": {"id": "20260804223012-mcpcn12", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "只读模式会拒绝 MCP 的 POST 和 DELETE 请求,因而无法正常调用工具。不要直接将思源服务端口暴露到不可信网络;远程使用时应配置 HTTPS、反向代理或防火墙,并在 token 泄露后立即更换。"}]},
- {"ID": "20260804223013-mcpcn13", "Type": "NodeParagraph", "Properties": {"id": "20260804223013-mcpcn13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "若要直接通过 HTTP 接口操作思源,请参阅 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20201227194925-7ipoiv6", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "内核 API"}, {"Type": "NodeText", "Data": ";若要为思源 AI 智能体配置外部 MCP 服务,请参阅 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171000-aiagt01", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI 智能体"}, {"Type": "NodeText", "Data": "。"}]}
+ {"ID": "20260804223013-mcpcn13", "Type": "NodeParagraph", "Properties": {"id": "20260804223013-mcpcn13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "若要直接通过 HTTP 接口操作思源,请参阅 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20201227194925-7ipoiv6", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "内核 API"}, {"Type": "NodeText", "Data": ";若要为思源 AI 智能体配置外部 MCP 服务,请参阅 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171000-aiagt01", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI 智能体"}, {"Type": "NodeText", "Data": "。"}]},
+ {"ID": "20260926135700-06e5wr2", "Type": "NodeHeading", "Properties": {"id": "20260926135700-06e5wr2", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "OAuth 连接"}], "HeadingLevel": 2},
+ {"ID": "20260926135700-oegwoa6", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-oegwoa6", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "在 "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "设置"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "AI"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "MCP"}, {"Type": "NodeText", "Data": " 中配置 MCP 服务端 OAuth。默认关闭,需要设置锁屏密码或 OIDC 登录。填写公开的 HTTPS 地址,例如 https://note.example.com,不包含路径。MCP 地址为 https://note.example.com/mcp;反向代理需要保留公开的 Host,同时转发 /.well-known/、/oauth/mcp/、/mcp 和登录页面。"}]},
+ {"ID": "20260926135700-4s5iwp4", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-4s5iwp4", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "使用客户端名称和 MCP 客户端(例如 ChatGPT)显示的完整回调地址注册客户端。立即保存客户端 ID 和密钥,密钥仅显示一次。在客户端的 OAuth 连接设置中填写二者,连接 MCP 地址,登录思源并确认授权。不支持动态客户端注册。"}]},
+ {"ID": "20260926135700-wyl79ns", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-wyl79ns", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "授权允许使用当前工作空间对外开放的全部 MCP 工具,包括读取、写入、删除和管理能力。OAuth 令牌仅能用于 /mcp。只读模式和加密笔记本锁定仍然生效,授权不会解锁笔记本。原有 API Token 连接方式继续可用。"}]},
+ {"ID": "20260926135700-tpszwn3", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-tpszwn3", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "访问令牌有效期为一小时。申请 offline_access 的客户端会获得轮换的刷新令牌,其有效期最长为授权后的三十天。移除客户端会撤销其令牌;撤销全部授权会保留客户端注册。关闭 OAuth、修改公开地址或修改管理员认证配置都会撤销已有授权。配置与凭证摘要保存在本地 conf/mcp-oauth.json,请妥善保管此文件,不要在工作空间之间共享。"}]}
]
}
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20230304000829-9jwu3po/20260804223001-mcpsv02.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20230304000829-9jwu3po/20260804223001-mcpsv02.sy
index 99a2dae027..f8347badc2 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20230304000829-9jwu3po/20260804223001-mcpsv02.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20230304000829-9jwu3po/20260804223001-mcpsv02.sy
@@ -6,7 +6,7 @@
"id": "20260804223001-mcpsv02",
"title": "MCP 服務",
"type": "doc",
- "updated": "20260804230000"
+ "updated": "20260926135700"
},
"Children": [
{"ID": "20260804223201-mcptw01", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223201-mcptw01", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "概述"}]},
@@ -21,6 +21,11 @@
{"ID": "20260804223210-mcptw10", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223210-mcptw10", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "權限和安全"}]},
{"ID": "20260804223211-mcptw11", "Type": "NodeParagraph", "Properties": {"id": "20260804223211-mcptw11", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "MCP 端點只允許通過鑑權的管理員存取。API token 代表工作空間的管理員權限,連線的用戶端可以讀取資料,也可能修改或刪除資料、存取工作空間檔案、執行 SQL 或觸發同步等操作,因此只應連線可信任的用戶端。"}]},
{"ID": "20260804223212-mcptw12", "Type": "NodeParagraph", "Properties": {"id": "20260804223212-mcptw12", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "唯讀模式會拒絕 MCP 的 POST 和 DELETE 請求,因此無法正常呼叫工具。不要直接將思源服務連接埠暴露到不可信任的網路;遠端使用時應設定 HTTPS、反向代理或防火牆,並在 token 洩露後立即更換。"}]},
- {"ID": "20260804223213-mcptw13", "Type": "NodeParagraph", "Properties": {"id": "20260804223213-mcptw13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "若要直接透過 HTTP 介面操作思源,請參閱 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20211226121329-c5v3dto", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "Kernel API"}, {"Type": "NodeText", "Data": ";若要為思源 AI 智能體設定外部 MCP 服務,請參閱 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171002-aiagt02", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI 智能體"}, {"Type": "NodeText", "Data": "。"}]}
+ {"ID": "20260804223213-mcptw13", "Type": "NodeParagraph", "Properties": {"id": "20260804223213-mcptw13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "若要直接透過 HTTP 介面操作思源,請參閱 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20211226121329-c5v3dto", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "Kernel API"}, {"Type": "NodeText", "Data": ";若要為思源 AI 智能體設定外部 MCP 服務,請參閱 "}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171002-aiagt02", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI 智能體"}, {"Type": "NodeText", "Data": "。"}]},
+ {"ID": "20260926135700-8fdatrx", "Type": "NodeHeading", "Properties": {"id": "20260926135700-8fdatrx", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "OAuth 連線"}], "HeadingLevel": 2},
+ {"ID": "20260926135700-128t5g7", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-128t5g7", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "在 "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "設定"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "AI"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "MCP"}, {"Type": "NodeText", "Data": " 中設定 MCP 伺服器 OAuth。預設停用,需要設定鎖定畫面密碼或 OIDC 登入。填寫公開的 HTTPS 網址,例如 https://note.example.com,不包含路徑。MCP 網址為 https://note.example.com/mcp;反向代理需要保留公開的 Host,同時轉送 /.well-known/、/oauth/mcp/、/mcp 和登入頁面。"}]},
+ {"ID": "20260926135700-81unhnf", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-81unhnf", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "使用用戶端名稱和 MCP 用戶端(例如 ChatGPT)顯示的完整回呼網址註冊用戶端。立即儲存用戶端 ID 和密鑰,密鑰僅顯示一次。在用戶端的 OAuth 連線設定中填寫兩者,連線至 MCP 網址,登入思源並確認授權。不支援動態用戶端註冊。"}]},
+ {"ID": "20260926135700-ksuwtso", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-ksuwtso", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "授權允許使用目前工作空間對外開放的全部 MCP 工具,包括讀取、寫入、刪除和管理能力。OAuth 權杖僅能用於 /mcp。唯讀模式和加密筆記本鎖定仍然生效,授權不會解鎖筆記本。原有 API Token 連線方式仍可使用。"}]},
+ {"ID": "20260926135700-k0enag2", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-k0enag2", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "存取權杖有效期為一小時。申請 offline_access 的用戶端會取得輪換的更新權杖,其有效期最長為授權後的三十天。移除用戶端會撤銷其權杖;撤銷全部授權會保留用戶端註冊。停用 OAuth、修改公開網址或修改管理員認證設定都會撤銷既有授權。設定與憑證摘要儲存在本機 conf/mcp-oauth.json,請妥善保管此檔案,不要在工作空間之間共用。"}]}
]
}
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-ei5t6tt/20260804223003-mcpsv04.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-ei5t6tt/20260804223003-mcpsv04.sy
index 3b3778c383..10452df96d 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-ei5t6tt/20260804223003-mcpsv04.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-ei5t6tt/20260804223003-mcpsv04.sy
@@ -6,7 +6,7 @@
"id": "20260804223003-mcpsv04",
"title": "MCP サービス",
"type": "doc",
- "updated": "20260804230000"
+ "updated": "20260926135700"
},
"Children": [
{"ID": "20260804223301-mcpja01", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223301-mcpja01", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "概要"}]},
@@ -21,6 +21,11 @@
{"ID": "20260804223310-mcpja10", "Type": "NodeHeading", "HeadingLevel": 2, "Properties": {"id": "20260804223310-mcpja10", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "権限とセキュリティ"}]},
{"ID": "20260804223311-mcpja11", "Type": "NodeParagraph", "Properties": {"id": "20260804223311-mcpja11", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "MCP エンドポイントには、認証済みの管理者だけがアクセスできます。API トークンはワークスペースの管理者権限を表します。接続したクライアントはデータを読み取るだけでなく、データの変更や削除、ワークスペースファイルへのアクセス、SQL の実行、同期の開始などを行えるため、信頼できるクライアントだけを接続してください。"}]},
{"ID": "20260804223312-mcpja12", "Type": "NodeParagraph", "Properties": {"id": "20260804223312-mcpja12", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "読み取り専用モードでは MCP の POST と DELETE リクエストが拒否されるため、ツールを通常どおり使用できません。SiYuan のサービスポートを信頼できないネットワークへ直接公開しないでください。リモートで使用する場合は HTTPS、リバースプロキシ、またはファイアウォールを設定し、トークンが漏えいした場合は直ちに変更してください。"}]},
- {"ID": "20260804223313-mcpja13", "Type": "NodeParagraph", "Properties": {"id": "20260804223313-mcpja13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "HTTP エンドポイントから SiYuan を直接操作する方法については、"}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20240530101000-dytmky4", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "カーネル API"}, {"Type": "NodeText", "Data": " を参照してください。SiYuan の AI エージェントに外部 MCP サービスを設定する方法については、"}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171006-aiagt04", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI エージェント"}, {"Type": "NodeText", "Data": " を参照してください。"}]}
+ {"ID": "20260804223313-mcpja13", "Type": "NodeParagraph", "Properties": {"id": "20260804223313-mcpja13", "updated": "20260804230000"}, "Children": [{"Type": "NodeText", "Data": "HTTP エンドポイントから SiYuan を直接操作する方法については、"}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20240530101000-dytmky4", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "カーネル API"}, {"Type": "NodeText", "Data": " を参照してください。SiYuan の AI エージェントに外部 MCP サービスを設定する方法については、"}, {"Type": "NodeTextMark", "TextMarkType": "block-ref", "TextMarkBlockRefID": "20260804171006-aiagt04", "TextMarkBlockRefSubtype": "s", "TextMarkTextContent": "AI エージェント"}, {"Type": "NodeText", "Data": " を参照してください。"}]},
+ {"ID": "20260926135700-mjre3iy", "Type": "NodeHeading", "Properties": {"id": "20260926135700-mjre3iy", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "OAuth 接続"}], "HeadingLevel": 2},
+ {"ID": "20260926135700-somnx90", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-somnx90", "updated": "20260926135700"}, "Children": [{"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "設定"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "AI"}, {"Type": "NodeText", "Data": " - "}, {"Type": "NodeTextMark", "TextMarkType": "kbd", "TextMarkTextContent": "MCP"}, {"Type": "NodeText", "Data": " で MCP サーバー OAuth を設定します。既定では無効で、画面ロックのパスワードまたは OIDC ログインが必要です。https://note.example.com のような公開 HTTPS オリジンを、パスを含めずに入力します。MCP アドレスは https://note.example.com/mcp です。リバースプロキシでは公開 Host を保持し、/mcp とログインページに加え、/.well-known/ と /oauth/mcp/ も転送してください。"}]},
+ {"ID": "20260926135700-w2n6408", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-w2n6408", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "MCP クライアント(ChatGPT など)に表示される正確なコールバック URL と名前を使ってクライアントを登録します。クライアント ID とシークレットをすぐに保存してください。シークレットは一度しか表示されません。クライアントの OAuth 接続設定に両方を入力し、MCP アドレスに接続して思源にログインし、認可を確認します。動的クライアント登録には対応していません。"}]},
+ {"ID": "20260926135700-9tqd3uq", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-9tqd3uq", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "認可により、このワークスペースで公開されている全 MCP ツールの読み取り、書き込み、削除、管理機能を使用できます。OAuth トークンは /mcp のみで使用できます。読み取り専用モードと暗号化ノートブックのロックは引き続き適用され、認可してもノートブックはロック解除されません。既存の API Token 接続も引き続き利用できます。"}]},
+ {"ID": "20260926135700-a1ugcx3", "Type": "NodeParagraph", "Properties": {"id": "20260926135700-a1ugcx3", "updated": "20260926135700"}, "Children": [{"Type": "NodeText", "Data": "アクセストークンの有効期限は一時間です。offline_access を要求するクライアントには、認可から最大三十日間有効な、使用ごとに更新されるリフレッシュトークンが発行されます。クライアントを削除するとそのトークンが取り消されます。すべての認可を取り消してもクライアント登録は保持されます。OAuth の無効化、公開オリジンの変更、管理者認証設定の変更でも既存の認可が取り消されます。設定と認証情報のハッシュはローカルの conf/mcp-oauth.json に保存されます。このファイルを保護し、ワークスペース間で共有しないでください。"}]}
]
}
diff --git a/app/src/config/tabs/ai/aiTab.ts b/app/src/config/tabs/ai/aiTab.ts
index 16b00793fa..b2f0f67456 100644
--- a/app/src/config/tabs/ai/aiTab.ts
+++ b/app/src/config/tabs/ai/aiTab.ts
@@ -31,6 +31,7 @@ import {
} from "./aiSkillUi";
import {isAgentStreamingMarkdownEnabled, setAgentStreamingMarkdownEnabled} from "./agentStreamingMarkdown";
import {openSkillManager} from "../../../ai/skills/manager";
+import {genMcpOAuthHtml, mountMcpOAuth} from "./mcpOAuthUi";
const registerAiProvidersGroup = (tab: SettingTabBuilder) => {
const group = tab.group("providers", window.siyuan.languages.apiProvider);
@@ -229,6 +230,13 @@ const registerAiSkillsGroup = (tab: SettingTabBuilder) => {
const registerAiMcpGroup = (tab: SettingTabBuilder) => {
const group = tab.group("mcp", window.siyuan.languages.configGroupMcp);
+ group.slot({
+ key: "mcpOAuthServer",
+ keywords: [window.siyuan.languages.mcpOAuthServer, "OAuth", "ChatGPT"],
+ html: genMcpOAuthHtml,
+ afterMount: mountMcpOAuth,
+ });
+
group.slot({
key: "mcpServers",
keywords: getMcpServersBlockKeywords(),
diff --git a/app/src/config/tabs/ai/mcpOAuthUi.ts b/app/src/config/tabs/ai/mcpOAuthUi.ts
new file mode 100644
index 0000000000..5267c7a4c5
--- /dev/null
+++ b/app/src/config/tabs/ai/mcpOAuthUi.ts
@@ -0,0 +1,78 @@
+import {fetchSyncPost} from "../../../util/fetch";
+import {showMessage} from "../../../dialog/message";
+
+export const genMcpOAuthHtml = () => "<div class=\"b3-label config-item\" id=\"mcpOAuthSettings\"></div>";
+
+export const mountMcpOAuth = (root: HTMLElement) => {
+ const block = root.querySelector<HTMLElement>("#mcpOAuthSettings");
+ if (!block) {
+ return;
+ }
+ const lang = window.siyuan.languages;
+ const escape = Lute.EscapeHTMLStr;
+ const input = (field: string, label: string, value = "", readonly = false) =>
+ `<label class="fn__block">${escape(label)}<input class="b3-text-field fn__block" data-field="${field}" value="${escape(value)}" ${readonly ? "readonly" : ""} spellcheck="false"></label><div class="fn__hr"></div>`;
+
+ const render = async () => {
+ const response = await fetchSyncPost("/api/mcp/getOAuth", {});
+ if (response.code !== 0 || !block.isConnected) {
+ return;
+ }
+ const status = response.data;
+ block.innerHTML = `<div class="b3-label__text">${escape(lang.mcpOAuthServer)}</div>
+<div class="b3-label__text ft__on-surface">${escape(lang.mcpOAuthTip)}</div><div class="fn__hr"></div>
+<label class="fn__flex"><span class="fn__flex-1">${escape(lang.mcpOAuthServer)}</span><input class="b3-switch" type="checkbox" data-field="enabled" ${status.enabled ? "checked" : ""}></label><div class="fn__hr"></div>
+${input("publicURL", lang.mcpOAuthPublicURL, status.publicURL)}
+<button class="b3-button b3-button--outline" data-action="save">${escape(lang.save)}</button>
+<button class="b3-button b3-button--outline" data-action="revoke">${escape(lang.mcpOAuthRevokeAll)}</button><div class="fn__hr"></div>
+${status.publicURL ? input("endpoint", lang.mcpOAuthEndpoint, status.publicURL + "/mcp", true) : ""}
+${input("name", lang.name)}${input("redirectURI", lang.mcpOAuthRedirectURI)}
+<button class="b3-button b3-button--outline" data-action="register">${escape(lang.mcpOAuthRegister)}</button>
+<div data-secret></div><div class="fn__hr"></div>
+${status.clients.map(client => `<div class="fn__hr"></div><div class="fn__flex"><span class="fn__flex-1">${escape(client.name)}</span><button class="b3-button b3-button--outline" data-action="remove" data-id="${escape(client.id)}">${escape(lang.remove)}</button></div>
+${input("clientID", lang.mcpOAuthClientID, client.id, true)}${input("callback", lang.mcpOAuthRedirectURI, client.redirectURI, true)}`).join("")}`;
+ setDisabled(Boolean(window.siyuan.config.readonly));
+ };
+ const setDisabled = (disabled: boolean) => {
+ block.querySelectorAll<HTMLInputElement | HTMLButtonElement>("input:not([readonly]), button").forEach(element => {
+ element.disabled = disabled;
+ });
+ };
+ const value = (field: string) => block.querySelector<HTMLInputElement>(`[data-field="${field}"]`).value.trim();
+ block.addEventListener("click", async event => {
+ const button = (event.target as HTMLElement).closest<HTMLButtonElement>("button[data-action]");
+ if (!button || button.disabled || window.siyuan.config.readonly) {
+ return;
+ }
+ setDisabled(true);
+ try {
+ const action = button.dataset.action;
+ if (action === "register") {
+ const response = await fetchSyncPost("/api/mcp/addOAuthClient", {name: value("name"), redirectURI: value("redirectURI")});
+ if (response.code === 0 && block.isConnected) {
+ await render();
+ const secret = block.querySelector<HTMLElement>("[data-secret]");
+ secret.innerHTML = `<div class="fn__hr"></div><p>${escape(lang.mcpOAuthSecretTip)}</p>${input("newClientID", lang.mcpOAuthClientID, response.data.id, true)}${input("newClientSecret", lang.mcpOAuthClientSecret, response.data.secret, true)}`;
+ }
+ } else if (action === "save") {
+ const response = await fetchSyncPost("/api/mcp/setOAuth", {
+ enabled: block.querySelector<HTMLInputElement>("[data-field='enabled']").checked,
+ publicURL: value("publicURL"),
+ });
+ if (response.code === 0) {
+ await render();
+ }
+ } else {
+ const response = await fetchSyncPost("/api/mcp/removeOAuthClient", {id: button.dataset.id || "", all: action === "revoke"});
+ if (response.code === 0) {
+ await render();
+ }
+ }
+ } catch (error) {
+ showMessage(lang.mcpOAuthError);
+ } finally {
+ setDisabled(Boolean(window.siyuan.config.readonly));
+ }
+ });
+ void render().catch(() => showMessage(lang.mcpOAuthError));
+};
diff --git a/app/src/protyle/util/navigationHistory.test.ts b/app/src/protyle/util/navigationHistory.test.ts
index 5cff17cd96..7b416de3c4 100644
--- a/app/src/protyle/util/navigationHistory.test.ts
+++ b/app/src/protyle/util/navigationHistory.test.ts
@@ -48,7 +48,6 @@ const navigate = (action: string[], tablet = true, suppressFocus = false) => {
block: {id: "block", rootID: "root"},
wysiwyg: {element: {ownerDocument: {activeElement: null}, querySelectorAll: () => [element], firstElementChild: element}},
contentElement: {addEventListener: () => {}},
- element: {addEventListener: () => {}},
observer: {unobserve: () => {}},
}, action, undefined, undefined, false, suppressFocus);
return {records, focused};
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index f64cc7107e..d2fe563988 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -1304,6 +1304,22 @@ export type LockScreenRequestInput = { "lockScreenMode": number; };
export type Login2faEnvelope = { "code": number; "data": ({ "code": number; "msg": string; } & { [key: string]: JSONValue }) | null; "msg": string; };
+export type MCPOAuthClient = { "id": string; "name": string; "redirectURI": string; };
+
+export type MCPOAuthClientRequestInput = { "name": string; "redirectURI": string; };
+
+export type MCPOAuthClientSecret = { "id": string; "name": string; "redirectURI": string; "secret": string; };
+
+export type MCPOAuthConfigInput = { "enabled": boolean; "publicURL": string; };
+
+export type MCPOAuthConsentRequestInput = { "decision"?: string; "ticket"?: string; };
+
+export type MCPOAuthRemoveRequestInput = { "all"?: boolean; "id"?: string; };
+
+export type MCPOAuthStatus = { "clients": Array<MCPOAuthClient> | null; "enabled": boolean; "publicURL": string; };
+
+export type MCPOAuthTokenRequestInput = { "client_id"?: string; "client_secret"?: string; "code"?: string; "code_verifier"?: string; "grant_type"?: string; "redirect_uri"?: string; "refresh_token"?: string; "resource"?: string; "scope"?: string; "token"?: string; "token_type_hint"?: string; };
+
export type MarkdownHTMLRequestInput = { "markdown": string; "mode"?: string | null; };
export type MigrateLegacyMindmapsData = { "blocks": Array<BlockDOMData> | null; "converted": number; };
@@ -2318,6 +2334,27 @@ export type APILegacyGETPath =
never;
export interface APIGETRoutes {
+ "/.well-known/oauth-authorization-server": {
+ request: EmptyRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ output: "binary";
+ contentVariants: [{"status":200,"contentType":"application/json"},{"status":400,"contentType":"application/json"},{"status":401,"contentType":"application/json"},{"status":404,"contentType":"application/json"},{"status":429,"contentType":"application/json"},{"status":500,"contentType":"application/json"}];
+ };
+ "/.well-known/oauth-protected-resource": {
+ request: EmptyRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ output: "binary";
+ contentVariants: [{"status":200,"contentType":"application/json"},{"status":400,"contentType":"application/json"},{"status":401,"contentType":"application/json"},{"status":404,"contentType":"application/json"},{"status":429,"contentType":"application/json"},{"status":500,"contentType":"application/json"}];
+ };
+ "/.well-known/oauth-protected-resource/mcp": {
+ request: EmptyRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ output: "binary";
+ contentVariants: [{"status":200,"contentType":"application/json"},{"status":400,"contentType":"application/json"},{"status":401,"contentType":"application/json"},{"status":404,"contentType":"application/json"},{"status":429,"contentType":"application/json"},{"status":500,"contentType":"application/json"}];
+ };
"/api/ai/mcp/oauth/callback/:flowID": {
request: EmptyRequestInput;
response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
@@ -2417,6 +2454,13 @@ export interface APIGETRoutes {
output: "proxy";
proxy: {"kind":"eventSource","contentType":"text/event-stream","upstreamStatuses":true};
};
+ "/oauth/mcp/authorize": {
+ request: EmptyRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ output: "binary";
+ contentVariants: [{"status":200,"contentType":"text/html"},{"status":302,"contentType":"text/html"},{"status":400,"contentType":"text/html"}];
+ };
"/plugin/private/:name/*path": {
request: Blob;
response: Blob | JSONValue | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
@@ -4236,6 +4280,26 @@ export interface APIPOSTRoutes {
response: { "code": 0; "data": WPSPresentationData; "msg": string; } | { "code": -1; "data": ({ "closeTimeout": number; } & { "converted"?: never; "dom"?: never; }) | null | (WPSPresentationData & { "closeTimeout"?: never; }); "msg": string; };
body: "json";
};
+ "/api/mcp/addOAuthClient": {
+ request: MCPOAuthClientRequestInput;
+ response: { "code": 0; "data": MCPOAuthClientSecret; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/mcp/getOAuth": {
+ request: EmptyRequestInput;
+ response: { "code": 0; "data": MCPOAuthStatus; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "none";
+ };
+ "/api/mcp/removeOAuthClient": {
+ request: MCPOAuthRemoveRequestInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
+ "/api/mcp/setOAuth": {
+ request: MCPOAuthConfigInput;
+ response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "json";
+ };
"/api/network/echo": {
request: Blob;
response: { "code": 0; "data": NetworkEchoData; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
@@ -5640,6 +5704,27 @@ export interface APIPOSTRoutes {
response: { "code": 0; "data": null; "msg": string; } | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
body: "none";
};
+ "/oauth/mcp/consent": {
+ request: MCPOAuthConsentRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "form";
+ output: "binary";
+ contentVariants: [{"status":302,"contentType":"text/html"},{"status":400,"contentType":"text/html"}];
+ };
+ "/oauth/mcp/revoke": {
+ request: MCPOAuthTokenRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "form";
+ output: "binary";
+ contentVariants: [{"status":200,"contentType":"application/json"},{"status":400,"contentType":"application/json"},{"status":401,"contentType":"application/json"},{"status":404,"contentType":"application/json"},{"status":429,"contentType":"application/json"},{"status":500,"contentType":"application/json"}];
+ };
+ "/oauth/mcp/token": {
+ request: MCPOAuthTokenRequestInput;
+ response: Blob | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
+ body: "form";
+ output: "binary";
+ contentVariants: [{"status":200,"contentType":"application/json"},{"status":400,"contentType":"application/json"},{"status":401,"contentType":"application/json"},{"status":404,"contentType":"application/json"},{"status":429,"contentType":"application/json"},{"status":500,"contentType":"application/json"}];
+ };
"/plugin/private/:name/*path": {
request: Blob;
response: Blob | JSONValue | { "code": -1; "data": { "closeTimeout": number; } | null; "msg": string; };
diff --git a/kernel/api/contract_mcp_oauth_test.go b/kernel/api/contract_mcp_oauth_test.go
new file mode 100644
index 0000000000..3ed7f11f11
--- /dev/null
+++ b/kernel/api/contract_mcp_oauth_test.go
@@ -0,0 +1,213 @@
+package api
+
+import (
+ "crypto/sha256"
+ "encoding/base64"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "net/url"
+ "regexp"
+ "strings"
+ "testing"
+
+ ginSessions "github.com/gin-contrib/sessions"
+ "github.com/gin-contrib/sessions/cookie"
+ "github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+ "github.com/siyuan-note/siyuan/kernel/conf"
+ "github.com/siyuan-note/siyuan/kernel/model"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func oauthTestRouter(t *testing.T) *gin.Engine {
+ t.Helper()
+ previousConf, previousDir, previousReadonly := model.Conf, util.ConfDir, util.ReadOnly
+ gin.SetMode(gin.TestMode)
+ model.Conf = model.NewAppConf()
+ model.Conf.AccessAuthCode, model.Conf.CookieKey, model.Conf.Lang, model.Conf.Api = "password", "cookie-key", "en", &conf.API{Token: "api-token"}
+ util.ConfDir, util.ReadOnly = t.TempDir(), false
+ t.Cleanup(func() { model.Conf, util.ConfDir, util.ReadOnly = previousConf, previousDir, previousReadonly })
+ r := gin.New()
+ r.Use(ginSessions.Sessions("oauth-test-session", cookie.NewStore([]byte("oauth-test-session-key"))))
+ r.GET("/test-login", func(c *gin.Context) {
+ s := util.GetSession(c)
+ util.GetWorkspaceSession(s).AccessAuthCode = model.Conf.AccessAuthCode
+ if err := s.Save(c); err != nil {
+ t.Error(err)
+ }
+ c.Status(200)
+ })
+ r.GET("/.well-known/oauth-protected-resource/mcp", mcpOAuthResource)
+ r.GET("/.well-known/oauth-protected-resource", mcpOAuthResourceRoot)
+ r.GET("/.well-known/oauth-authorization-server", mcpOAuthMetadata)
+ r.GET("/oauth/mcp/authorize", mcpOAuthServerAuthorize)
+ r.POST("/oauth/mcp/consent", mcpOAuthConsent)
+ r.POST("/oauth/mcp/token", mcpOAuthToken)
+ r.POST("/oauth/mcp/revoke", mcpOAuthRevoke)
+ r.POST("/api/mcp/getOAuth", model.CheckAuth, model.CheckAdminRole, mcpOAuthGet)
+ r.POST("/api/mcp/setOAuth", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, mcpOAuthSet)
+ r.POST("/api/mcp/addOAuthClient", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, mcpOAuthAddClient)
+ r.POST("/api/mcp/removeOAuthClient", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, mcpOAuthRemoveClient)
+ r.POST("/mcp", model.CheckMCPAuth, model.CheckAdminRole, model.CheckReadonly, func(c *gin.Context) { c.Status(204) })
+ r.POST("/reader-mcp", func(c *gin.Context) { c.Set(model.RoleContextKey, model.RoleReader) }, model.CheckMCPAuth, model.CheckAdminRole, func(c *gin.Context) { c.Status(204) })
+ r.POST("/test-api", model.CheckAuth, model.CheckAdminRole, func(c *gin.Context) { c.Status(204) })
+ return r
+}
+
+func oauthHTTPRequest(t *testing.T, r *gin.Engine, method, path, body, contentType, auth string, cookies []*http.Cookie, origin string) *httptest.ResponseRecorder {
+ t.Helper()
+ request := httptest.NewRequest(method, "https://note.example.com"+path, strings.NewReader(body))
+ request.RemoteAddr = "192.0.2.32:1234"
+ if contentType != "" {
+ request.Header.Set("Content-Type", contentType)
+ }
+ if auth != "" {
+ request.Header.Set("Authorization", auth)
+ }
+ if origin != "" {
+ request.Header.Set("Origin", origin)
+ }
+ for _, c := range cookies {
+ request.AddCookie(c)
+ }
+ response := httptest.NewRecorder()
+ r.ServeHTTP(response, request)
+ for _, definition := range apicontract.Definitions() {
+ if definition.Path == request.URL.Path && !(strings.HasPrefix(request.URL.Path, "/api/") && response.Code != 200) {
+ requireAPIContract(t, method, request.URL.Path, response)
+ break
+ }
+ }
+ return response
+}
+
+func TestAPIContractMCPOAuthFlow(t *testing.T) {
+ r := oauthTestRouter(t)
+ call := func(method, path, body, contentType, auth string, cookies []*http.Cookie, origin string) *httptest.ResponseRecorder {
+ return oauthHTTPRequest(t, r, method, path, body, contentType, auth, cookies, origin)
+ }
+ disabled := call("GET", "/.well-known/oauth-protected-resource/mcp", "", "", "", nil, "")
+ if disabled.Code != 404 {
+ t.Fatal(disabled.Code, disabled.Body.String())
+ }
+ configured := call("POST", "/api/mcp/setOAuth", `{"enabled":true,"publicURL":"https://note.example.com"}`, "application/json", "Token api-token", nil, "")
+ if !strings.Contains(configured.Body.String(), `"code":0`) {
+ t.Fatal(configured.Body.String())
+ }
+ registered := call("POST", "/api/mcp/addOAuthClient", `{"name":"ChatGPT <script>alert(1)</script>","redirectURI":"https://chatgpt.com/connector_platform_oauth_redirect"}`, "application/json", "Token api-token", nil, "")
+ var created struct {
+ Data apicontract.MCPOAuthClientSecret `json:"data"`
+ }
+ if err := json.Unmarshal(registered.Body.Bytes(), &created); err != nil || created.Data.Secret == "" {
+ t.Fatal(registered.Body.String(), err)
+ }
+ c := created.Data
+ for _, path := range []string{"/.well-known/oauth-protected-resource/mcp", "/.well-known/oauth-protected-resource", "/.well-known/oauth-authorization-server"} {
+ res := call("GET", path, "", "", "", nil, "")
+ if res.Code != 200 || strings.Contains(res.Body.String(), `"code":`) || !strings.Contains(res.Body.String(), "https://note.example.com") {
+ t.Fatal(res.Body.String())
+ }
+ }
+ challenge := call("POST", "/mcp", "{}", "application/json", "", nil, "")
+ if challenge.Code != 401 || !strings.Contains(challenge.Header().Get("WWW-Authenticate"), "/.well-known/oauth-protected-resource/mcp") {
+ t.Fatal(challenge.Code, challenge.Header())
+ }
+ verifier := strings.Repeat("v", 43)
+ hash := sha256.Sum256([]byte(verifier))
+ v := url.Values{"client_id": {c.ID}, "redirect_uri": {c.RedirectURI}, "response_type": {"code"}, "resource": {"https://note.example.com/mcp"}, "scope": {"mcp offline_access"}, "state": {"original"}, "code_challenge_method": {"S256"}, "code_challenge": {base64.RawURLEncoding.EncodeToString(hash[:])}}
+ path := "/oauth/mcp/authorize?" + v.Encode()
+ loginRedirect := call("GET", path, "", "", "", nil, "")
+ if loginRedirect.Code != 302 || !strings.HasPrefix(loginRedirect.Header().Get("Location"), "/check-auth?to=") {
+ t.Fatal(loginRedirect.Code, loginRedirect.Header())
+ }
+ login := call("GET", "/test-login", "", "", "", nil, "")
+ cookies := login.Result().Cookies()
+ page := call("GET", path, "", "", "", cookies, "")
+ if page.Code != 200 || strings.Contains(page.Body.String(), "<script>") || page.Header().Get("X-Frame-Options") != "DENY" {
+ t.Fatal(page.Code, page.Body.String())
+ }
+ match := regexp.MustCompile(`name="ticket" value="([^"]+)"`).FindStringSubmatch(page.Body.String())
+ if len(match) != 2 {
+ t.Fatal(page.Body.String())
+ }
+ cookies = append(cookies, page.Result().Cookies()...)
+ consent := url.Values{"ticket": {match[1]}, "decision": {"approve"}}
+ for _, origin := range []string{"https://evil.example", ""} {
+ res := call("POST", "/oauth/mcp/consent", consent.Encode(), "application/x-www-form-urlencoded", "", cookies, origin)
+ if res.Code != 400 {
+ t.Fatal("cross-origin consent accepted", res.Code)
+ }
+ }
+ approved := call("POST", "/oauth/mcp/consent", consent.Encode(), "application/x-www-form-urlencoded", "", cookies, "https://note.example.com")
+ if approved.Code != 302 {
+ t.Fatal(approved.Code, approved.Body.String())
+ }
+ callback, _ := url.Parse(approved.Header().Get("Location"))
+ if callback.Query().Get("iss") != "https://note.example.com" || callback.Query().Get("state") != "original" {
+ t.Fatal(callback)
+ }
+ tokenForm := url.Values{"grant_type": {"authorization_code"}, "code": {callback.Query().Get("code")}, "redirect_uri": {c.RedirectURI}, "code_verifier": {verifier}, "resource": {"https://note.example.com/mcp"}}
+ basic := "Basic " + base64.StdEncoding.EncodeToString([]byte(c.ID+":"+c.Secret))
+ res := call("POST", "/oauth/mcp/token", tokenForm.Encode(), "application/x-www-form-urlencoded", basic, nil, "")
+ var token apicontract.MCPOAuthTokenResponse
+ if err := json.Unmarshal(res.Body.Bytes(), &token); err != nil || token.AccessToken == "" || token.RefreshToken == "" || res.Code != 200 {
+ t.Fatal(res.Code, res.Body.String(), err)
+ }
+ if res.Header().Get("Cache-Control") != "no-store" {
+ t.Fatal("token cached")
+ }
+ for _, auth := range []string{"Token api-token", "Bearer api-token", "Bearer " + token.AccessToken} {
+ if result := call("POST", "/mcp", "{}", "application/json", auth, nil, ""); result.Code != 204 {
+ t.Fatal("MCP rejected valid auth", result.Code, result.Body.String())
+ }
+ }
+ if result := call("POST", "/test-api", "{}", "application/json", "Bearer "+token.AccessToken, nil, ""); result.Code != 401 {
+ t.Fatal("OAuth token escaped MCP", result.Code)
+ }
+ if result := call("POST", "/reader-mcp", "{}", "application/json", "Bearer "+token.AccessToken, nil, ""); result.Code != 403 {
+ t.Fatal("reader elevated", result.Code)
+ }
+ util.ReadOnly = true
+ if result := call("POST", "/mcp", "{}", "application/json", "Bearer "+token.AccessToken, nil, ""); result.Code == 204 {
+ t.Fatal("read-only bypassed")
+ }
+ util.ReadOnly = false
+ refresh := url.Values{"grant_type": {"refresh_token"}, "client_id": {c.ID}, "client_secret": {c.Secret}, "refresh_token": {token.RefreshToken}, "resource": {"https://note.example.com/mcp"}}
+ res = call("POST", "/oauth/mcp/token", refresh.Encode(), "application/x-www-form-urlencoded", "", nil, "")
+ if err := json.Unmarshal(res.Body.Bytes(), &token); err != nil || res.Code != 200 {
+ t.Fatal(res.Body.String(), err)
+ }
+ revoke := url.Values{"token": {token.RefreshToken}, "client_id": {c.ID}, "client_secret": {c.Secret}}
+ if result := call("POST", "/oauth/mcp/revoke", revoke.Encode(), "application/x-www-form-urlencoded", "", nil, ""); result.Code != 200 {
+ t.Fatal(result.Body.String())
+ }
+ if result := call("POST", "/mcp", "{}", "application/json", "Bearer "+token.AccessToken, nil, ""); result.Code != 401 {
+ t.Fatal("revoked token accepted", result.Code)
+ }
+ status := call("POST", "/api/mcp/getOAuth", "", "", "Token api-token", nil, "")
+ if strings.Contains(status.Body.String(), c.Secret) || strings.Contains(status.Body.String(), "secretHash") {
+ t.Fatal("secret disclosed")
+ }
+}
+
+func TestAPIContractMCPOAuthMalformedRequests(t *testing.T) {
+ r := oauthTestRouter(t)
+ for _, tc := range []struct{ body, contentType string }{
+ {"client_id=a&client_id=b", "application/x-www-form-urlencoded"},
+ {"x=%broken", "application/x-www-form-urlencoded"},
+ {"x=" + strings.Repeat("a", 17000), "application/x-www-form-urlencoded"},
+ {`{}`, "application/json"},
+ } {
+ res := oauthHTTPRequest(t, r, "POST", "/oauth/mcp/token", tc.body, tc.contentType, "", nil, "")
+ if res.Code != 400 || res.Body.String() != `{"error":"invalid_request"}` {
+ t.Fatal(res.Code, res.Body.String())
+ }
+ }
+ for _, path := range []string{"/api/mcp/getOAuth", "/api/mcp/setOAuth", "/api/mcp/addOAuthClient", "/api/mcp/removeOAuthClient"} {
+ res := oauthHTTPRequest(t, r, "POST", path, "{}", "application/json", "", nil, "")
+ if res.Code != 401 {
+ t.Fatal("unauthenticated management", path, res.Code)
+ }
+ }
+}
diff --git a/kernel/api/mcp_oauth.go b/kernel/api/mcp_oauth.go
new file mode 100644
index 0000000000..1a00ff2fd9
--- /dev/null
+++ b/kernel/api/mcp_oauth.go
@@ -0,0 +1,338 @@
+package api
+
+import (
+ "bytes"
+ "crypto/rand"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "html/template"
+ "mime"
+ "net/http"
+ "net/url"
+ "path/filepath"
+
+ "github.com/gin-gonic/gin"
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+ "github.com/siyuan-note/siyuan/kernel/model"
+ "github.com/siyuan-note/siyuan/kernel/model/mcpoauth"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+func mcpOAuthJSON[T any](status int, value T) apicontract.Response[apicontract.BinaryContent] {
+ data, err := json.Marshal(value)
+ if err != nil {
+ return apicontract.SuccessHTTPContent(500, "application/json", []byte(`{"error":"server_error"}`))
+ }
+ return apicontract.SuccessHTTPContent(status, "application/json", data)
+}
+
+func mcpOAuthError(err error) apicontract.Response[apicontract.BinaryContent] {
+ status, code := 500, "server_error"
+ switch {
+ case errors.Is(err, mcpoauth.ErrClient):
+ status, code = 401, "invalid_client"
+ case errors.Is(err, mcpoauth.ErrGrant):
+ status, code = 400, "invalid_grant"
+ case errors.Is(err, mcpoauth.ErrInvalid):
+ status, code = 400, "invalid_request"
+ case errors.Is(err, mcpoauth.ErrDisabled):
+ status, code = 404, "temporarily_unavailable"
+ case err != nil && err.Error() == "unsupported_grant_type":
+ status, code = 400, "unsupported_grant_type"
+ }
+ return mcpOAuthJSON(status, apicontract.MCPOAuthError{Error: code})
+}
+
+func mcpOAuthHeaders(c *gin.Context) {
+ c.Header("Cache-Control", "no-store")
+ c.Header("Pragma", "no-cache")
+ c.Header("Referrer-Policy", "no-referrer")
+ c.Header("X-Content-Type-Options", "nosniff")
+}
+
+func activeMCPOAuth(c *gin.Context) (*mcpoauth.Service, error) {
+ mcpOAuthHeaders(c)
+ s, err := model.MCPOAuthService()
+ if err != nil {
+ return nil, err
+ }
+ if !s.Status().Enabled || !model.MCPOAuthAvailable() {
+ return nil, mcpoauth.ErrDisabled
+ }
+ return s, nil
+}
+
+var mcpOAuthResource = contractHandler(apicontract.MCPOAuthResource, mcpOAuthResourceContract)
+var mcpOAuthResourceRoot = contractHandler(apicontract.MCPOAuthResourceRoot, mcpOAuthResourceContract)
+
+func mcpOAuthResourceContract(c *gin.Context, _ apicontract.EmptyRequest) apicontract.Response[apicontract.BinaryContent] {
+ s, err := activeMCPOAuth(c)
+ if err != nil {
+ return mcpOAuthError(err)
+ }
+ origin := s.Status().PublicURL
+ return mcpOAuthJSON(200, apicontract.MCPOAuthResourceMetadata{Resource: origin + "/mcp", AuthorizationServers: []string{origin}, ScopesSupported: []string{"mcp", "offline_access"}, BearerMethodsSupported: []string{"header"}})
+}
+
+var mcpOAuthMetadata = contractHandler(apicontract.MCPOAuthMetadata, mcpOAuthMetadataContract)
+
+func mcpOAuthMetadataContract(c *gin.Context, _ apicontract.EmptyRequest) apicontract.Response[apicontract.BinaryContent] {
+ s, err := activeMCPOAuth(c)
+ if err != nil {
+ return mcpOAuthError(err)
+ }
+ origin := s.Status().PublicURL
+ return mcpOAuthJSON(200, apicontract.MCPOAuthServerMetadata{Issuer: origin,
+ AuthorizationEndpoint: origin + "/oauth/mcp/authorize", TokenEndpoint: origin + "/oauth/mcp/token", RevocationEndpoint: origin + "/oauth/mcp/revoke",
+ ResponseTypesSupported: []string{"code"}, GrantTypesSupported: []string{"authorization_code", "refresh_token"},
+ CodeChallengeMethodsSupported: []string{"S256"}, TokenEndpointAuthMethodsSupported: []string{"client_secret_basic", "client_secret_post"},
+ ScopesSupported: []string{"mcp", "offline_access"}, AuthorizationResponseISSParameterSupported: true})
+}
+
+// checkMCPOAuthForm 限制表单大小并拒绝重复参数,防止认证参数被不同解析器赋予不同含义。
+func checkMCPOAuthForm(c *gin.Context) error {
+ mcpOAuthHeaders(c)
+ media, _, err := mime.ParseMediaType(c.GetHeader("Content-Type"))
+ if err != nil || media != "application/x-www-form-urlencoded" {
+ return mcpoauth.ErrInvalid
+ }
+ c.Request.Body = http.MaxBytesReader(c.Writer, c.Request.Body, 16384)
+ if err = c.Request.ParseForm(); err != nil {
+ return mcpoauth.ErrInvalid
+ }
+ if c.Request.URL.RawQuery != "" {
+ return mcpoauth.ErrInvalid
+ }
+ for _, values := range c.Request.PostForm {
+ if len(values) != 1 || len(values[0]) > 4096 {
+ return mcpoauth.ErrInvalid
+ }
+ }
+ return nil
+}
+
+func mcpOAuthFormGuard(c *gin.Context) *apicontract.Response[apicontract.BinaryContent] {
+ if err := checkMCPOAuthForm(c); err != nil {
+ ret := mcpOAuthError(err)
+ return &ret
+ }
+ return nil
+}
+
+func mcpOAuthClientAuthentication(c *gin.Context, req *apicontract.MCPOAuthTokenRequest) (err error) {
+ defer func() {
+ if err != nil {
+ c.Header("WWW-Authenticate", `Basic realm="MCP OAuth"`)
+ }
+ }()
+ if c.GetHeader("Authorization") == "" {
+ return nil
+ }
+ id, secret, ok := c.Request.BasicAuth()
+ if !ok || req.ClientSecret != "" {
+ return mcpoauth.ErrClient
+ }
+ if id, err = url.QueryUnescape(id); err != nil {
+ return mcpoauth.ErrClient
+ }
+ if req.ClientID != "" && req.ClientID != id {
+ return mcpoauth.ErrClient
+ }
+ req.ClientID = id
+ if req.ClientSecret, err = url.QueryUnescape(secret); err != nil {
+ return mcpoauth.ErrClient
+ }
+ return nil
+}
+
+var mcpOAuthToken = contractHandler(apicontract.MCPOAuthToken, mcpOAuthTokenContract, mcpOAuthFormGuard)
+
+func mcpOAuthTokenContract(c *gin.Context, req apicontract.MCPOAuthTokenRequest) apicontract.Response[apicontract.BinaryContent] {
+ s, err := activeMCPOAuth(c)
+ if err != nil {
+ return mcpOAuthError(err)
+ }
+ if err = mcpOAuthClientAuthentication(c, &req); err != nil {
+ return mcpOAuthError(err)
+ }
+ if retry := util.AuthThrottleCheck("mcp-oauth:" + c.ClientIP()); retry > 0 {
+ return mcpOAuthJSON(429, apicontract.MCPOAuthError{Error: "temporarily_unavailable"})
+ }
+ token, err := s.Token(req)
+ if err != nil {
+ if errors.Is(err, mcpoauth.ErrClient) {
+ util.AuthThrottleFail("mcp-oauth:" + c.ClientIP())
+ c.Header("WWW-Authenticate", `Basic realm="MCP OAuth"`)
+ }
+ return mcpOAuthError(err)
+ }
+ util.AuthThrottleReset("mcp-oauth:" + c.ClientIP())
+ return mcpOAuthJSON(200, token)
+}
+
+var mcpOAuthRevoke = contractHandler(apicontract.MCPOAuthRevoke, mcpOAuthRevokeContract, mcpOAuthFormGuard)
+
+func mcpOAuthRevokeContract(c *gin.Context, req apicontract.MCPOAuthTokenRequest) apicontract.Response[apicontract.BinaryContent] {
+ s, err := activeMCPOAuth(c)
+ if err != nil {
+ return mcpOAuthError(err)
+ }
+ if err = mcpOAuthClientAuthentication(c, &req); err != nil {
+ return mcpOAuthError(err)
+ }
+ if retry := util.AuthThrottleCheck("mcp-oauth:" + c.ClientIP()); retry > 0 {
+ return mcpOAuthJSON(429, apicontract.MCPOAuthError{Error: "temporarily_unavailable"})
+ }
+ if err = s.Revoke(req); err != nil {
+ if errors.Is(err, mcpoauth.ErrClient) {
+ util.AuthThrottleFail("mcp-oauth:" + c.ClientIP())
+ c.Header("WWW-Authenticate", `Basic realm="MCP OAuth"`)
+ }
+ return mcpOAuthError(err)
+ }
+ util.AuthThrottleReset("mcp-oauth:" + c.ClientIP())
+ return mcpOAuthJSON(200, struct{}{})
+}
+
+var mcpOAuthGet = contractHandler(apicontract.MCPOAuthGet, mcpOAuthGetContract)
+
+func mcpOAuthGetContract(c *gin.Context, _ apicontract.EmptyRequest) apicontract.Response[apicontract.MCPOAuthStatus] {
+ mcpOAuthHeaders(c)
+ s, err := model.MCPOAuthService()
+ if err != nil {
+ return apicontract.Failure[apicontract.MCPOAuthStatus](-1, mcpOAuthLanguage("mcpOAuthError"))
+ }
+ return apicontract.Success(s.Status())
+}
+
+var mcpOAuthSet = contractHandler(apicontract.MCPOAuthSet, mcpOAuthSetContract)
+
+func mcpOAuthSetContract(c *gin.Context, req apicontract.MCPOAuthConfig) apicontract.Response[apicontract.Null] {
+ s, err := model.MCPOAuthService()
+ if err == nil && req.Enabled && !model.MCPOAuthAvailable() {
+ err = mcpoauth.ErrDisabled
+ }
+ if err == nil {
+ err = s.Configure(req)
+ }
+ if err != nil {
+ return apicontract.Failure[apicontract.Null](-1, mcpOAuthLanguage("mcpOAuthError"))
+ }
+ return apicontract.Success(apicontract.Null{})
+}
+
+var mcpOAuthAddClient = contractHandler(apicontract.MCPOAuthAddClient, mcpOAuthAddClientContract)
+
+func mcpOAuthAddClientContract(c *gin.Context, req apicontract.MCPOAuthClientRequest) apicontract.Response[apicontract.MCPOAuthClientSecret] {
+ mcpOAuthHeaders(c)
+ s, err := model.MCPOAuthService()
+ if err != nil {
+ return apicontract.Failure[apicontract.MCPOAuthClientSecret](-1, mcpOAuthLanguage("mcpOAuthError"))
+ }
+ client, err := s.AddClient(req)
+ if err != nil {
+ return apicontract.Failure[apicontract.MCPOAuthClientSecret](-1, mcpOAuthLanguage("mcpOAuthError"))
+ }
+ return apicontract.Success(client)
+}
+
+var mcpOAuthRemoveClient = contractHandler(apicontract.MCPOAuthRemoveClient, mcpOAuthRemoveClientContract)
+
+func mcpOAuthRemoveClientContract(c *gin.Context, req apicontract.MCPOAuthRemoveRequest) apicontract.Response[apicontract.Null] {
+ s, err := model.MCPOAuthService()
+ if err == nil {
+ err = s.Remove(req.ID, req.All)
+ }
+ if err != nil {
+ return apicontract.Failure[apicontract.Null](-1, mcpOAuthLanguage("mcpOAuthError"))
+ }
+ return apicontract.Success(apicontract.Null{})
+}
+
+func mcpOAuthLanguage(key string) string { return util.I18nTerm(model.Conf.Lang, key) }
+
+var mcpOAuthPage = template.Must(template.New("mcp-oauth").Parse(`<!doctype html>
+<html lang="{{.Lang}}" dir="auto" data-theme-mode="{{.Mode}}"><head>
+<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
+<title>{{.Title}}</title>{{if .CSS}}<link rel="stylesheet" href="{{.CSS}}">{{end}}
+<link rel="stylesheet" href="{{.Theme}}"></head>
+<body style="overflow:auto"><main class="b3-label" style="max-width:640px;margin:8vh auto;overflow-wrap:anywhere">
+<h1>{{.Title}}</h1>{{if .Error}}<p>{{.Error}}</p>{{else}}
+<p>{{.Workspace}}</p><h2>{{.Name}}</h2><p>{{.Redirect}}</p><p>{{.Tip}}</p>
+<form method="post" action="/oauth/mcp/consent"><input type="hidden" name="ticket" value="{{.Ticket}}">
+<button class="b3-button" name="decision" value="approve">{{.Approve}}</button>
+<button class="b3-button b3-button--outline" name="decision" value="deny">{{.Cancel}}</button>
+</form>{{end}}</main></body></html>`))
+
+func mcpOAuthHTML(c *gin.Context, status int, ticket string, client apicontract.MCPOAuthClient) apicontract.Response[apicontract.BinaryContent] {
+ mcpOAuthHeaders(c)
+ c.Header("Content-Security-Policy", "default-src 'none'; style-src 'self' 'unsafe-inline'; frame-ancestors 'none'; base-uri 'none'")
+ c.Header("X-Frame-Options", "DENY")
+ data := map[string]string{"Title": mcpOAuthLanguage("mcpOAuthServer"), "Workspace": util.WorkspaceName, "Name": client.Name, "Redirect": client.RedirectURI,
+ "Ticket": ticket, "Tip": mcpOAuthLanguage("mcpOAuthConsentTip"), "Approve": mcpOAuthLanguage("confirm"), "Cancel": mcpOAuthLanguage("cancel"), "Theme": "/appearance/themes/daylight/theme.css", "Lang": model.Conf.Lang, "Mode": "light"}
+ if model.Conf.Appearance != nil && model.Conf.Appearance.Mode == 1 {
+ data["Theme"] = "/appearance/themes/midnight/theme.css"
+ data["Mode"] = "dark"
+ }
+ if paths, _ := filepath.Glob(filepath.Join(util.WorkingDir, "stage", "build", "desktop", "base*.css")); len(paths) > 0 {
+ data["CSS"] = "/stage/build/desktop/" + filepath.Base(paths[0])
+ }
+ if status != 200 {
+ data["Error"] = mcpOAuthLanguage("mcpOAuthError")
+ }
+ var b bytes.Buffer
+ if err := mcpOAuthPage.Execute(&b, data); err != nil {
+ return apicontract.SuccessHTTPContent(400, "text/html", []byte(""))
+ }
+ return apicontract.SuccessHTTPContent(status, "text/html; charset=utf-8", b.Bytes())
+}
+
+var mcpOAuthServerAuthorize = contractHandler(apicontract.MCPOAuthAuthorize, mcpOAuthServerAuthorizeContract)
+
+func mcpOAuthServerAuthorizeContract(c *gin.Context, _ apicontract.EmptyRequest) apicontract.Response[apicontract.BinaryContent] {
+ s, err := activeMCPOAuth(c)
+ query, parseErr := url.ParseQuery(c.Request.URL.RawQuery)
+ if err != nil || parseErr != nil || len(c.Request.URL.RawQuery) > 8192 || s.ValidateAuthorization(query) != nil {
+ return mcpOAuthHTML(c, 400, "", apicontract.MCPOAuthClient{})
+ }
+ // 授权页允许跨站顶层导航;确认提交仍要求登录会话、同源表单及浏览器绑定。
+ if !model.IsWorkspaceSessionAuthenticated(util.GetWorkspaceSession(util.GetSession(c))) {
+ return apicontract.RedirectHTTPContent(302, "/check-auth?to="+url.QueryEscape(c.Request.URL.RequestURI()))
+ }
+ var b [32]byte
+ _, _ = rand.Read(b[:])
+ binding := base64.RawURLEncoding.EncodeToString(b[:])
+ ticket, client, err := s.Begin(query, binding)
+ if err != nil {
+ return mcpOAuthHTML(c, 400, "", client)
+ }
+ http.SetCookie(c.Writer, &http.Cookie{Name: "__Host-siyuan-mcp", Value: binding, Path: "/", Secure: true, HttpOnly: true, SameSite: http.SameSiteStrictMode, MaxAge: 600})
+ return mcpOAuthHTML(c, 200, ticket, client)
+}
+
+func mcpOAuthConsentGuard(c *gin.Context) *apicontract.Response[apicontract.BinaryContent] {
+ if err := checkMCPOAuthForm(c); err != nil {
+ ret := mcpOAuthHTML(c, 400, "", apicontract.MCPOAuthClient{})
+ return &ret
+ }
+ return nil
+}
+
+var mcpOAuthConsent = contractHandler(apicontract.MCPOAuthConsent, mcpOAuthConsentContract, mcpOAuthConsentGuard)
+
+func mcpOAuthConsentContract(c *gin.Context, req apicontract.MCPOAuthConsentRequest) apicontract.Response[apicontract.BinaryContent] {
+ s, err := activeMCPOAuth(c)
+ if err != nil || !model.IsWorkspaceSessionAuthenticated(util.GetWorkspaceSession(util.GetSession(c))) ||
+ !util.IsSessionOriginAllowedRequest(c.Request) || c.GetHeader("Origin") != s.Status().PublicURL ||
+ (req.Decision != "approve" && req.Decision != "deny") || util.ReadOnly {
+ return mcpOAuthHTML(c, 400, "", apicontract.MCPOAuthClient{})
+ }
+ binding, _ := c.Cookie("__Host-siyuan-mcp")
+ location, err := s.Consent(req.Ticket, binding, req.Decision == "approve")
+ if err != nil {
+ return mcpOAuthHTML(c, 400, "", apicontract.MCPOAuthClient{})
+ }
+ c.Header("Content-Type", "text/html; charset=utf-8")
+ return apicontract.RedirectHTTPContent(302, location)
+}
diff --git a/kernel/api/router.go b/kernel/api/router.go
index 4c99fc043e..95ea62f379 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -28,6 +28,18 @@ import (
func ServeAPI(ginServer *gin.Engine) {
ginServer.Use(boxLeaseMiddleware)
+ ginServer.GET("/.well-known/oauth-protected-resource/mcp", mcpOAuthResource)
+ ginServer.GET("/.well-known/oauth-protected-resource", mcpOAuthResourceRoot)
+ ginServer.GET("/.well-known/oauth-authorization-server", mcpOAuthMetadata)
+ ginServer.GET("/oauth/mcp/authorize", mcpOAuthServerAuthorize)
+ ginServer.POST("/oauth/mcp/consent", mcpOAuthConsent)
+ ginServer.POST("/oauth/mcp/token", mcpOAuthToken)
+ ginServer.POST("/oauth/mcp/revoke", mcpOAuthRevoke)
+ ginServer.POST("/api/mcp/getOAuth", model.CheckAuth, model.CheckAdminRole, mcpOAuthGet)
+ ginServer.POST("/api/mcp/setOAuth", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, mcpOAuthSet)
+ ginServer.POST("/api/mcp/addOAuthClient", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, mcpOAuthAddClient)
+ ginServer.POST("/api/mcp/removeOAuthClient", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, mcpOAuthRemoveClient)
+
// 不需要鉴权
ginServer.Handle("GET", "/api/system/bootProgress", bootProgress)
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index 42086b36ed..1de92e76c4 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -75,6 +75,19 @@ type ResponseOptions struct {
var definitions []Definition
+// MCP OAuth 协议入口返回标准 OAuth JSON 或授权页面,不使用内核结果信封。
+var MCPOAuthResource = define[EmptyRequest, BinaryContent]("mcpOAuthResource", "/.well-known/oauth-protected-resource/mcp", NoBody, mcpOAuthContentOptions(), "GET")
+var MCPOAuthResourceRoot = define[EmptyRequest, BinaryContent]("mcpOAuthResourceRoot", "/.well-known/oauth-protected-resource", NoBody, mcpOAuthContentOptions(), "GET")
+var MCPOAuthMetadata = define[EmptyRequest, BinaryContent]("mcpOAuthMetadata", "/.well-known/oauth-authorization-server", NoBody, mcpOAuthContentOptions(), "GET")
+var MCPOAuthToken = define[MCPOAuthTokenRequest, BinaryContent]("mcpOAuthToken", "/oauth/mcp/token", FormBody, mcpOAuthContentOptions(), "POST")
+var MCPOAuthRevoke = define[MCPOAuthTokenRequest, BinaryContent]("mcpOAuthRevoke", "/oauth/mcp/revoke", FormBody, mcpOAuthContentOptions(), "POST")
+var MCPOAuthAuthorize = define[EmptyRequest, BinaryContent]("mcpOAuthServerAuthorize", "/oauth/mcp/authorize", NoBody, HTTPContentOptions(HTTPContentVariant{Status: 200, ContentType: "text/html"}, HTTPContentVariant{Status: 302, ContentType: "text/html"}, HTTPContentVariant{Status: 400, ContentType: "text/html"}), "GET")
+var MCPOAuthConsent = define[MCPOAuthConsentRequest, BinaryContent]("mcpOAuthConsent", "/oauth/mcp/consent", FormBody, HTTPContentOptions(HTTPContentVariant{Status: 302, ContentType: "text/html"}, HTTPContentVariant{Status: 400, ContentType: "text/html"}), "POST")
+var MCPOAuthGet = define[EmptyRequest, MCPOAuthStatus]("mcpOAuthGet", "/api/mcp/getOAuth", NoBody, ResponseOptions{}, "POST")
+var MCPOAuthSet = define[MCPOAuthConfig, Null]("mcpOAuthSet", "/api/mcp/setOAuth", JSONBody, ResponseOptions{}, "POST")
+var MCPOAuthAddClient = define[MCPOAuthClientRequest, MCPOAuthClientSecret]("mcpOAuthAddClient", "/api/mcp/addOAuthClient", JSONBody, ResponseOptions{}, "POST")
+var MCPOAuthRemoveClient = define[MCPOAuthRemoveRequest, Null]("mcpOAuthRemoveClient", "/api/mcp/removeOAuthClient", JSONBody, ResponseOptions{}, "POST")
+
var (
GetChildBlocks = define[BlockQueryRequest, []*ChildBlock]("getChildBlocks", "/api/block/getChildBlocks", JSONBody, ResponseOptions{NonNullable: true}, "POST")
GetTailChildBlocks = define[TailChildBlocksRequest, []*ChildBlock]("getTailChildBlocks", "/api/block/getTailChildBlocks", JSONBody, ResponseOptions{NonNullable: true}, "POST")
diff --git a/kernel/apicontract/mcp_oauth.go b/kernel/apicontract/mcp_oauth.go
new file mode 100644
index 0000000000..564cf7b767
--- /dev/null
+++ b/kernel/apicontract/mcp_oauth.go
@@ -0,0 +1,111 @@
+package apicontract
+
+// MCPOAuthConfig 控制内置 MCP 服务端授权,默认关闭。公开地址必须为不含路径的 HTTPS 源。
+// 关闭或修改地址会撤销全部授权;原有 API Token 认证不受影响。
+type MCPOAuthConfig struct {
+ Enabled bool `json:"enabled"`
+ PublicURL string `json:"publicURL"`
+}
+
+// MCPOAuthClientRequest 由管理员预注册客户端,回调地址精确匹配,不支持通配符。
+type MCPOAuthClientRequest struct {
+ Name string `json:"name"`
+ RedirectURI string `json:"redirectURI"`
+}
+
+type MCPOAuthClient struct {
+ ID string `json:"id"`
+ Name string `json:"name"`
+ RedirectURI string `json:"redirectURI"`
+}
+
+// MCPOAuthClientSecret 仅在创建时返回密钥;磁盘只保存摘要,丢失后需重新注册。
+type MCPOAuthClientSecret struct {
+ MCPOAuthClient
+ Secret string `json:"secret"`
+}
+
+type MCPOAuthStatus struct {
+ MCPOAuthConfig
+ Clients []MCPOAuthClient `json:"clients"`
+}
+
+// MCPOAuthRemoveRequest 删除客户端及其全部授权。all 为 true 时撤销所有客户端的授权,保留注册。
+type MCPOAuthRemoveRequest struct {
+ ID string `json:"id" api:"optional"`
+ All bool `json:"all" api:"optional"`
+}
+
+// MCPOAuthTokenRequest 使用表单编码。仅支持授权码和刷新令牌,始终校验目标 resource。
+// 客户端使用 client_secret_basic 或 client_secret_post,授权码必须绑定 PKCE S256。
+type MCPOAuthTokenRequest struct {
+ GrantType string `json:"grant_type" api:"optional"`
+ ClientID string `json:"client_id" api:"optional"`
+ ClientSecret string `json:"client_secret" api:"optional"`
+ Code string `json:"code" api:"optional"`
+ RedirectURI string `json:"redirect_uri" api:"optional"`
+ CodeVerifier string `json:"code_verifier" api:"optional"`
+ RefreshToken string `json:"refresh_token" api:"optional"`
+ Resource string `json:"resource" api:"optional"`
+ Scope string `json:"scope" api:"optional"`
+ Token string `json:"token" api:"optional"`
+ TokenTypeHint string `json:"token_type_hint" api:"optional"`
+}
+
+// MCPOAuthTokenResponse 的访问令牌只用于 /mcp,有效期为一小时。
+// offline_access 授权提供三十天有效期的刷新令牌;刷新轮换,重放会撤销同一授权。
+type MCPOAuthTokenResponse struct {
+ AccessToken string `json:"access_token"`
+ TokenType string `json:"token_type"`
+ ExpiresIn int `json:"expires_in"`
+ RefreshToken string `json:"refresh_token,omitempty"`
+ Scope string `json:"scope"`
+}
+
+type MCPOAuthError struct {
+ Error string `json:"error"`
+}
+
+type MCPOAuthResourceMetadata struct {
+ Resource string `json:"resource"`
+ AuthorizationServers []string `json:"authorization_servers"`
+ ScopesSupported []string `json:"scopes_supported"`
+ BearerMethodsSupported []string `json:"bearer_methods_supported"`
+}
+
+// MCPOAuthServerMetadata 声明预注册客户端及 PKCE,不声明动态注册或 OIDC 身份接口。
+type MCPOAuthServerMetadata struct {
+ Issuer string `json:"issuer"`
+ AuthorizationEndpoint string `json:"authorization_endpoint"`
+ TokenEndpoint string `json:"token_endpoint"`
+ RevocationEndpoint string `json:"revocation_endpoint"`
+ ResponseTypesSupported []string `json:"response_types_supported"`
+ GrantTypesSupported []string `json:"grant_types_supported"`
+ CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported"`
+ TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported"`
+ ScopesSupported []string `json:"scopes_supported"`
+ AuthorizationResponseISSParameterSupported bool `json:"authorization_response_iss_parameter_supported"`
+}
+
+type MCPOAuthConsentRequest struct {
+ Ticket string `json:"ticket" api:"optional"`
+ Decision string `json:"decision" api:"optional"`
+}
+
+func mcpOAuthContentOptions() ResponseOptions {
+ return HTTPContentOptions(
+ HTTPContentVariant{Status: 200, ContentType: "application/json"},
+ HTTPContentVariant{Status: 400, ContentType: "application/json"},
+ HTTPContentVariant{Status: 401, ContentType: "application/json"},
+ HTTPContentVariant{Status: 404, ContentType: "application/json"},
+ HTTPContentVariant{Status: 429, ContentType: "application/json"},
+ HTTPContentVariant{Status: 500, ContentType: "application/json"},
+ )
+}
+
+func init() {
+ MCPOAuthToken.decodeFailure = func(error) Response[BinaryContent] {
+ return SuccessHTTPContent(400, "application/json", []byte(`{"error":"invalid_request"}`))
+ }
+ MCPOAuthRevoke.decodeFailure = MCPOAuthToken.decodeFailure
+}
diff --git a/kernel/apicontract/schema.json b/kernel/apicontract/schema.json
index 54ab5d92d7..5cbfd3b9c2 100644
--- a/kernel/apicontract/schema.json
+++ b/kernel/apicontract/schema.json
@@ -29264,6 +29264,175 @@
],
"additionalProperties": false
},
+ "MCPOAuthClient": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "redirectURI": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "redirectURI"
+ ],
+ "additionalProperties": false
+ },
+ "MCPOAuthClientRequestInput": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "redirectURI": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "name",
+ "redirectURI"
+ ],
+ "additionalProperties": false
+ },
+ "MCPOAuthClientSecret": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "redirectURI": {
+ "type": "string"
+ },
+ "secret": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "id",
+ "name",
+ "redirectURI",
+ "secret"
+ ],
+ "additionalProperties": false
+ },
+ "MCPOAuthConfigInput": {
+ "type": "object",
+ "properties": {
+ "enabled": {
+ "type": "boolean"
+ },
+ "publicURL": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "enabled",
+ "publicURL"
+ ],
+ "additionalProperties": false
+ },
+ "MCPOAuthConsentRequestInput": {
+ "type": "object",
+ "properties": {
+ "decision": {
+ "type": "string"
+ },
+ "ticket": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "MCPOAuthRemoveRequestInput": {
+ "type": "object",
+ "properties": {
+ "all": {
+ "type": "boolean"
+ },
+ "id": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
+ "MCPOAuthStatus": {
+ "type": "object",
+ "properties": {
+ "clients": {
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/MCPOAuthClient"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "enabled": {
+ "type": "boolean"
+ },
+ "publicURL": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "clients",
+ "enabled",
+ "publicURL"
+ ],
+ "additionalProperties": false
+ },
+ "MCPOAuthTokenRequestInput": {
+ "type": "object",
+ "properties": {
+ "client_id": {
+ "type": "string"
+ },
+ "client_secret": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ },
+ "code_verifier": {
+ "type": "string"
+ },
+ "grant_type": {
+ "type": "string"
+ },
+ "redirect_uri": {
+ "type": "string"
+ },
+ "refresh_token": {
+ "type": "string"
+ },
+ "resource": {
+ "type": "string"
+ },
+ "scope": {
+ "type": "string"
+ },
+ "token": {
+ "type": "string"
+ },
+ "token_type_hint": {
+ "type": "string"
+ }
+ },
+ "additionalProperties": false
+ },
"MarkdownHTMLRequestInput": {
"type": "object",
"properties": {
@@ -107078,6 +107247,258 @@
}
}
},
+ {
+ "method": "GET",
+ "path": "/.well-known/oauth-authorization-server",
+ "handler": "mcpOAuthMetadata",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 200,
+ "contentType": "application/json"
+ },
+ {
+ "status": 400,
+ "contentType": "application/json"
+ },
+ {
+ "status": 401,
+ "contentType": "application/json"
+ },
+ {
+ "status": 404,
+ "contentType": "application/json"
+ },
+ {
+ "status": 429,
+ "contentType": "application/json"
+ },
+ {
+ "status": 500,
+ "contentType": "application/json"
+ }
+ ]
+ },
+ {
+ "method": "GET",
+ "path": "/.well-known/oauth-protected-resource",
+ "handler": "mcpOAuthResourceRoot",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 200,
+ "contentType": "application/json"
+ },
+ {
+ "status": 400,
+ "contentType": "application/json"
+ },
+ {
+ "status": 401,
+ "contentType": "application/json"
+ },
+ {
+ "status": 404,
+ "contentType": "application/json"
+ },
+ {
+ "status": 429,
+ "contentType": "application/json"
+ },
+ {
+ "status": 500,
+ "contentType": "application/json"
+ }
+ ]
+ },
+ {
+ "method": "GET",
+ "path": "/.well-known/oauth-protected-resource/mcp",
+ "handler": "mcpOAuthResource",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 200,
+ "contentType": "application/json"
+ },
+ {
+ "status": 400,
+ "contentType": "application/json"
+ },
+ {
+ "status": 401,
+ "contentType": "application/json"
+ },
+ {
+ "status": 404,
+ "contentType": "application/json"
+ },
+ {
+ "status": 429,
+ "contentType": "application/json"
+ },
+ {
+ "status": 500,
+ "contentType": "application/json"
+ }
+ ]
+ },
{
"method": "GET",
"path": "/api/ai/mcp/oauth/callback/:flowID",
@@ -108251,6 +108672,78 @@
"upstreamStatuses": true
}
},
+ {
+ "method": "GET",
+ "path": "/oauth/mcp/authorize",
+ "handler": "mcpOAuthServerAuthorize",
+ "body": "none",
+ "request": {
+ "$ref": "#/$defs/EmptyRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 200,
+ "contentType": "text/html"
+ },
+ {
+ "status": 302,
+ "contentType": "text/html"
+ },
+ {
+ "status": 400,
+ "contentType": "text/html"
+ }
+ ]
+ },
{
"method": "GET",
"path": "/plugin/private/:name/*path",
@@ -116311,11 +116804,89 @@
},
{
"method": "POST",
- "path": "/api/av/changeAttrViewLayout",
- "handler": "changeAttrViewLayout",
+ "path": "/api/av/changeAttrViewLayout",
+ "handler": "changeAttrViewLayout",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/ChangeAttrViewLayoutRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/AVRenderResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/$defs/AVRenderResult"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/createAttributeViewItem",
+ "handler": "createAttributeViewItem",
"body": "json",
"request": {
- "$ref": "#/$defs/ChangeAttrViewLayoutRequestInput"
+ "$ref": "#/$defs/CreateAttributeViewItemRequestInput"
},
"response": {
"anyOf": [
@@ -116329,7 +116900,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVRenderResult"
+ "$ref": "#/$defs/AVCreateItemResult"
},
"msg": {
"type": "string"
@@ -116348,7 +116919,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -116369,7 +116941,7 @@
"type": "null"
},
{
- "$ref": "#/$defs/AVRenderResult"
+ "$ref": "#/$defs/AVCreateItemResult"
}
]
},
@@ -116389,11 +116961,11 @@
},
{
"method": "POST",
- "path": "/api/av/createAttributeViewItem",
- "handler": "createAttributeViewItem",
+ "path": "/api/av/createAttributeViewItemDocs",
+ "handler": "createAttributeViewItemDocs",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateAttributeViewItemRequestInput"
+ "$ref": "#/$defs/CreateAttributeViewItemDocsRequestInput"
},
"response": {
"anyOf": [
@@ -116407,7 +116979,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVCreateItemResult"
+ "$ref": "#/$defs/AVCreateItemDocsResult"
},
"msg": {
"type": "string"
@@ -116448,7 +117020,7 @@
"type": "null"
},
{
- "$ref": "#/$defs/AVCreateItemResult"
+ "$ref": "#/$defs/AVCreateItemDocsResult"
}
]
},
@@ -116468,11 +117040,11 @@
},
{
"method": "POST",
- "path": "/api/av/createAttributeViewItemDocs",
- "handler": "createAttributeViewItemDocs",
+ "path": "/api/av/createAttributeViewItemWithMarkdown",
+ "handler": "createAttributeViewItemWithMarkdown",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateAttributeViewItemDocsRequestInput"
+ "$ref": "#/$defs/CreateAttributeViewItemWithMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -116486,7 +117058,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVCreateItemDocsResult"
+ "$ref": "#/$defs/AVCreateItemResult"
},
"msg": {
"type": "string"
@@ -116527,7 +117099,7 @@
"type": "null"
},
{
- "$ref": "#/$defs/AVCreateItemDocsResult"
+ "$ref": "#/$defs/AVCreateItemResult"
}
]
},
@@ -116547,11 +117119,11 @@
},
{
"method": "POST",
- "path": "/api/av/createAttributeViewItemWithMarkdown",
- "handler": "createAttributeViewItemWithMarkdown",
+ "path": "/api/av/duplicateAttributeViewBlock",
+ "handler": "duplicateAttributeViewBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateAttributeViewItemWithMarkdownRequestInput"
+ "$ref": "#/$defs/DuplicateAttributeViewBlockRequestInput"
},
"response": {
"anyOf": [
@@ -116565,7 +117137,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVCreateItemResult"
+ "$ref": "#/$defs/AVDuplicateData"
},
"msg": {
"type": "string"
@@ -116584,8 +117156,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -116604,9 +117175,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/AVCreateItemResult"
}
]
},
@@ -116626,11 +117194,11 @@
},
{
"method": "POST",
- "path": "/api/av/duplicateAttributeViewBlock",
- "handler": "duplicateAttributeViewBlock",
+ "path": "/api/av/getAttributeView",
+ "handler": "getAttributeView",
"body": "json",
"request": {
- "$ref": "#/$defs/DuplicateAttributeViewBlockRequestInput"
+ "$ref": "#/$defs/GetAttributeViewRequestInput"
},
"response": {
"anyOf": [
@@ -116644,7 +117212,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVDuplicateData"
+ "$ref": "#/$defs/AVData"
},
"msg": {
"type": "string"
@@ -116701,11 +117269,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeView",
- "handler": "getAttributeView",
+ "path": "/api/av/getAttributeViewAddingBlockDefaultValues",
+ "handler": "getAttributeViewAddingBlockDefaultValues",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewRequestInput"
+ "$ref": "#/$defs/GetAttributeViewAddingBlockDefaultValuesRequestInput"
},
"response": {
"anyOf": [
@@ -116719,7 +117287,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVData"
+ "$ref": "#/$defs/AVValuesData"
},
"msg": {
"type": "string"
@@ -116776,11 +117344,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewAddingBlockDefaultValues",
- "handler": "getAttributeViewAddingBlockDefaultValues",
+ "path": "/api/av/getAttributeViewBacklinks",
+ "handler": "getAttributeViewBacklinks",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewAddingBlockDefaultValuesRequestInput"
+ "$ref": "#/$defs/GetAttributeViewBacklinksRequestInput"
},
"response": {
"anyOf": [
@@ -116794,7 +117362,14 @@
]
},
"data": {
- "$ref": "#/$defs/AVValuesData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AVAttributeViewBacklinks"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -116851,11 +117426,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewBacklinks",
- "handler": "getAttributeViewBacklinks",
+ "path": "/api/av/getAttributeViewBoundBlockIDsByItemIDs",
+ "handler": "getAttributeViewBoundBlockIDsByItemIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewBacklinksRequestInput"
+ "$ref": "#/$defs/GetAttributeViewBoundBlockIDsByItemIDsRequestInput"
},
"response": {
"anyOf": [
@@ -116871,7 +117446,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/AVAttributeViewBacklinks"
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -116933,11 +117511,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewBoundBlockIDsByItemIDs",
- "handler": "getAttributeViewBoundBlockIDsByItemIDs",
+ "path": "/api/av/getAttributeViewCalendarUndated",
+ "handler": "getAttributeViewCalendarUndated",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewBoundBlockIDsByItemIDsRequestInput"
+ "$ref": "#/$defs/AVCalendarUndatedRequestInput"
},
"response": {
"anyOf": [
@@ -116950,13 +117528,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/AVCalendarUndatedData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
"type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -116972,6 +117579,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/getAttributeViewFieldViews",
+ "handler": "getAttributeViewFieldViews",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetAttributeViewFieldViewsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/AVFieldViewsData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -117018,11 +117661,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewCalendarUndated",
- "handler": "getAttributeViewCalendarUndated",
+ "path": "/api/av/getAttributeViewFilterSort",
+ "handler": "getAttributeViewFilterSort",
"body": "json",
"request": {
- "$ref": "#/$defs/AVCalendarUndatedRequestInput"
+ "$ref": "#/$defs/GetAttributeViewFilterSortRequestInput"
},
"response": {
"anyOf": [
@@ -117036,7 +117679,92 @@
]
},
"data": {
- "$ref": "#/$defs/AVCalendarUndatedData"
+ "$ref": "#/$defs/AVFilterSortData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/getAttributeViewItemIDsByBoundIDs",
+ "handler": "getAttributeViewItemIDsByBoundIDs",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/GetAttributeViewItemIDsByBoundIDsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -117093,11 +117821,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewFieldViews",
- "handler": "getAttributeViewFieldViews",
+ "path": "/api/av/getAttributeViewItemStatuses",
+ "handler": "getAttributeViewItemStatuses",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewFieldViewsRequestInput"
+ "$ref": "#/$defs/GetAttributeViewItemStatusesRequestInput"
},
"response": {
"anyOf": [
@@ -117111,7 +117839,17 @@
]
},
"data": {
- "$ref": "#/$defs/AVFieldViewsData"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -117168,11 +117906,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewFilterSort",
- "handler": "getAttributeViewFilterSort",
+ "path": "/api/av/getAttributeViewKeys",
+ "handler": "getAttributeViewKeys",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewFilterSortRequestInput"
+ "$ref": "#/$defs/GetAttributeViewKeysRequestInput"
},
"response": {
"anyOf": [
@@ -117186,7 +117924,24 @@
]
},
"data": {
- "$ref": "#/$defs/AVFilterSortData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AVBlockAttributeViewKeys"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -117243,11 +117998,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewItemIDsByBoundIDs",
- "handler": "getAttributeViewItemIDsByBoundIDs",
+ "path": "/api/av/getAttributeViewKeysByAvID",
+ "handler": "getAttributeViewKeysByAvID",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewItemIDsByBoundIDsRequestInput"
+ "$ref": "#/$defs/GetAttributeViewKeysByAvIDRequestInput"
},
"response": {
"anyOf": [
@@ -117263,9 +118018,16 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AVKey"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -117328,11 +118090,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewItemStatuses",
- "handler": "getAttributeViewItemStatuses",
+ "path": "/api/av/getAttributeViewKeysByID",
+ "handler": "getAttributeViewKeysByID",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewItemStatusesRequestInput"
+ "$ref": "#/$defs/GetAttributeViewKeysByIDRequestInput"
},
"response": {
"anyOf": [
@@ -117348,9 +118110,16 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AVKey"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
},
{
@@ -117413,11 +118182,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewKeys",
- "handler": "getAttributeViewKeys",
+ "path": "/api/av/getAttributeViewPasteRows",
+ "handler": "getAttributeViewPasteRows",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewKeysRequestInput"
+ "$ref": "#/$defs/GetAttributeViewPasteRowsRequestInput"
},
"response": {
"anyOf": [
@@ -117431,24 +118200,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AVBlockAttributeViewKeys"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/AVPasteRowsData"
},
"msg": {
"type": "string"
@@ -117505,11 +118257,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewKeysByAvID",
- "handler": "getAttributeViewKeysByAvID",
+ "path": "/api/av/getAttributeViewPrimaryKeyValues",
+ "handler": "getAttributeViewPrimaryKeyValues",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewKeysByAvIDRequestInput"
+ "$ref": "#/$defs/GetAttributeViewPrimaryKeyValuesRequestInput"
},
"response": {
"anyOf": [
@@ -117523,24 +118275,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AVKey"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/AVPrimaryValuesData"
},
"msg": {
"type": "string"
@@ -117597,11 +118332,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewKeysByID",
- "handler": "getAttributeViewKeysByID",
+ "path": "/api/av/getAttributeViewRelationCandidates",
+ "handler": "getAttributeViewRelationCandidates",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewKeysByIDRequestInput"
+ "$ref": "#/$defs/GetAttributeViewRelationCandidatesRequestInput"
},
"response": {
"anyOf": [
@@ -117614,20 +118349,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/AVRelationCandidatesData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AVKey"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -117643,6 +118400,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/getAttributeViewRowSort",
+ "handler": "getAttributeViewRowSort",
+ "body": "structJSON",
+ "request": {
+ "$ref": "#/$defs/GetAttributeViewRowSortRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/AVRowSortPreview"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -117689,11 +118482,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewPasteRows",
- "handler": "getAttributeViewPasteRows",
+ "path": "/api/av/getAttributeViewSearchTarget",
+ "handler": "getAttributeViewSearchTarget",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewPasteRowsRequestInput"
+ "$ref": "#/$defs/GetAttributeViewSearchTargetRequestInput"
},
"response": {
"anyOf": [
@@ -117707,7 +118500,14 @@
]
},
"data": {
- "$ref": "#/$defs/AVPasteRowsData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AVAttributeViewSearchTarget"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -117764,11 +118564,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewPrimaryKeyValues",
- "handler": "getAttributeViewPrimaryKeyValues",
+ "path": "/api/av/getCurrentAttrViewImages",
+ "handler": "getCurrentAttrViewImages",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewPrimaryKeyValuesRequestInput"
+ "$ref": "#/$defs/GetCurrentAttrViewImagesRequestInput"
},
"response": {
"anyOf": [
@@ -117782,7 +118582,17 @@
]
},
"data": {
- "$ref": "#/$defs/AVPrimaryValuesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -117839,11 +118649,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewRelationCandidates",
- "handler": "getAttributeViewRelationCandidates",
+ "path": "/api/av/getMirrorDatabaseBlocks",
+ "handler": "getMirrorDatabaseBlocks",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewRelationCandidatesRequestInput"
+ "$ref": "#/$defs/GetMirrorDatabaseBlocksRequestInput"
},
"response": {
"anyOf": [
@@ -117857,7 +118667,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVRelationCandidatesData"
+ "$ref": "#/$defs/RefDefsData"
},
"msg": {
"type": "string"
@@ -117914,11 +118724,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewRowSort",
- "handler": "getAttributeViewRowSort",
- "body": "structJSON",
+ "path": "/api/av/getUnusedAttributeViews",
+ "handler": "getUnusedAttributeViews",
+ "body": "none",
"request": {
- "$ref": "#/$defs/GetAttributeViewRowSortRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -117932,7 +118742,24 @@
]
},
"data": {
- "$ref": "#/$defs/AVRowSortPreview"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/AssetUnusedItem"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -117989,11 +118816,11 @@
},
{
"method": "POST",
- "path": "/api/av/getAttributeViewSearchTarget",
- "handler": "getAttributeViewSearchTarget",
+ "path": "/api/av/removeAttributeViewBlocks",
+ "handler": "removeAttributeViewBlocks",
"body": "json",
"request": {
- "$ref": "#/$defs/GetAttributeViewSearchTargetRequestInput"
+ "$ref": "#/$defs/RemoveAttributeViewBlocksRequestInput"
},
"response": {
"anyOf": [
@@ -118007,14 +118834,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/AVAttributeViewSearchTarget"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -118071,11 +118891,11 @@
},
{
"method": "POST",
- "path": "/api/av/getCurrentAttrViewImages",
- "handler": "getCurrentAttrViewImages",
+ "path": "/api/av/removeAttributeViewKey",
+ "handler": "removeAttributeViewKey",
"body": "json",
"request": {
- "$ref": "#/$defs/GetCurrentAttrViewImagesRequestInput"
+ "$ref": "#/$defs/RemoveAttributeViewKeyRequestInput"
},
"response": {
"anyOf": [
@@ -118089,17 +118909,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -118156,11 +118966,11 @@
},
{
"method": "POST",
- "path": "/api/av/getMirrorDatabaseBlocks",
- "handler": "getMirrorDatabaseBlocks",
+ "path": "/api/av/removeUnusedAttributeView",
+ "handler": "removeUnusedAttributeView",
"body": "json",
"request": {
- "$ref": "#/$defs/GetMirrorDatabaseBlocksRequestInput"
+ "$ref": "#/$defs/RemoveUnusedAttributeViewRequestInput"
},
"response": {
"anyOf": [
@@ -118174,7 +118984,7 @@
]
},
"data": {
- "$ref": "#/$defs/RefDefsData"
+ "$ref": "#/$defs/AVIDData"
},
"msg": {
"type": "string"
@@ -118231,8 +119041,8 @@
},
{
"method": "POST",
- "path": "/api/av/getUnusedAttributeViews",
- "handler": "getUnusedAttributeViews",
+ "path": "/api/av/removeUnusedAttributeViews",
+ "handler": "removeUnusedAttributeViews",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -118248,20 +119058,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/AVPathsData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/AssetUnusedItem"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -118277,6 +119109,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/av/renderAttributeView",
+ "handler": "renderAttributeView",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/RenderAttributeViewRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/AVRenderResult"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -118304,6 +119172,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/AVRenderResult"
}
]
},
@@ -118323,11 +119194,11 @@
},
{
"method": "POST",
- "path": "/api/av/removeAttributeViewBlocks",
- "handler": "removeAttributeViewBlocks",
+ "path": "/api/av/renderHistoryAttributeView",
+ "handler": "renderHistoryAttributeView",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveAttributeViewBlocksRequestInput"
+ "$ref": "#/$defs/RenderHistoryAttributeViewRequestInput"
},
"response": {
"anyOf": [
@@ -118341,7 +119212,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/AVArchiveRenderData"
},
"msg": {
"type": "string"
@@ -118398,11 +119269,11 @@
},
{
"method": "POST",
- "path": "/api/av/removeAttributeViewKey",
- "handler": "removeAttributeViewKey",
+ "path": "/api/av/renderSnapshotAttributeView",
+ "handler": "renderSnapshotAttributeView",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveAttributeViewKeyRequestInput"
+ "$ref": "#/$defs/RenderSnapshotAttributeViewRequestInput"
},
"response": {
"anyOf": [
@@ -118416,7 +119287,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/AVArchiveRenderData"
},
"msg": {
"type": "string"
@@ -118473,11 +119344,11 @@
},
{
"method": "POST",
- "path": "/api/av/removeUnusedAttributeView",
- "handler": "removeUnusedAttributeView",
+ "path": "/api/av/searchAttributeView",
+ "handler": "searchAttributeView",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveUnusedAttributeViewRequestInput"
+ "$ref": "#/$defs/SearchAttributeViewRequestInput"
},
"response": {
"anyOf": [
@@ -118491,7 +119362,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVIDData"
+ "$ref": "#/$defs/AVSearchData"
},
"msg": {
"type": "string"
@@ -118548,8 +119419,8 @@
},
{
"method": "POST",
- "path": "/api/av/removeUnusedAttributeViews",
- "handler": "removeUnusedAttributeViews",
+ "path": "/api/av/searchAttributeViewNonRelationKey",
+ "handler": "searchAttributeViewNonRelationKey",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -118566,7 +119437,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVPathsData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -118623,11 +119494,11 @@
},
{
"method": "POST",
- "path": "/api/av/renderAttributeView",
- "handler": "renderAttributeView",
+ "path": "/api/av/searchAttributeViewRelationKey",
+ "handler": "searchAttributeViewRelationKey",
"body": "json",
"request": {
- "$ref": "#/$defs/RenderAttributeViewRequestInput"
+ "$ref": "#/$defs/SearchAttributeViewRelationKeyRequestInput"
},
"response": {
"anyOf": [
@@ -118641,7 +119512,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVRenderResult"
+ "$ref": "#/$defs/AVKeysData"
},
"msg": {
"type": "string"
@@ -118679,9 +119550,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/AVRenderResult"
}
]
},
@@ -118701,11 +119569,11 @@
},
{
"method": "POST",
- "path": "/api/av/renderHistoryAttributeView",
- "handler": "renderHistoryAttributeView",
+ "path": "/api/av/searchAttributeViewRollupDestKeys",
+ "handler": "searchAttributeViewRollupDestKeys",
"body": "json",
"request": {
- "$ref": "#/$defs/RenderHistoryAttributeViewRequestInput"
+ "$ref": "#/$defs/SearchAttributeViewRollupDestKeysRequestInput"
},
"response": {
"anyOf": [
@@ -118719,7 +119587,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVArchiveRenderData"
+ "$ref": "#/$defs/AVKeysData"
},
"msg": {
"type": "string"
@@ -118776,11 +119644,11 @@
},
{
"method": "POST",
- "path": "/api/av/renderSnapshotAttributeView",
- "handler": "renderSnapshotAttributeView",
+ "path": "/api/av/setAttrViewContextFilter",
+ "handler": "setAttrViewContextFilter",
"body": "json",
"request": {
- "$ref": "#/$defs/RenderSnapshotAttributeViewRequestInput"
+ "$ref": "#/$defs/SetAttrViewContextFilterRequestInput"
},
"response": {
"anyOf": [
@@ -118794,7 +119662,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVArchiveRenderData"
+ "$ref": "#/$defs/AVContextFilterData"
},
"msg": {
"type": "string"
@@ -118851,11 +119719,11 @@
},
{
"method": "POST",
- "path": "/api/av/searchAttributeView",
- "handler": "searchAttributeView",
+ "path": "/api/av/setAttrViewFilters",
+ "handler": "setAttrViewFilters",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchAttributeViewRequestInput"
+ "$ref": "#/$defs/SetAttrViewFiltersRequestInput"
},
"response": {
"anyOf": [
@@ -118869,7 +119737,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVSearchData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -118926,11 +119794,11 @@
},
{
"method": "POST",
- "path": "/api/av/searchAttributeViewNonRelationKey",
- "handler": "searchAttributeViewNonRelationKey",
- "body": "none",
+ "path": "/api/av/setAttrViewGroup",
+ "handler": "setAttrViewGroup",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SetAttrViewGroupRequestInput"
},
"response": {
"anyOf": [
@@ -118944,7 +119812,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/AVRenderResult"
},
"msg": {
"type": "string"
@@ -118982,6 +119850,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/AVRenderResult"
}
]
},
@@ -119001,11 +119872,11 @@
},
{
"method": "POST",
- "path": "/api/av/searchAttributeViewRelationKey",
- "handler": "searchAttributeViewRelationKey",
+ "path": "/api/av/setAttrViewSorts",
+ "handler": "setAttrViewSorts",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchAttributeViewRelationKeyRequestInput"
+ "$ref": "#/$defs/SetAttrViewSortsRequestInput"
},
"response": {
"anyOf": [
@@ -119019,7 +119890,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVKeysData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -119076,11 +119947,11 @@
},
{
"method": "POST",
- "path": "/api/av/searchAttributeViewRollupDestKeys",
- "handler": "searchAttributeViewRollupDestKeys",
+ "path": "/api/av/setAttributeViewBlockAttr",
+ "handler": "setAttributeViewBlockAttr",
"body": "json",
"request": {
- "$ref": "#/$defs/SearchAttributeViewRollupDestKeysRequestInput"
+ "$ref": "#/$defs/SetAttributeViewBlockAttrRequestInput"
},
"response": {
"anyOf": [
@@ -119094,7 +119965,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVKeysData"
+ "$ref": "#/$defs/AVValueData"
},
"msg": {
"type": "string"
@@ -119151,11 +120022,11 @@
},
{
"method": "POST",
- "path": "/api/av/setAttrViewContextFilter",
- "handler": "setAttrViewContextFilter",
+ "path": "/api/av/setDatabaseBlockView",
+ "handler": "setDatabaseBlockView",
"body": "json",
"request": {
- "$ref": "#/$defs/SetAttrViewContextFilterRequestInput"
+ "$ref": "#/$defs/SetDatabaseBlockViewRequestInput"
},
"response": {
"anyOf": [
@@ -119169,7 +120040,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVContextFilterData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -119226,11 +120097,11 @@
},
{
"method": "POST",
- "path": "/api/av/setAttrViewFilters",
- "handler": "setAttrViewFilters",
+ "path": "/api/av/sortAttributeViewKey",
+ "handler": "sortAttributeViewKey",
"body": "json",
"request": {
- "$ref": "#/$defs/SetAttrViewFiltersRequestInput"
+ "$ref": "#/$defs/SortAttributeViewKeyRequestInput"
},
"response": {
"anyOf": [
@@ -119301,11 +120172,11 @@
},
{
"method": "POST",
- "path": "/api/av/setAttrViewGroup",
- "handler": "setAttrViewGroup",
+ "path": "/api/av/sortAttributeViewViewKey",
+ "handler": "sortAttributeViewViewKey",
"body": "json",
"request": {
- "$ref": "#/$defs/SetAttrViewGroupRequestInput"
+ "$ref": "#/$defs/SortAttributeViewViewKeyRequestInput"
},
"response": {
"anyOf": [
@@ -119319,7 +120190,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVRenderResult"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -119357,9 +120228,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/AVRenderResult"
}
]
},
@@ -119379,11 +120247,11 @@
},
{
"method": "POST",
- "path": "/api/av/setAttrViewSorts",
- "handler": "setAttrViewSorts",
+ "path": "/api/bazaar/batchUpdatePackage",
+ "handler": "batchUpdatePackage",
"body": "json",
"request": {
- "$ref": "#/$defs/SetAttrViewSortsRequestInput"
+ "$ref": "#/$defs/BatchUpdatePackageRequestInput"
},
"response": {
"anyOf": [
@@ -119416,7 +120284,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -119454,11 +120323,11 @@
},
{
"method": "POST",
- "path": "/api/av/setAttributeViewBlockAttr",
- "handler": "setAttributeViewBlockAttr",
+ "path": "/api/bazaar/getBazaarIcon",
+ "handler": "getBazaarIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/SetAttributeViewBlockAttrRequestInput"
+ "$ref": "#/$defs/GetBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -119472,7 +120341,7 @@
]
},
"data": {
- "$ref": "#/$defs/AVValueData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -119491,7 +120360,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -119529,11 +120399,11 @@
},
{
"method": "POST",
- "path": "/api/av/setDatabaseBlockView",
- "handler": "setDatabaseBlockView",
+ "path": "/api/bazaar/getBazaarPackage",
+ "handler": "getBazaarPackage",
"body": "json",
"request": {
- "$ref": "#/$defs/SetDatabaseBlockViewRequestInput"
+ "$ref": "#/$defs/GetBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -119547,7 +120417,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarPackageDetail"
},
"msg": {
"type": "string"
@@ -119566,7 +120436,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -119604,11 +120475,11 @@
},
{
"method": "POST",
- "path": "/api/av/sortAttributeViewKey",
- "handler": "sortAttributeViewKey",
+ "path": "/api/bazaar/getBazaarPackageREADME",
+ "handler": "getBazaarPackageREADME",
"body": "json",
"request": {
- "$ref": "#/$defs/SortAttributeViewKeyRequestInput"
+ "$ref": "#/$defs/GetBazaarPackageREADMERequestInput"
},
"response": {
"anyOf": [
@@ -119622,7 +120493,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarREADMEData"
},
"msg": {
"type": "string"
@@ -119641,7 +120512,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -119679,11 +120551,11 @@
},
{
"method": "POST",
- "path": "/api/av/sortAttributeViewViewKey",
- "handler": "sortAttributeViewViewKey",
+ "path": "/api/bazaar/getBazaarPackageRating",
+ "handler": "getBazaarPackageRating",
"body": "json",
"request": {
- "$ref": "#/$defs/SortAttributeViewViewKeyRequestInput"
+ "$ref": "#/$defs/GetBazaarPackageRatingRequestInput"
},
"response": {
"anyOf": [
@@ -119697,7 +120569,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarRatingResult"
},
"msg": {
"type": "string"
@@ -119716,7 +120588,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -119735,6 +120608,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -119754,11 +120630,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/batchUpdatePackage",
- "handler": "batchUpdatePackage",
+ "path": "/api/bazaar/getBazaarPackageRatings",
+ "handler": "getBazaarPackageRatings",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchUpdatePackageRequestInput"
+ "$ref": "#/$defs/GetBazaarPackageRatingsRequestInput"
},
"response": {
"anyOf": [
@@ -119772,7 +120648,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BazaarRatingsData"
},
"msg": {
"type": "string"
@@ -119830,11 +120706,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarIcon",
- "handler": "getBazaarIcon",
+ "path": "/api/bazaar/getBazaarPackageUserRatings",
+ "handler": "getBazaarPackageUserRatings",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarIconRequestInput"
+ "$ref": "#/$defs/GetBazaarPackageUserRatingsRequestInput"
},
"response": {
"anyOf": [
@@ -119848,7 +120724,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarUserRatingsResult"
},
"msg": {
"type": "string"
@@ -119887,6 +120763,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarUserRatingsResult"
}
]
},
@@ -119906,11 +120785,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackage",
- "handler": "getBazaarPackage",
+ "path": "/api/bazaar/getBazaarPlugin",
+ "handler": "getBazaarPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageRequestInput"
+ "$ref": "#/$defs/GetBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -119924,7 +120803,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackageDetail"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -119982,11 +120861,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageREADME",
- "handler": "getBazaarPackageREADME",
+ "path": "/api/bazaar/getBazaarTemplate",
+ "handler": "getBazaarTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageREADMERequestInput"
+ "$ref": "#/$defs/GetBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -120000,7 +120879,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarREADMEData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -120058,11 +120937,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageRating",
- "handler": "getBazaarPackageRating",
+ "path": "/api/bazaar/getBazaarTheme",
+ "handler": "getBazaarTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageRatingRequestInput"
+ "$ref": "#/$defs/GetBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -120076,7 +120955,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarRatingResult"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -120115,9 +120994,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -120137,11 +121013,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageRatings",
- "handler": "getBazaarPackageRatings",
+ "path": "/api/bazaar/getBazaarWidget",
+ "handler": "getBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageRatingsRequestInput"
+ "$ref": "#/$defs/GetBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -120155,7 +121031,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarRatingsData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -120213,11 +121089,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPackageUserRatings",
- "handler": "getBazaarPackageUserRatings",
+ "path": "/api/bazaar/getInstalledIcon",
+ "handler": "getInstalledIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPackageUserRatingsRequestInput"
+ "$ref": "#/$defs/GetInstalledIconRequestInput"
},
"response": {
"anyOf": [
@@ -120231,7 +121107,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarUserRatingsResult"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -120270,9 +121146,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarUserRatingsResult"
}
]
},
@@ -120292,11 +121165,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarPlugin",
- "handler": "getBazaarPlugin",
+ "path": "/api/bazaar/getInstalledPackageSize",
+ "handler": "getInstalledPackageSize",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarPluginRequestInput"
+ "$ref": "#/$defs/GetInstalledPackageSizeRequestInput"
},
"response": {
"anyOf": [
@@ -120310,7 +121183,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarPackageSizeData"
},
"msg": {
"type": "string"
@@ -120368,11 +121241,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarTemplate",
- "handler": "getBazaarTemplate",
+ "path": "/api/bazaar/getInstalledPlugin",
+ "handler": "getInstalledPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarTemplateRequestInput"
+ "$ref": "#/$defs/GetInstalledPluginRequestInput"
},
"response": {
"anyOf": [
@@ -120444,11 +121317,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarTheme",
- "handler": "getBazaarTheme",
+ "path": "/api/bazaar/getInstalledTemplate",
+ "handler": "getInstalledTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarThemeRequestInput"
+ "$ref": "#/$defs/GetInstalledTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -120520,11 +121393,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getBazaarWidget",
- "handler": "getBazaarWidget",
+ "path": "/api/bazaar/getInstalledTheme",
+ "handler": "getInstalledTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/GetBazaarWidgetRequestInput"
+ "$ref": "#/$defs/GetInstalledThemeRequestInput"
},
"response": {
"anyOf": [
@@ -120596,11 +121469,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledIcon",
- "handler": "getInstalledIcon",
+ "path": "/api/bazaar/getInstalledWidget",
+ "handler": "getInstalledWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledIconRequestInput"
+ "$ref": "#/$defs/GetInstalledWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -120672,11 +121545,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledPackageSize",
- "handler": "getInstalledPackageSize",
+ "path": "/api/bazaar/getUpdatedPackage",
+ "handler": "getUpdatedPackage",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledPackageSizeRequestInput"
+ "$ref": "#/$defs/GetUpdatedPackageRequestInput"
},
"response": {
"anyOf": [
@@ -120690,7 +121563,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackageSizeData"
+ "$ref": "#/$defs/BazaarUpdatedData"
},
"msg": {
"type": "string"
@@ -120748,11 +121621,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledPlugin",
- "handler": "getInstalledPlugin",
+ "path": "/api/bazaar/installBazaarIcon",
+ "handler": "installBazaarIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledPluginRequestInput"
+ "$ref": "#/$defs/InstallBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -120766,7 +121639,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -120824,11 +121697,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledTemplate",
- "handler": "getInstalledTemplate",
+ "path": "/api/bazaar/installBazaarPlugin",
+ "handler": "installBazaarPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledTemplateRequestInput"
+ "$ref": "#/$defs/InstallBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -120900,11 +121773,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledTheme",
- "handler": "getInstalledTheme",
+ "path": "/api/bazaar/installBazaarTemplate",
+ "handler": "installBazaarTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledThemeRequestInput"
+ "$ref": "#/$defs/InstallBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -120976,11 +121849,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getInstalledWidget",
- "handler": "getInstalledWidget",
+ "path": "/api/bazaar/installBazaarTheme",
+ "handler": "installBazaarTheme",
"body": "json",
"request": {
- "$ref": "#/$defs/GetInstalledWidgetRequestInput"
+ "$ref": "#/$defs/InstallBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -120994,7 +121867,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -121052,11 +121925,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/getUpdatedPackage",
- "handler": "getUpdatedPackage",
+ "path": "/api/bazaar/installBazaarWidget",
+ "handler": "installBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/GetUpdatedPackageRequestInput"
+ "$ref": "#/$defs/InstallBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -121070,7 +121943,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarUpdatedData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -121128,11 +122001,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarIcon",
- "handler": "installBazaarIcon",
- "body": "json",
+ "path": "/api/bazaar/installLocalBazaarPackage",
+ "handler": "installLocalBazaarPackage",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/InstallBazaarIconRequestInput"
+ "$ref": "#/$defs/InstallLocalBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -121146,7 +122019,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "$ref": "#/$defs/BazaarLocalInstallResult"
},
"msg": {
"type": "string"
@@ -121185,6 +122058,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarLocalInstallResult"
}
]
},
@@ -121204,11 +122080,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarPlugin",
- "handler": "installBazaarPlugin",
+ "path": "/api/bazaar/setBazaarPackageRating",
+ "handler": "setBazaarPackageRating",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarPluginRequestInput"
+ "$ref": "#/$defs/SetBazaarPackageRatingRequestInput"
},
"response": {
"anyOf": [
@@ -121222,7 +122098,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarRatingResult"
},
"msg": {
"type": "string"
@@ -121261,6 +122137,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -121280,11 +122159,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarTemplate",
- "handler": "installBazaarTemplate",
+ "path": "/api/bazaar/uninstallBazaarIcon",
+ "handler": "uninstallBazaarIcon",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarTemplateRequestInput"
+ "$ref": "#/$defs/UninstallBazaarIconRequestInput"
},
"response": {
"anyOf": [
@@ -121298,7 +122177,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -121356,11 +122235,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarTheme",
- "handler": "installBazaarTheme",
+ "path": "/api/bazaar/uninstallBazaarPlugin",
+ "handler": "uninstallBazaarPlugin",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarThemeRequestInput"
+ "$ref": "#/$defs/UninstallBazaarPluginRequestInput"
},
"response": {
"anyOf": [
@@ -121374,7 +122253,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -121432,11 +122311,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installBazaarWidget",
- "handler": "installBazaarWidget",
+ "path": "/api/bazaar/uninstallBazaarTemplate",
+ "handler": "uninstallBazaarTemplate",
"body": "json",
"request": {
- "$ref": "#/$defs/InstallBazaarWidgetRequestInput"
+ "$ref": "#/$defs/UninstallBazaarTemplateRequestInput"
},
"response": {
"anyOf": [
@@ -121508,11 +122387,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/installLocalBazaarPackage",
- "handler": "installLocalBazaarPackage",
- "body": "multipart",
+ "path": "/api/bazaar/uninstallBazaarTheme",
+ "handler": "uninstallBazaarTheme",
+ "body": "json",
"request": {
- "$ref": "#/$defs/InstallLocalBazaarPackageRequestInput"
+ "$ref": "#/$defs/UninstallBazaarThemeRequestInput"
},
"response": {
"anyOf": [
@@ -121526,7 +122405,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarLocalInstallResult"
+ "$ref": "#/$defs/BazaarAppearancePackagesData"
},
"msg": {
"type": "string"
@@ -121565,9 +122444,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarLocalInstallResult"
}
]
},
@@ -121587,11 +122463,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/setBazaarPackageRating",
- "handler": "setBazaarPackageRating",
+ "path": "/api/bazaar/uninstallBazaarWidget",
+ "handler": "uninstallBazaarWidget",
"body": "json",
"request": {
- "$ref": "#/$defs/SetBazaarPackageRatingRequestInput"
+ "$ref": "#/$defs/UninstallBazaarWidgetRequestInput"
},
"response": {
"anyOf": [
@@ -121605,7 +122481,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarRatingResult"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -121644,9 +122520,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/BazaarRatingResult"
}
]
},
@@ -121666,11 +122539,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarIcon",
- "handler": "uninstallBazaarIcon",
+ "path": "/api/bazaar/updateBazaarPackage",
+ "handler": "updateBazaarPackage",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarIconRequestInput"
+ "$ref": "#/$defs/UpdateBazaarPackageRequestInput"
},
"response": {
"anyOf": [
@@ -121684,7 +122557,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "$ref": "#/$defs/BazaarPackagesData"
},
"msg": {
"type": "string"
@@ -121742,11 +122615,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarPlugin",
- "handler": "uninstallBazaarPlugin",
+ "path": "/api/block/appendBlock",
+ "handler": "appendBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarPluginRequestInput"
+ "$ref": "#/$defs/AppendBlockRequestInput"
},
"response": {
"anyOf": [
@@ -121759,43 +122632,20 @@
0
]
},
- "data": {
- "$ref": "#/$defs/BazaarPackagesData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- 1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -121811,42 +122661,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/bazaar/uninstallBazaarTemplate",
- "handler": "uninstallBazaarTemplate",
- "body": "json",
- "request": {
- "$ref": "#/$defs/UninstallBazaarTemplateRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/BazaarPackagesData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -121855,8 +122669,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -121894,11 +122707,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarTheme",
- "handler": "uninstallBazaarTheme",
+ "path": "/api/block/appendDailyNoteBlock",
+ "handler": "appendDailyNoteBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarThemeRequestInput"
+ "$ref": "#/$defs/DailyNoteBlockRequestInput"
},
"response": {
"anyOf": [
@@ -121912,7 +122725,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarAppearancePackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -121931,8 +122761,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -121970,11 +122799,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/uninstallBazaarWidget",
- "handler": "uninstallBazaarWidget",
+ "path": "/api/block/appendHeadingChildren",
+ "handler": "appendHeadingChildren",
"body": "json",
"request": {
- "$ref": "#/$defs/UninstallBazaarWidgetRequestInput"
+ "$ref": "#/$defs/AppendHeadingChildrenRequestInput"
},
"response": {
"anyOf": [
@@ -121988,7 +122817,7 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -122007,8 +122836,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -122046,11 +122874,11 @@
},
{
"method": "POST",
- "path": "/api/bazaar/updateBazaarPackage",
- "handler": "updateBazaarPackage",
+ "path": "/api/block/batchAppendBlock",
+ "handler": "batchAppendBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/UpdateBazaarPackageRequestInput"
+ "$ref": "#/$defs/BatchParentBlockRequestInput"
},
"response": {
"anyOf": [
@@ -122064,7 +122892,24 @@
]
},
"data": {
- "$ref": "#/$defs/BazaarPackagesData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -122083,8 +122928,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -122122,11 +122966,11 @@
},
{
"method": "POST",
- "path": "/api/block/appendBlock",
- "handler": "appendBlock",
+ "path": "/api/block/batchInsertBlock",
+ "handler": "batchInsertBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/AppendBlockRequestInput"
+ "$ref": "#/$defs/BatchInsertBlockRequestInput"
},
"response": {
"anyOf": [
@@ -122214,11 +123058,11 @@
},
{
"method": "POST",
- "path": "/api/block/appendDailyNoteBlock",
- "handler": "appendDailyNoteBlock",
+ "path": "/api/block/batchPrependBlock",
+ "handler": "batchPrependBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/DailyNoteBlockRequestInput"
+ "$ref": "#/$defs/BatchParentBlockRequestInput"
},
"response": {
"anyOf": [
@@ -122306,11 +123150,11 @@
},
{
"method": "POST",
- "path": "/api/block/appendHeadingChildren",
- "handler": "appendHeadingChildren",
+ "path": "/api/block/batchUpdateBlock",
+ "handler": "batchUpdateBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/AppendHeadingChildrenRequestInput"
+ "$ref": "#/$defs/BatchUpdateBlockRequestInput"
},
"response": {
"anyOf": [
@@ -122324,7 +123168,24 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -122381,11 +123242,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchAppendBlock",
- "handler": "batchAppendBlock",
+ "path": "/api/block/batchUpdateTaskListItemMarker",
+ "handler": "batchUpdateTaskListItemMarker",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchParentBlockRequestInput"
+ "$ref": "#/$defs/BatchTaskListMarkerRequestInput"
},
"response": {
"anyOf": [
@@ -122473,11 +123334,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchInsertBlock",
- "handler": "batchInsertBlock",
+ "path": "/api/block/checkBlockExist",
+ "handler": "checkBlockExist",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchInsertBlockRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -122491,24 +123352,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "boolean"
},
"msg": {
"type": "string"
@@ -122565,11 +123409,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchPrependBlock",
- "handler": "batchPrependBlock",
+ "path": "/api/block/checkBlockFold",
+ "handler": "checkBlockFold",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchParentBlockRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -122582,20 +123426,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/BlockFoldData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -122611,6 +123477,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/block/checkBlockRef",
+ "handler": "checkBlockRef",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/CheckBlockRefRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "boolean"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -122638,6 +123540,9 @@
},
{
"type": "null"
+ },
+ {
+ "type": "boolean"
}
]
},
@@ -122657,11 +123562,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchUpdateBlock",
- "handler": "batchUpdateBlock",
+ "path": "/api/block/checkBlocksExist",
+ "handler": "checkBlocksExist",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchUpdateBlockRequestInput"
+ "$ref": "#/$defs/CheckBlocksExistRequestInput"
},
"response": {
"anyOf": [
@@ -122677,16 +123582,9 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "object",
+ "additionalProperties": {
+ "type": "boolean"
}
},
{
@@ -122749,11 +123647,11 @@
},
{
"method": "POST",
- "path": "/api/block/batchUpdateTaskListItemMarker",
- "handler": "batchUpdateTaskListItemMarker",
+ "path": "/api/block/deleteBlock",
+ "handler": "deleteBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BatchTaskListMarkerRequestInput"
+ "$ref": "#/$defs/DeleteBlockRequestInput"
},
"response": {
"anyOf": [
@@ -122841,11 +123739,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlockExist",
- "handler": "checkBlockExist",
+ "path": "/api/block/foldBlock",
+ "handler": "foldBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -122859,7 +123757,7 @@
]
},
"data": {
- "type": "boolean"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -122916,11 +123814,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlockFold",
- "handler": "checkBlockFold",
+ "path": "/api/block/getBlockBreadcrumb",
+ "handler": "getBlockBreadcrumb",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/BlockBreadcrumbRequestInput"
},
"response": {
"anyOf": [
@@ -122934,7 +123832,24 @@
]
},
"data": {
- "$ref": "#/$defs/BlockFoldData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockPath"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -122991,11 +123906,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlockRef",
- "handler": "checkBlockRef",
+ "path": "/api/block/getBlockBreadcrumbChildren",
+ "handler": "getBlockBreadcrumbChildren",
"body": "json",
"request": {
- "$ref": "#/$defs/CheckBlockRefRequestInput"
+ "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"
},
"response": {
"anyOf": [
@@ -123009,7 +123924,14 @@
]
},
"data": {
- "type": "boolean"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockBreadcrumbChildren"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -123047,9 +123969,6 @@
},
{
"type": "null"
- },
- {
- "type": "boolean"
}
]
},
@@ -123069,11 +123988,11 @@
},
{
"method": "POST",
- "path": "/api/block/checkBlocksExist",
- "handler": "checkBlocksExist",
+ "path": "/api/block/getBlockDOM",
+ "handler": "getBlockDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/CheckBlocksExistRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123087,17 +124006,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "boolean"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BlockDOMData"
},
"msg": {
"type": "string"
@@ -123154,11 +124063,11 @@
},
{
"method": "POST",
- "path": "/api/block/deleteBlock",
- "handler": "deleteBlock",
+ "path": "/api/block/getBlockDOMWithEmbed",
+ "handler": "getBlockDOMWithEmbed",
"body": "json",
"request": {
- "$ref": "#/$defs/DeleteBlockRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123172,24 +124081,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BlockDOMData"
},
"msg": {
"type": "string"
@@ -123246,11 +124138,11 @@
},
{
"method": "POST",
- "path": "/api/block/foldBlock",
- "handler": "foldBlock",
+ "path": "/api/block/getBlockDOMs",
+ "handler": "getBlockDOMs",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123264,7 +124156,17 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -123321,11 +124223,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockBreadcrumb",
- "handler": "getBlockBreadcrumb",
+ "path": "/api/block/getBlockDOMsWithEmbed",
+ "handler": "getBlockDOMsWithEmbed",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockBreadcrumbRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123341,16 +124243,9 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockPath"
- },
- {
- "type": "null"
- }
- ]
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
}
},
{
@@ -123413,11 +124308,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockBreadcrumbChildren",
- "handler": "getBlockBreadcrumbChildren",
+ "path": "/api/block/getBlockDefIDsByRefText",
+ "handler": "getBlockDefIDsByRefText",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockBreadcrumbChildrenRequestInput"
+ "$ref": "#/$defs/RefTextQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123431,14 +124326,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockBreadcrumbChildren"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/RefDefsData"
},
"msg": {
"type": "string"
@@ -123495,8 +124383,8 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOM",
- "handler": "getBlockDOM",
+ "path": "/api/block/getBlockIndex",
+ "handler": "getBlockIndex",
"body": "json",
"request": {
"$ref": "#/$defs/BlockQueryRequestInput"
@@ -123513,7 +124401,7 @@
]
},
"data": {
- "$ref": "#/$defs/BlockDOMData"
+ "type": "integer"
},
"msg": {
"type": "string"
@@ -123570,11 +124458,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOMWithEmbed",
- "handler": "getBlockDOMWithEmbed",
+ "path": "/api/block/getBlockInfo",
+ "handler": "getBlockInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/BlockInfoRequestInput"
},
"response": {
"anyOf": [
@@ -123588,7 +124476,7 @@
]
},
"data": {
- "$ref": "#/$defs/BlockDOMData"
+ "$ref": "#/$defs/BlockInfoData"
},
"msg": {
"type": "string"
@@ -123607,7 +124495,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 3
]
},
"data": {
@@ -123626,6 +124515,9 @@
},
{
"type": "null"
+ },
+ {
+ "type": "string"
}
]
},
@@ -123645,11 +124537,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOMs",
- "handler": "getBlockDOMs",
+ "path": "/api/block/getBlockKramdown",
+ "handler": "getBlockKramdown",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/BlockKramdownRequestInput"
},
"response": {
"anyOf": [
@@ -123663,17 +124555,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "object",
- "additionalProperties": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BlockKramdownData"
},
"msg": {
"type": "string"
@@ -123730,11 +124612,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDOMsWithEmbed",
- "handler": "getBlockDOMsWithEmbed",
+ "path": "/api/block/getBlockKramdowns",
+ "handler": "getBlockKramdowns",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/BlocksKramdownRequestInput"
},
"response": {
"anyOf": [
@@ -123815,11 +124697,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockDefIDsByRefText",
- "handler": "getBlockDefIDsByRefText",
+ "path": "/api/block/getBlockRelevantIDs",
+ "handler": "getBlockRelevantIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/RefTextQueryRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123833,7 +124715,7 @@
]
},
"data": {
- "$ref": "#/$defs/RefDefsData"
+ "$ref": "#/$defs/BlockRelevantData"
},
"msg": {
"type": "string"
@@ -123890,8 +124772,8 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockIndex",
- "handler": "getBlockIndex",
+ "path": "/api/block/getBlockSiblingID",
+ "handler": "getBlockSiblingID",
"body": "json",
"request": {
"$ref": "#/$defs/BlockQueryRequestInput"
@@ -123908,7 +124790,7 @@
]
},
"data": {
- "type": "integer"
+ "$ref": "#/$defs/BlockSiblingData"
},
"msg": {
"type": "string"
@@ -123965,11 +124847,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockInfo",
- "handler": "getBlockInfo",
+ "path": "/api/block/getBlockTreeInfos",
+ "handler": "getBlockTreeInfos",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockInfoRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -123983,7 +124865,24 @@
]
},
"data": {
- "$ref": "#/$defs/BlockInfoData"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTreeInfo"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -124002,8 +124901,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 3
+ -1
]
},
"data": {
@@ -124022,9 +124920,6 @@
},
{
"type": "null"
- },
- {
- "type": "string"
}
]
},
@@ -124044,11 +124939,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockKramdown",
- "handler": "getBlockKramdown",
+ "path": "/api/block/getBlocksIndexes",
+ "handler": "getBlocksIndexes",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockKramdownRequestInput"
+ "$ref": "#/$defs/BlocksQueryRequestInput"
},
"response": {
"anyOf": [
@@ -124062,7 +124957,17 @@
]
},
"data": {
- "$ref": "#/$defs/BlockKramdownData"
+ "anyOf": [
+ {
+ "type": "object",
+ "additionalProperties": {
+ "type": "integer"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -124119,11 +125024,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockKramdowns",
- "handler": "getBlockKramdowns",
+ "path": "/api/block/getBlocksWordCount",
+ "handler": "getBlocksWordCount",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksKramdownRequestInput"
+ "$ref": "#/$defs/BlocksWordCountRequestInput"
},
"response": {
"anyOf": [
@@ -124136,13 +125041,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/WordCountData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
"type": "object",
- "additionalProperties": {
- "type": "string"
- }
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -124158,6 +125092,52 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/block/getChildBlocks",
+ "handler": "getChildBlocks",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/BlockQueryRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ChildBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -124204,11 +125184,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockRelevantIDs",
- "handler": "getBlockRelevantIDs",
+ "path": "/api/block/getContentWordCount",
+ "handler": "getContentWordCount",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/ContentWordCountRequestInput"
},
"response": {
"anyOf": [
@@ -124222,7 +125202,7 @@
]
},
"data": {
- "$ref": "#/$defs/BlockRelevantData"
+ "$ref": "#/$defs/WordCountData"
},
"msg": {
"type": "string"
@@ -124279,11 +125259,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockSiblingID",
- "handler": "getBlockSiblingID",
+ "path": "/api/block/getDOMText",
+ "handler": "getDOMText",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/DOMTextRequestInput"
},
"response": {
"anyOf": [
@@ -124297,7 +125277,7 @@
]
},
"data": {
- "$ref": "#/$defs/BlockSiblingData"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -124354,11 +125334,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlockTreeInfos",
- "handler": "getBlockTreeInfos",
+ "path": "/api/block/getDocBlocksOrders",
+ "handler": "getDocBlocksOrders",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/DocOrdersRequestInput"
},
"response": {
"anyOf": [
@@ -124374,16 +125354,9 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTreeInfo"
- },
- {
- "type": "null"
- }
- ]
+ "type": "array",
+ "items": {
+ "type": "string"
}
},
{
@@ -124446,11 +125419,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlocksIndexes",
- "handler": "getBlocksIndexes",
- "body": "json",
+ "path": "/api/block/getDocHeadingLevelTransaction",
+ "handler": "getDocHeadingLevelTransaction",
+ "body": "structJSON",
"request": {
- "$ref": "#/$defs/BlocksQueryRequestInput"
+ "$ref": "#/$defs/DocHeadingLevelRequestInput"
},
"response": {
"anyOf": [
@@ -124466,10 +125439,7 @@
"data": {
"anyOf": [
{
- "type": "object",
- "additionalProperties": {
- "type": "integer"
- }
+ "$ref": "#/$defs/DocHeadingLevelData"
},
{
"type": "null"
@@ -124531,11 +125501,11 @@
},
{
"method": "POST",
- "path": "/api/block/getBlocksWordCount",
- "handler": "getBlocksWordCount",
+ "path": "/api/block/getDocInfo",
+ "handler": "getDocInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/BlocksWordCountRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -124549,7 +125519,14 @@
]
},
"data": {
- "$ref": "#/$defs/WordCountData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DocInfo"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -124606,11 +125583,11 @@
},
{
"method": "POST",
- "path": "/api/block/getChildBlocks",
- "handler": "getChildBlocks",
+ "path": "/api/block/getDocsInfo",
+ "handler": "getDocsInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/DocsInfoRequestInput"
},
"response": {
"anyOf": [
@@ -124623,52 +125600,20 @@
0
]
},
- "data": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/ChildBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/DocInfo"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -124684,42 +125629,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/block/getContentWordCount",
- "handler": "getContentWordCount",
- "body": "json",
- "request": {
- "$ref": "#/$defs/ContentWordCountRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/WordCountData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -124766,11 +125675,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDOMText",
- "handler": "getDOMText",
+ "path": "/api/block/getHeadingChildrenDOM",
+ "handler": "getHeadingChildrenDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/DOMTextRequestInput"
+ "$ref": "#/$defs/HeadingChildrenRequestInput"
},
"response": {
"anyOf": [
@@ -124841,11 +125750,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocBlocksOrders",
- "handler": "getDocBlocksOrders",
+ "path": "/api/block/getHeadingChildrenIDs",
+ "handler": "getHeadingChildrenIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/DocOrdersRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -124926,11 +125835,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocHeadingLevelTransaction",
- "handler": "getDocHeadingLevelTransaction",
- "body": "structJSON",
+ "path": "/api/block/getHeadingDeleteTransaction",
+ "handler": "getHeadingDeleteTransaction",
+ "body": "json",
"request": {
- "$ref": "#/$defs/DocHeadingLevelRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -124946,7 +125855,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/DocHeadingLevelData"
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -125008,11 +125917,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocInfo",
- "handler": "getDocInfo",
+ "path": "/api/block/getHeadingFoldTransaction",
+ "handler": "getHeadingFoldTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/HeadingFoldRequestInput"
},
"response": {
"anyOf": [
@@ -125028,7 +125937,7 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/DocInfo"
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -125090,11 +125999,11 @@
},
{
"method": "POST",
- "path": "/api/block/getDocsInfo",
- "handler": "getDocsInfo",
+ "path": "/api/block/getHeadingInsertTransaction",
+ "handler": "getHeadingInsertTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/DocsInfoRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -125110,17 +126019,7 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/DocInfo"
- },
- {
- "type": "null"
- }
- ]
- }
+ "$ref": "#/$defs/BlockTransaction"
},
{
"type": "null"
@@ -125182,11 +126081,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingChildrenDOM",
- "handler": "getHeadingChildrenDOM",
+ "path": "/api/block/getHeadingLevelTransaction",
+ "handler": "getHeadingLevelTransaction",
"body": "json",
"request": {
- "$ref": "#/$defs/HeadingChildrenRequestInput"
+ "$ref": "#/$defs/HeadingLevelRequestInput"
},
"response": {
"anyOf": [
@@ -125200,7 +126099,14 @@
]
},
"data": {
- "type": "string"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -125257,11 +126163,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingChildrenIDs",
- "handler": "getHeadingChildrenIDs",
+ "path": "/api/block/getOrderedListContinueStart",
+ "handler": "getOrderedListContinueStart",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -125275,17 +126181,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "type": "string"
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/OrderedListStartData"
},
"msg": {
"type": "string"
@@ -125342,11 +126238,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingDeleteTransaction",
- "handler": "getHeadingDeleteTransaction",
- "body": "json",
+ "path": "/api/block/getRecentUpdatedBlocks",
+ "handler": "getRecentUpdatedBlocks",
+ "body": "none",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -125362,7 +126258,17 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/BlockTransaction"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/SearchBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -125424,11 +126330,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingFoldTransaction",
- "handler": "getHeadingFoldTransaction",
+ "path": "/api/block/getRefIDs",
+ "handler": "getRefIDs",
"body": "json",
"request": {
- "$ref": "#/$defs/HeadingFoldRequestInput"
+ "$ref": "#/$defs/RefIDsRequestInput"
},
"response": {
"anyOf": [
@@ -125442,14 +126348,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/RefIDsData"
},
"msg": {
"type": "string"
@@ -125506,11 +126405,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingInsertTransaction",
- "handler": "getHeadingInsertTransaction",
+ "path": "/api/block/getRefIDsByFileAnnotationID",
+ "handler": "getRefIDsByFileAnnotationID",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/FileAnnotationRefRequestInput"
},
"response": {
"anyOf": [
@@ -125524,14 +126423,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/RefDefsData"
},
"msg": {
"type": "string"
@@ -125588,11 +126480,11 @@
},
{
"method": "POST",
- "path": "/api/block/getHeadingLevelTransaction",
- "handler": "getHeadingLevelTransaction",
+ "path": "/api/block/getRefText",
+ "handler": "getRefText",
"body": "json",
"request": {
- "$ref": "#/$defs/HeadingLevelRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -125606,14 +126498,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
},
"msg": {
"type": "string"
@@ -125670,11 +126555,11 @@
},
{
"method": "POST",
- "path": "/api/block/getOrderedListContinueStart",
- "handler": "getOrderedListContinueStart",
+ "path": "/api/block/getTailChildBlocks",
+ "handler": "getTailChildBlocks",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/TailChildBlocksRequestInput"
},
"response": {
"anyOf": [
@@ -125688,7 +126573,17 @@
]
},
"data": {
- "$ref": "#/$defs/OrderedListStartData"
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ChildBlock"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
"msg": {
"type": "string"
@@ -125745,11 +126640,11 @@
},
{
"method": "POST",
- "path": "/api/block/getRecentUpdatedBlocks",
- "handler": "getRecentUpdatedBlocks",
- "body": "none",
+ "path": "/api/block/getTreeStat",
+ "handler": "getTreeStat",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/TreeStatRequestInput"
},
"response": {
"anyOf": [
@@ -125763,24 +126658,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/SearchBlock"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/TreeStatData"
},
"msg": {
"type": "string"
@@ -125837,11 +126715,11 @@
},
{
"method": "POST",
- "path": "/api/block/getRefIDs",
- "handler": "getRefIDs",
+ "path": "/api/block/getUnfoldedParentID",
+ "handler": "getUnfoldedParentID",
"body": "json",
"request": {
- "$ref": "#/$defs/RefIDsRequestInput"
+ "$ref": "#/$defs/BlockQueryRequestInput"
},
"response": {
"anyOf": [
@@ -125855,7 +126733,7 @@
]
},
"data": {
- "$ref": "#/$defs/RefIDsData"
+ "$ref": "#/$defs/UnfoldedParentData"
},
"msg": {
"type": "string"
@@ -125912,11 +126790,11 @@
},
{
"method": "POST",
- "path": "/api/block/getRefIDsByFileAnnotationID",
- "handler": "getRefIDsByFileAnnotationID",
+ "path": "/api/block/insertBlock",
+ "handler": "insertBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/FileAnnotationRefRequestInput"
+ "$ref": "#/$defs/InsertBlockRequestInput"
},
"response": {
"anyOf": [
@@ -125929,42 +126807,20 @@
0
]
},
- "data": {
- "$ref": "#/$defs/RefDefsData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
},
{
"type": "null"
@@ -125980,42 +126836,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/block/getRefText",
- "handler": "getRefText",
- "body": "json",
- "request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "type": "string"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -126062,11 +126882,11 @@
},
{
"method": "POST",
- "path": "/api/block/getTailChildBlocks",
- "handler": "getTailChildBlocks",
+ "path": "/api/block/migrateLegacyMindmaps",
+ "handler": "migrateLegacyMindmaps",
"body": "json",
"request": {
- "$ref": "#/$defs/TailChildBlocksRequestInput"
+ "$ref": "#/$defs/MigrateLegacyMindmapsRequestInput"
},
"response": {
"anyOf": [
@@ -126080,17 +126900,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/ChildBlock"
- },
- {
- "type": "null"
- }
- ]
- }
+ "$ref": "#/$defs/MigrateLegacyMindmapsData"
},
"msg": {
"type": "string"
@@ -126147,11 +126957,11 @@
},
{
"method": "POST",
- "path": "/api/block/getTreeStat",
- "handler": "getTreeStat",
+ "path": "/api/block/moveBlock",
+ "handler": "moveBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/TreeStatRequestInput"
+ "$ref": "#/$defs/MoveBlockRequestInput"
},
"response": {
"anyOf": [
@@ -126165,7 +126975,7 @@
]
},
"data": {
- "$ref": "#/$defs/TreeStatData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -126222,11 +127032,11 @@
},
{
"method": "POST",
- "path": "/api/block/getUnfoldedParentID",
- "handler": "getUnfoldedParentID",
+ "path": "/api/block/moveOutlineHeading",
+ "handler": "moveOutlineHeading",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockQueryRequestInput"
+ "$ref": "#/$defs/MoveBlockRequestInput"
},
"response": {
"anyOf": [
@@ -126240,7 +127050,24 @@
]
},
"data": {
- "$ref": "#/$defs/UnfoldedParentData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -126297,11 +127124,11 @@
},
{
"method": "POST",
- "path": "/api/block/insertBlock",
- "handler": "insertBlock",
+ "path": "/api/block/prependBlock",
+ "handler": "prependBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/InsertBlockRequestInput"
+ "$ref": "#/$defs/PrependBlockRequestInput"
},
"response": {
"anyOf": [
@@ -126389,11 +127216,11 @@
},
{
"method": "POST",
- "path": "/api/block/migrateLegacyMindmaps",
- "handler": "migrateLegacyMindmaps",
+ "path": "/api/block/prependDailyNoteBlock",
+ "handler": "prependDailyNoteBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/MigrateLegacyMindmapsRequestInput"
+ "$ref": "#/$defs/DailyNoteBlockRequestInput"
},
"response": {
"anyOf": [
@@ -126407,7 +127234,24 @@
]
},
"data": {
- "$ref": "#/$defs/MigrateLegacyMindmapsData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -126464,11 +127308,11 @@
},
{
"method": "POST",
- "path": "/api/block/moveBlock",
- "handler": "moveBlock",
+ "path": "/api/block/setBlockReminder",
+ "handler": "setBlockReminder",
"body": "json",
"request": {
- "$ref": "#/$defs/MoveBlockRequestInput"
+ "$ref": "#/$defs/BlockReminderRequestInput"
},
"response": {
"anyOf": [
@@ -126539,11 +127383,11 @@
},
{
"method": "POST",
- "path": "/api/block/moveOutlineHeading",
- "handler": "moveOutlineHeading",
+ "path": "/api/block/swapBlockRef",
+ "handler": "swapBlockRef",
"body": "json",
"request": {
- "$ref": "#/$defs/MoveBlockRequestInput"
+ "$ref": "#/$defs/SwapBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -126557,24 +127401,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -126631,11 +127458,11 @@
},
{
"method": "POST",
- "path": "/api/block/prependBlock",
- "handler": "prependBlock",
+ "path": "/api/block/transferBlockRef",
+ "handler": "transferBlockRef",
"body": "json",
"request": {
- "$ref": "#/$defs/PrependBlockRequestInput"
+ "$ref": "#/$defs/TransferBlockRefRequestInput"
},
"response": {
"anyOf": [
@@ -126649,24 +127476,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -126723,11 +127533,11 @@
},
{
"method": "POST",
- "path": "/api/block/prependDailyNoteBlock",
- "handler": "prependDailyNoteBlock",
+ "path": "/api/block/unfoldBlock",
+ "handler": "unfoldBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/DailyNoteBlockRequestInput"
+ "$ref": "#/$defs/BlockIDRequestInput"
},
"response": {
"anyOf": [
@@ -126741,24 +127551,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -126815,11 +127608,11 @@
},
{
"method": "POST",
- "path": "/api/block/setBlockReminder",
- "handler": "setBlockReminder",
+ "path": "/api/block/updateBlock",
+ "handler": "updateBlock",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockReminderRequestInput"
+ "$ref": "#/$defs/UpdateBlockRequestInput"
},
"response": {
"anyOf": [
@@ -126833,7 +127626,24 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -126890,11 +127700,11 @@
},
{
"method": "POST",
- "path": "/api/block/swapBlockRef",
- "handler": "swapBlockRef",
+ "path": "/api/block/updateTaskListItemMarker",
+ "handler": "updateTaskListItemMarker",
"body": "json",
"request": {
- "$ref": "#/$defs/SwapBlockRefRequestInput"
+ "$ref": "#/$defs/TaskListMarkerRequestInput"
},
"response": {
"anyOf": [
@@ -126908,7 +127718,24 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/BlockTransaction"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -126965,11 +127792,11 @@
},
{
"method": "POST",
- "path": "/api/block/transferBlockRef",
- "handler": "transferBlockRef",
- "body": "json",
+ "path": "/api/bookmark/getBookmark",
+ "handler": "getBookmark",
+ "body": "none",
"request": {
- "$ref": "#/$defs/TransferBlockRefRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -126983,7 +127810,24 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/Bookmark"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -127040,11 +127884,11 @@
},
{
"method": "POST",
- "path": "/api/block/unfoldBlock",
- "handler": "unfoldBlock",
+ "path": "/api/bookmark/removeBookmark",
+ "handler": "removeBookmark",
"body": "json",
"request": {
- "$ref": "#/$defs/BlockIDRequestInput"
+ "$ref": "#/$defs/RemoveBookmarkRequestInput"
},
"response": {
"anyOf": [
@@ -127115,11 +127959,11 @@
},
{
"method": "POST",
- "path": "/api/block/updateBlock",
- "handler": "updateBlock",
+ "path": "/api/bookmark/renameBookmark",
+ "handler": "renameBookmark",
"body": "json",
"request": {
- "$ref": "#/$defs/UpdateBlockRequestInput"
+ "$ref": "#/$defs/RenameBookmarkRequestInput"
},
"response": {
"anyOf": [
@@ -127133,24 +127977,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -127207,11 +128034,11 @@
},
{
"method": "POST",
- "path": "/api/block/updateTaskListItemMarker",
- "handler": "updateTaskListItemMarker",
+ "path": "/api/broadcast/getChannelInfo",
+ "handler": "getChannelInfo",
"body": "json",
"request": {
- "$ref": "#/$defs/TaskListMarkerRequestInput"
+ "$ref": "#/$defs/BroadcastChannelRequestInput"
},
"response": {
"anyOf": [
@@ -127225,24 +128052,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/BlockTransaction"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BroadcastChannelData"
},
"msg": {
"type": "string"
@@ -127299,8 +128109,8 @@
},
{
"method": "POST",
- "path": "/api/bookmark/getBookmark",
- "handler": "getBookmark",
+ "path": "/api/broadcast/getChannels",
+ "handler": "getChannels",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -127317,24 +128127,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/Bookmark"
- },
- {
- "type": "null"
- }
- ]
- }
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/BroadcastChannelsData"
},
"msg": {
"type": "string"
@@ -127391,11 +128184,11 @@
},
{
"method": "POST",
- "path": "/api/bookmark/removeBookmark",
- "handler": "removeBookmark",
+ "path": "/api/broadcast/postMessage",
+ "handler": "postMessage",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveBookmarkRequestInput"
+ "$ref": "#/$defs/BroadcastMessageRequestInput"
},
"response": {
"anyOf": [
@@ -127409,7 +128202,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BroadcastChannelData"
},
"msg": {
"type": "string"
@@ -127428,7 +128221,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -127466,11 +128260,25 @@
},
{
"method": "POST",
- "path": "/api/bookmark/renameBookmark",
- "handler": "renameBookmark",
- "body": "json",
+ "path": "/api/broadcast/publish",
+ "handler": "broadcastPublish",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/RenameBookmarkRequestInput"
+ "type": "object",
+ "additionalProperties": {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "format": "binary"
+ }
+ ]
+ }
+ }
},
"response": {
"anyOf": [
@@ -127484,7 +128292,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/BroadcastPublishData"
},
"msg": {
"type": "string"
@@ -127503,7 +128311,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -127541,11 +128350,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/getChannelInfo",
- "handler": "getChannelInfo",
+ "path": "/api/clipboard/cleanupRichText",
+ "handler": "cleanupRichText",
"body": "json",
"request": {
- "$ref": "#/$defs/BroadcastChannelRequestInput"
+ "$ref": "#/$defs/CleanupRichTextRequestInput"
},
"response": {
"anyOf": [
@@ -127559,7 +128368,7 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastChannelData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -127616,11 +128425,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/getChannels",
- "handler": "getChannels",
- "body": "none",
+ "path": "/api/clipboard/prepareRichText",
+ "handler": "prepareRichText",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/PrepareRichTextRequestInput"
},
"response": {
"anyOf": [
@@ -127634,7 +128443,14 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastChannelsData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/RichClipboardPrepared"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -127691,11 +128507,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/postMessage",
- "handler": "postMessage",
- "body": "json",
+ "path": "/api/clipboard/readFilePaths",
+ "handler": "readFilePaths",
+ "body": "none",
"request": {
- "$ref": "#/$defs/BroadcastMessageRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -127709,7 +128525,10 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastChannelData"
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/ClipboardFile"
+ }
},
"msg": {
"type": "string"
@@ -127728,8 +128547,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -127767,25 +128585,11 @@
},
{
"method": "POST",
- "path": "/api/broadcast/publish",
- "handler": "broadcastPublish",
- "body": "multipart",
+ "path": "/api/clipboard/writeFilePath",
+ "handler": "writeFilePath",
+ "body": "json",
"request": {
- "type": "object",
- "additionalProperties": {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "format": "binary"
- }
- ]
- }
- }
+ "$ref": "#/$defs/ClipboardPathRequestInput"
},
"response": {
"anyOf": [
@@ -127799,7 +128603,7 @@
]
},
"data": {
- "$ref": "#/$defs/BroadcastPublishData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -127818,8 +128622,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -127857,11 +128660,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/cleanupRichText",
- "handler": "cleanupRichText",
- "body": "json",
+ "path": "/api/cloud/getCloudSpace",
+ "handler": "getCloudSpace",
+ "body": "none",
"request": {
- "$ref": "#/$defs/CleanupRichTextRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -127875,7 +128678,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/CloudSpaceData"
},
"msg": {
"type": "string"
@@ -127894,7 +128697,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -127932,11 +128736,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/prepareRichText",
- "handler": "prepareRichText",
+ "path": "/api/cloud/setCloudReminder",
+ "handler": "setCloudReminder",
"body": "json",
"request": {
- "$ref": "#/$defs/PrepareRichTextRequestInput"
+ "$ref": "#/$defs/CloudReminderRequestInput"
},
"response": {
"anyOf": [
@@ -127950,14 +128754,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/RichClipboardPrepared"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -128014,11 +128811,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/readFilePaths",
- "handler": "readFilePaths",
- "body": "none",
+ "path": "/api/convert/pandoc",
+ "handler": "pandoc",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/PandocRequestInput"
},
"response": {
"anyOf": [
@@ -128032,10 +128829,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/ClipboardFile"
- }
+ "$ref": "#/$defs/PandocData"
},
"msg": {
"type": "string"
@@ -128092,11 +128886,11 @@
},
{
"method": "POST",
- "path": "/api/clipboard/writeFilePath",
- "handler": "writeFilePath",
+ "path": "/api/export/copyExportFile",
+ "handler": "copyExportFile",
"body": "json",
"request": {
- "$ref": "#/$defs/ClipboardPathRequestInput"
+ "$ref": "#/$defs/CopyExportFileRequestInput"
},
"response": {
"anyOf": [
@@ -128129,7 +128923,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -2
]
},
"data": {
@@ -128167,11 +128962,11 @@
},
{
"method": "POST",
- "path": "/api/cloud/getCloudSpace",
- "handler": "getCloudSpace",
- "body": "none",
+ "path": "/api/export/export2Liandi",
+ "handler": "export2Liandi",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -128185,7 +128980,7 @@
]
},
"data": {
- "$ref": "#/$defs/CloudSpaceData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -128204,8 +128999,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -128243,11 +129037,11 @@
},
{
"method": "POST",
- "path": "/api/cloud/setCloudReminder",
- "handler": "setCloudReminder",
- "body": "json",
+ "path": "/api/export/exportAsFile",
+ "handler": "exportAsFile",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/CloudReminderRequestInput"
+ "$ref": "#/$defs/ExportAsFileRequestInput"
},
"response": {
"anyOf": [
@@ -128261,7 +129055,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ExportFileData"
},
"msg": {
"type": "string"
@@ -128318,11 +129112,11 @@
},
{
"method": "POST",
- "path": "/api/convert/pandoc",
- "handler": "pandoc",
+ "path": "/api/export/exportAsciiDoc",
+ "handler": "exportAsciiDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/PandocRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -128336,7 +129130,7 @@
]
},
"data": {
- "$ref": "#/$defs/PandocData"
+ "$ref": "#/$defs/ExportNamedZipData"
},
"msg": {
"type": "string"
@@ -128393,11 +129187,11 @@
},
{
"method": "POST",
- "path": "/api/export/copyExportFile",
- "handler": "copyExportFile",
+ "path": "/api/export/exportAttributeView",
+ "handler": "exportAttributeView",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyExportFileRequestInput"
+ "$ref": "#/$defs/ExportAttributeViewRequestInput"
},
"response": {
"anyOf": [
@@ -128411,7 +129205,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -128431,7 +129225,7 @@
"type": "integer",
"enum": [
-1,
- -2
+ 1
]
},
"data": {
@@ -128469,11 +129263,11 @@
},
{
"method": "POST",
- "path": "/api/export/export2Liandi",
- "handler": "export2Liandi",
+ "path": "/api/export/exportBrowserHTML",
+ "handler": "exportBrowserHTML",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/ExportBrowserHTMLRequestInput"
},
"response": {
"anyOf": [
@@ -128487,7 +129281,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -128544,11 +129338,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportAsFile",
- "handler": "exportAsFile",
- "body": "multipart",
+ "path": "/api/export/exportCodeBlock",
+ "handler": "exportCodeBlock",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ExportAsFileRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -128562,7 +129356,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportFileData"
+ "$ref": "#/$defs/ExportPathData"
},
"msg": {
"type": "string"
@@ -128581,7 +129375,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -128619,11 +129414,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportAsciiDoc",
- "handler": "exportAsciiDoc",
- "body": "json",
+ "path": "/api/export/exportData",
+ "handler": "exportData",
+ "body": "none",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -128637,7 +129432,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportNamedZipData"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -128656,7 +129451,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -128694,11 +129490,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportAttributeView",
- "handler": "exportAttributeView",
+ "path": "/api/export/exportDataInFolder",
+ "handler": "exportDataInFolder",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportAttributeViewRequestInput"
+ "$ref": "#/$defs/ExportFolderRequestInput"
},
"response": {
"anyOf": [
@@ -128712,7 +129508,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "$ref": "#/$defs/ExportNameData"
},
"msg": {
"type": "string"
@@ -128731,8 +129527,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -128770,11 +129565,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportBrowserHTML",
- "handler": "exportBrowserHTML",
+ "path": "/api/export/exportDocx",
+ "handler": "exportDocx",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportBrowserHTMLRequestInput"
+ "$ref": "#/$defs/ExportDocxRequestInput"
},
"response": {
"anyOf": [
@@ -128788,7 +129583,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "$ref": "#/$defs/ExportPathData"
},
"msg": {
"type": "string"
@@ -128807,7 +129602,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -128845,8 +129641,8 @@
},
{
"method": "POST",
- "path": "/api/export/exportCodeBlock",
- "handler": "exportCodeBlock",
+ "path": "/api/export/exportEPUB",
+ "handler": "exportEPUB",
"body": "json",
"request": {
"$ref": "#/$defs/ExportIDRequestInput"
@@ -128863,7 +129659,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportPathData"
+ "$ref": "#/$defs/ExportNamedZipData"
},
"msg": {
"type": "string"
@@ -128882,8 +129678,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -128921,11 +129716,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportData",
- "handler": "exportData",
- "body": "none",
+ "path": "/api/export/exportHTML",
+ "handler": "exportHTML",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ExportHTMLRequestInput"
},
"response": {
"anyOf": [
@@ -128939,7 +129734,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "$ref": "#/$defs/ExportHTMLData"
},
"msg": {
"type": "string"
@@ -128958,8 +129753,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -128997,11 +129791,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportDataInFolder",
- "handler": "exportDataInFolder",
+ "path": "/api/export/exportMd",
+ "handler": "exportMd",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportFolderRequestInput"
+ "$ref": "#/$defs/ExportMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -129015,7 +129809,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportNameData"
+ "$ref": "#/$defs/ExportNamedZipData"
},
"msg": {
"type": "string"
@@ -129072,11 +129866,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportDocx",
- "handler": "exportDocx",
+ "path": "/api/export/exportMdContent",
+ "handler": "exportMdContent",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportDocxRequestInput"
+ "$ref": "#/$defs/ExportMarkdownContentRequestInput"
},
"response": {
"anyOf": [
@@ -129090,7 +129884,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportPathData"
+ "$ref": "#/$defs/ExportMarkdownContentData"
},
"msg": {
"type": "string"
@@ -129109,8 +129903,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -129148,11 +129941,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportEPUB",
- "handler": "exportEPUB",
+ "path": "/api/export/exportMdHTML",
+ "handler": "exportMdHTML",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/ExportMarkdownHTMLRequestInput"
},
"response": {
"anyOf": [
@@ -129166,7 +129959,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportNamedZipData"
+ "$ref": "#/$defs/ExportHTMLData"
},
"msg": {
"type": "string"
@@ -129223,11 +130016,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportHTML",
- "handler": "exportHTML",
+ "path": "/api/export/exportMds",
+ "handler": "exportMds",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportHTMLRequestInput"
+ "$ref": "#/$defs/ExportDocumentsMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -129241,7 +130034,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportHTMLData"
+ "$ref": "#/$defs/ExportNamedZipData"
},
"msg": {
"type": "string"
@@ -129298,11 +130091,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportMd",
- "handler": "exportMd",
+ "path": "/api/export/exportMediaWiki",
+ "handler": "exportMediaWiki",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportMarkdownRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -129373,11 +130166,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportMdContent",
- "handler": "exportMdContent",
+ "path": "/api/export/exportNotebookMd",
+ "handler": "exportNotebookMd",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportMarkdownContentRequestInput"
+ "$ref": "#/$defs/ExportNotebookMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -129391,7 +130184,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportMarkdownContentData"
+ "$ref": "#/$defs/ExportNamedZipData"
},
"msg": {
"type": "string"
@@ -129448,11 +130241,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportMdHTML",
- "handler": "exportMdHTML",
+ "path": "/api/export/exportNotebookSY",
+ "handler": "exportNotebookSY",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportMarkdownHTMLRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -129466,7 +130259,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportHTMLData"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -129523,11 +130316,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportMds",
- "handler": "exportMds",
+ "path": "/api/export/exportNotebooksMd",
+ "handler": "exportNotebooksMd",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportDocumentsMarkdownRequestInput"
+ "$ref": "#/$defs/ExportNotebooksMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -129598,11 +130391,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportMediaWiki",
- "handler": "exportMediaWiki",
+ "path": "/api/export/exportNotebooksSY",
+ "handler": "exportNotebooksSY",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/ExportNotebooksRequestInput"
},
"response": {
"anyOf": [
@@ -129616,7 +130409,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportNamedZipData"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -129673,11 +130466,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportNotebookMd",
- "handler": "exportNotebookMd",
+ "path": "/api/export/exportODT",
+ "handler": "exportODT",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportNotebookMarkdownRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -129748,8 +130541,8 @@
},
{
"method": "POST",
- "path": "/api/export/exportNotebookSY",
- "handler": "exportNotebookSY",
+ "path": "/api/export/exportOPML",
+ "handler": "exportOPML",
"body": "json",
"request": {
"$ref": "#/$defs/ExportIDRequestInput"
@@ -129766,7 +130559,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "$ref": "#/$defs/ExportNamedZipData"
},
"msg": {
"type": "string"
@@ -129823,11 +130616,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportNotebooksMd",
- "handler": "exportNotebooksMd",
+ "path": "/api/export/exportOrgMode",
+ "handler": "exportOrgMode",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportNotebooksMarkdownRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -129898,11 +130691,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportNotebooksSY",
- "handler": "exportNotebooksSY",
+ "path": "/api/export/exportPreviewHTML",
+ "handler": "exportPreviewHTML",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportNotebooksRequestInput"
+ "$ref": "#/$defs/ExportPreviewHTMLRequestInput"
},
"response": {
"anyOf": [
@@ -129916,7 +130709,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "$ref": "#/$defs/ExportPreviewHTMLData"
},
"msg": {
"type": "string"
@@ -129973,8 +130766,8 @@
},
{
"method": "POST",
- "path": "/api/export/exportODT",
- "handler": "exportODT",
+ "path": "/api/export/exportRTF",
+ "handler": "exportRTF",
"body": "json",
"request": {
"$ref": "#/$defs/ExportIDRequestInput"
@@ -130048,8 +130841,8 @@
},
{
"method": "POST",
- "path": "/api/export/exportOPML",
- "handler": "exportOPML",
+ "path": "/api/export/exportReStructuredText",
+ "handler": "exportReStructuredText",
"body": "json",
"request": {
"$ref": "#/$defs/ExportIDRequestInput"
@@ -130123,8 +130916,87 @@
},
{
"method": "POST",
- "path": "/api/export/exportOrgMode",
- "handler": "exportOrgMode",
+ "path": "/api/export/exportResources",
+ "handler": "exportResources",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/ExportResourcesRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/ExportPathData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1,
+ 1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ },
+ {
+ "type": "string"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/export/exportSY",
+ "handler": "exportSY",
"body": "json",
"request": {
"$ref": "#/$defs/ExportIDRequestInput"
@@ -130141,7 +131013,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportNamedZipData"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -130198,11 +131070,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportPreviewHTML",
- "handler": "exportPreviewHTML",
+ "path": "/api/export/exportSYs",
+ "handler": "exportSYs",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportPreviewHTMLRequestInput"
+ "$ref": "#/$defs/ExportIDsRequestInput"
},
"response": {
"anyOf": [
@@ -130216,7 +131088,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportPreviewHTMLData"
+ "$ref": "#/$defs/ExportZipData"
},
"msg": {
"type": "string"
@@ -130273,11 +131145,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportRTF",
- "handler": "exportRTF",
+ "path": "/api/export/exportTempContent",
+ "handler": "exportTempContent",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/ExportTempContentRequestInput"
},
"response": {
"anyOf": [
@@ -130291,7 +131163,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportNamedZipData"
+ "$ref": "#/$defs/ExportURLData"
},
"msg": {
"type": "string"
@@ -130310,7 +131182,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -130348,8 +131221,8 @@
},
{
"method": "POST",
- "path": "/api/export/exportReStructuredText",
- "handler": "exportReStructuredText",
+ "path": "/api/export/exportTextile",
+ "handler": "exportTextile",
"body": "json",
"request": {
"$ref": "#/$defs/ExportIDRequestInput"
@@ -130423,11 +131296,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportResources",
- "handler": "exportResources",
+ "path": "/api/export/preview",
+ "handler": "exportPreview",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportResourcesRequestInput"
+ "$ref": "#/$defs/ExportIDRequestInput"
},
"response": {
"anyOf": [
@@ -130441,7 +131314,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportPathData"
+ "$ref": "#/$defs/ExportPreviewData"
},
"msg": {
"type": "string"
@@ -130460,8 +131333,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -130480,9 +131352,6 @@
},
{
"type": "null"
- },
- {
- "type": "string"
}
]
},
@@ -130502,11 +131371,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportSY",
- "handler": "exportSY",
+ "path": "/api/export/processPDF",
+ "handler": "processPDF",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/ProcessPDFRequestInput"
},
"response": {
"anyOf": [
@@ -130520,7 +131389,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -130577,11 +131446,60 @@
},
{
"method": "POST",
- "path": "/api/export/exportSYs",
- "handler": "exportSYs",
- "body": "json",
+ "path": "/api/extension/copy",
+ "handler": "extensionCopy",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/ExportIDsRequestInput"
+ "type": "object",
+ "properties": {
+ "assets": {
+ "type": "string"
+ },
+ "clipType": {
+ "type": "string"
+ },
+ "dom": {
+ "type": "string"
+ },
+ "href": {
+ "type": "string"
+ },
+ "notebook": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "dom"
+ ],
+ "additionalProperties": {
+ "anyOf": [
+ {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "format": "binary"
+ }
+ ]
+ },
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "string",
+ "format": "binary"
+ }
+ ]
+ }
+ }
+ ]
+ }
},
"response": {
"anyOf": [
@@ -130595,7 +131513,14 @@
]
},
"data": {
- "$ref": "#/$defs/ExportZipData"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ExtensionCopyData"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -130633,6 +131558,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ExtensionCopyData"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -130652,11 +131587,11 @@
},
{
"method": "POST",
- "path": "/api/export/exportTempContent",
- "handler": "exportTempContent",
+ "path": "/api/file/copyFile",
+ "handler": "copyFile",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportTempContentRequestInput"
+ "$ref": "#/$defs/CopyFileRequestInput"
},
"response": {
"anyOf": [
@@ -130670,7 +131605,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportURLData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -130690,7 +131625,7 @@
"type": "integer",
"enum": [
-1,
- 1
+ -2
]
},
"data": {
@@ -130728,36 +131663,17 @@
},
{
"method": "POST",
- "path": "/api/export/exportTextile",
- "handler": "exportTextile",
+ "path": "/api/file/getFile",
+ "handler": "getFile",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/FilePathRequestInput"
},
"response": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/ExportNamedZipData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
+ "type": "string",
+ "format": "binary"
},
{
"type": "object",
@@ -130765,7 +131681,13 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 403,
+ 404,
+ 409,
+ 500,
+ 503
]
},
"data": {
@@ -130799,15 +131721,17 @@
"additionalProperties": true
}
]
- }
+ },
+ "output": "binary",
+ "errorStatus": 202
},
{
"method": "POST",
- "path": "/api/export/preview",
- "handler": "exportPreview",
+ "path": "/api/file/getUniqueFilename",
+ "handler": "getUniqueFilename",
"body": "json",
"request": {
- "$ref": "#/$defs/ExportIDRequestInput"
+ "$ref": "#/$defs/FilePathRequestInput"
},
"response": {
"anyOf": [
@@ -130821,7 +131745,7 @@
]
},
"data": {
- "$ref": "#/$defs/ExportPreviewData"
+ "$ref": "#/$defs/FilePathData"
},
"msg": {
"type": "string"
@@ -130840,7 +131764,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3
]
},
"data": {
@@ -130878,11 +131803,11 @@
},
{
"method": "POST",
- "path": "/api/export/processPDF",
- "handler": "processPDF",
+ "path": "/api/file/globalCopyFiles",
+ "handler": "globalCopyFiles",
"body": "json",
"request": {
- "$ref": "#/$defs/ProcessPDFRequestInput"
+ "$ref": "#/$defs/CopyFilesRequestInput"
},
"response": {
"anyOf": [
@@ -130915,7 +131840,10 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -2,
+ -3,
+ 403
]
},
"data": {
@@ -130953,60 +131881,11 @@
},
{
"method": "POST",
- "path": "/api/extension/copy",
- "handler": "extensionCopy",
- "body": "multipart",
+ "path": "/api/file/putFile",
+ "handler": "putFile",
+ "body": "form",
"request": {
- "type": "object",
- "properties": {
- "assets": {
- "type": "string"
- },
- "clipType": {
- "type": "string"
- },
- "dom": {
- "type": "string"
- },
- "href": {
- "type": "string"
- },
- "notebook": {
- "type": "string"
- }
- },
- "required": [
- "dom"
- ],
- "additionalProperties": {
- "anyOf": [
- {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "format": "binary"
- }
- ]
- },
- {
- "type": "array",
- "items": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "string",
- "format": "binary"
- }
- ]
- }
- }
- ]
- }
+ "$ref": "#/$defs/PutFileRequestInput"
},
"response": {
"anyOf": [
@@ -131020,14 +131899,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ExtensionCopyData"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -131046,7 +131918,11 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ -3,
+ 400,
+ 403,
+ 500
]
},
"data": {
@@ -131065,16 +131941,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/ExtensionCopyData"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -131094,11 +131960,11 @@
},
{
"method": "POST",
- "path": "/api/file/copyFile",
- "handler": "copyFile",
+ "path": "/api/file/readDir",
+ "handler": "readDir",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyFileRequestInput"
+ "$ref": "#/$defs/ReadDirectoryRequestInput"
},
"response": {
"anyOf": [
@@ -131112,7 +131978,10 @@
]
},
"data": {
- "type": "null"
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/DirectoryEntry"
+ }
},
"msg": {
"type": "string"
@@ -131125,63 +131994,6 @@
],
"additionalProperties": false
},
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1,
- -2
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/file/getFile",
- "handler": "getFile",
- "body": "json",
- "request": {
- "$ref": "#/$defs/FilePathRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "string",
- "format": "binary"
- },
{
"type": "object",
"properties": {
@@ -131193,8 +132005,7 @@
403,
404,
409,
- 500,
- 503
+ 500
]
},
"data": {
@@ -131228,17 +132039,15 @@
"additionalProperties": true
}
]
- },
- "output": "binary",
- "errorStatus": 202
+ }
},
{
"method": "POST",
- "path": "/api/file/getUniqueFilename",
- "handler": "getUniqueFilename",
+ "path": "/api/file/removeFile",
+ "handler": "removeFile",
"body": "json",
"request": {
- "$ref": "#/$defs/FilePathRequestInput"
+ "$ref": "#/$defs/RemoveFileRequestInput"
},
"response": {
"anyOf": [
@@ -131252,7 +132061,7 @@
]
},
"data": {
- "$ref": "#/$defs/FilePathData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -131272,7 +132081,10 @@
"type": "integer",
"enum": [
-1,
- -3
+ -3,
+ 403,
+ 404,
+ 500
]
},
"data": {
@@ -131310,11 +132122,11 @@
},
{
"method": "POST",
- "path": "/api/file/globalCopyFiles",
- "handler": "globalCopyFiles",
+ "path": "/api/file/renameFile",
+ "handler": "renameFile",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyFilesRequestInput"
+ "$ref": "#/$defs/RenameFileRequestInput"
},
"response": {
"anyOf": [
@@ -131348,9 +132160,11 @@
"type": "integer",
"enum": [
-1,
- -2,
-3,
- 403
+ 403,
+ 404,
+ 409,
+ 500
]
},
"data": {
@@ -131388,11 +132202,11 @@
},
{
"method": "POST",
- "path": "/api/file/putFile",
- "handler": "putFile",
- "body": "form",
+ "path": "/api/file/workspaceCopyFiles",
+ "handler": "workspaceCopyFiles",
+ "body": "json",
"request": {
- "$ref": "#/$defs/PutFileRequestInput"
+ "$ref": "#/$defs/CopyFilesRequestInput"
},
"response": {
"anyOf": [
@@ -131426,10 +132240,9 @@
"type": "integer",
"enum": [
-1,
+ -2,
-3,
- 400,
- 403,
- 500
+ 403
]
},
"data": {
@@ -131467,11 +132280,11 @@
},
{
"method": "POST",
- "path": "/api/file/readDir",
- "handler": "readDir",
+ "path": "/api/filetree/authFilePublishAccess",
+ "handler": "authFilePublishAccess",
"body": "json",
"request": {
- "$ref": "#/$defs/ReadDirectoryRequestInput"
+ "$ref": "#/$defs/FileTreeAuthPublishRequestInput"
},
"response": {
"anyOf": [
@@ -131485,10 +132298,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/DirectoryEntry"
- }
+ "type": "null"
},
"msg": {
"type": "string"
@@ -131507,12 +132317,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3,
- 403,
- 404,
- 409,
- 500
+ -1
]
},
"data": {
@@ -131546,15 +132351,18 @@
"additionalProperties": true
}
]
- }
+ },
+ "additionalErrorStatuses": [
+ 429
+ ]
},
{
"method": "POST",
- "path": "/api/file/removeFile",
- "handler": "removeFile",
+ "path": "/api/filetree/changeSort",
+ "handler": "changeSort",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveFileRequestInput"
+ "$ref": "#/$defs/FileTreeChangeSortRequestInput"
},
"response": {
"anyOf": [
@@ -131587,11 +132395,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -3,
- 403,
- 404,
- 500
+ -1
]
},
"data": {
@@ -131629,11 +132433,11 @@
},
{
"method": "POST",
- "path": "/api/file/renameFile",
- "handler": "renameFile",
+ "path": "/api/filetree/createDailyNote",
+ "handler": "createDailyNote",
"body": "json",
"request": {
- "$ref": "#/$defs/RenameFileRequestInput"
+ "$ref": "#/$defs/FileTreeDailyNoteRequestInput"
},
"response": {
"anyOf": [
@@ -131647,7 +132451,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/FileTreeCreateData"
},
"msg": {
"type": "string"
@@ -131667,11 +132471,7 @@
"type": "integer",
"enum": [
-1,
- -3,
- 403,
- 404,
- 409,
- 500
+ 1
]
},
"data": {
@@ -131709,11 +132509,11 @@
},
{
"method": "POST",
- "path": "/api/file/workspaceCopyFiles",
- "handler": "workspaceCopyFiles",
+ "path": "/api/filetree/createDoc",
+ "handler": "createDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyFilesRequestInput"
+ "$ref": "#/$defs/FileTreeCreateRequestInput"
},
"response": {
"anyOf": [
@@ -131727,7 +132527,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/FileTreeCreateData"
},
"msg": {
"type": "string"
@@ -131746,10 +132546,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- -2,
- -3,
- 403
+ -1
]
},
"data": {
@@ -131787,11 +132584,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/authFilePublishAccess",
- "handler": "authFilePublishAccess",
+ "path": "/api/filetree/createDocWithMd",
+ "handler": "createDocWithMd",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeAuthPublishRequestInput"
+ "$ref": "#/$defs/FileTreeCreateMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -131805,7 +132602,7 @@
]
},
"data": {
- "type": "null"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -131858,18 +132655,15 @@
"additionalProperties": true
}
]
- },
- "additionalErrorStatuses": [
- 429
- ]
+ }
},
{
"method": "POST",
- "path": "/api/filetree/changeSort",
- "handler": "changeSort",
+ "path": "/api/filetree/doc2Heading",
+ "handler": "doc2Heading",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeChangeSortRequestInput"
+ "$ref": "#/$defs/FileTreeDocHeadingRequestInput"
},
"response": {
"anyOf": [
@@ -131883,7 +132677,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/FileTreeDocHeadingData"
},
"msg": {
"type": "string"
@@ -131940,11 +132734,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/createDailyNote",
- "handler": "createDailyNote",
+ "path": "/api/filetree/duplicateDoc",
+ "handler": "duplicateDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeDailyNoteRequestInput"
+ "$ref": "#/$defs/FileTreeIDRequestInput"
},
"response": {
"anyOf": [
@@ -131958,7 +132752,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeCreateData"
+ "$ref": "#/$defs/FileTreeDuplicateData"
},
"msg": {
"type": "string"
@@ -131977,8 +132771,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -132016,11 +132809,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/createDoc",
- "handler": "createDoc",
+ "path": "/api/filetree/duplicateDocTree",
+ "handler": "duplicateDocTree",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeCreateRequestInput"
+ "$ref": "#/$defs/FileTreeIDRequestInput"
},
"response": {
"anyOf": [
@@ -132034,7 +132827,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeCreateData"
+ "$ref": "#/$defs/FileTreeDuplicateData"
},
"msg": {
"type": "string"
@@ -132091,11 +132884,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/createDocWithMd",
- "handler": "createDocWithMd",
+ "path": "/api/filetree/getDoc",
+ "handler": "getDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeCreateMarkdownRequestInput"
+ "$ref": "#/$defs/FileTreeGetDocRequestInput"
},
"response": {
"anyOf": [
@@ -132109,7 +132902,7 @@
]
},
"data": {
- "type": "string"
+ "$ref": "#/$defs/FileTreeGetDocData"
},
"msg": {
"type": "string"
@@ -132128,7 +132921,9 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1,
+ 3
]
},
"data": {
@@ -132166,11 +132961,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/doc2Heading",
- "handler": "doc2Heading",
+ "path": "/api/filetree/getDocCreateSavePath",
+ "handler": "getDocCreateSavePath",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeDocHeadingRequestInput"
+ "$ref": "#/$defs/FileTreeNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -132184,7 +132979,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeDocHeadingData"
+ "$ref": "#/$defs/FileTreeCreateSavePathData"
},
"msg": {
"type": "string"
@@ -132241,11 +133036,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/duplicateDoc",
- "handler": "duplicateDoc",
+ "path": "/api/filetree/getFullHPathByID",
+ "handler": "getFullHPathByID",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeIDRequestInput"
+ "$ref": "#/$defs/FileTreeOptionalIDRequestInput"
},
"response": {
"anyOf": [
@@ -132259,7 +133054,14 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeDuplicateData"
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -132316,8 +133118,8 @@
},
{
"method": "POST",
- "path": "/api/filetree/duplicateDocTree",
- "handler": "duplicateDocTree",
+ "path": "/api/filetree/getHPathByID",
+ "handler": "getHPathByID",
"body": "json",
"request": {
"$ref": "#/$defs/FileTreeIDRequestInput"
@@ -132334,7 +133136,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeDuplicateData"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -132391,11 +133193,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getDoc",
- "handler": "getDoc",
+ "path": "/api/filetree/getHPathByPath",
+ "handler": "getHPathByPath",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeGetDocRequestInput"
+ "$ref": "#/$defs/FileTreePathRequestInput"
},
"response": {
"anyOf": [
@@ -132409,7 +133211,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeGetDocData"
+ "type": "string"
},
"msg": {
"type": "string"
@@ -132428,9 +133230,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1,
- 3
+ -1
]
},
"data": {
@@ -132468,11 +133268,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getDocCreateSavePath",
- "handler": "getDocCreateSavePath",
+ "path": "/api/filetree/getHPathsByPaths",
+ "handler": "getHPathsByPaths",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeNotebookRequestInput"
+ "$ref": "#/$defs/FileTreePathsRequestInput"
},
"response": {
"anyOf": [
@@ -132486,7 +133286,17 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeCreateSavePathData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -132543,11 +133353,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getFullHPathByID",
- "handler": "getFullHPathByID",
+ "path": "/api/filetree/getIDsByHPath",
+ "handler": "getIDsByHPath",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeOptionalIDRequestInput"
+ "$ref": "#/$defs/FileTreeOptionalPathRequestInput"
},
"response": {
"anyOf": [
@@ -132563,7 +133373,10 @@
"data": {
"anyOf": [
{
- "type": "string"
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
},
{
"type": "null"
@@ -132625,11 +133438,86 @@
},
{
"method": "POST",
- "path": "/api/filetree/getHPathByID",
- "handler": "getHPathByID",
- "body": "json",
+ "path": "/api/filetree/getPathByID",
+ "handler": "getPathByID",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/FileTreeTrimIDRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/FileTreeDocPathData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/filetree/getPinnedDocs",
+ "handler": "getPinnedDocs",
+ "body": "none",
"request": {
- "$ref": "#/$defs/FileTreeIDRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -132643,7 +133531,10 @@
]
},
"data": {
- "type": "string"
+ "type": "array",
+ "items": {
+ "$ref": "#/$defs/PinnedDoc"
+ }
},
"msg": {
"type": "string"
@@ -132700,11 +133591,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getHPathByPath",
- "handler": "getHPathByPath",
+ "path": "/api/filetree/getPublishAccess",
+ "handler": "getPublishAccess",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreePathRequestInput"
+ "$ref": "#/$defs/FileTreePublishIDsRequestInput"
},
"response": {
"anyOf": [
@@ -132718,7 +133609,7 @@
]
},
"data": {
- "type": "string"
+ "$ref": "#/$defs/FileTreePublishData"
},
"msg": {
"type": "string"
@@ -132775,11 +133666,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getHPathsByPaths",
- "handler": "getHPathsByPaths",
+ "path": "/api/filetree/getRefCreateSavePath",
+ "handler": "getRefCreateSavePath",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreePathsRequestInput"
+ "$ref": "#/$defs/FileTreeNotebookRequestInput"
},
"response": {
"anyOf": [
@@ -132792,13 +133683,42 @@
0
]
},
+ "data": {
+ "$ref": "#/$defs/FileTreeSavePathData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -132814,6 +133734,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/filetree/getShorthandSavePath",
+ "handler": "getShorthandSavePath",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/FileTreeNotebookRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "$ref": "#/$defs/FileTreeSavePathData"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -132860,11 +133816,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getIDsByHPath",
- "handler": "getIDsByHPath",
+ "path": "/api/filetree/heading2Doc",
+ "handler": "heading2Doc",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeOptionalPathRequestInput"
+ "$ref": "#/$defs/FileTreeHeadingDocRequestInput"
},
"response": {
"anyOf": [
@@ -132877,13 +133833,42 @@
0
]
},
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -132899,6 +133884,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/filetree/li2Doc",
+ "handler": "li2Doc",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/FileTreeListItemDocRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -132945,11 +133966,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getPathByID",
- "handler": "getPathByID",
+ "path": "/api/filetree/listDocTree",
+ "handler": "listDocTree",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeTrimIDRequestInput"
+ "$ref": "#/$defs/FileTreePathRequestInput"
},
"response": {
"anyOf": [
@@ -132963,7 +133984,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeDocPathData"
+ "$ref": "#/$defs/FileTreeDocTreeData"
},
"msg": {
"type": "string"
@@ -133020,11 +134041,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getPinnedDocs",
- "handler": "getPinnedDocs",
- "body": "none",
+ "path": "/api/filetree/listDocsByPath",
+ "handler": "listDocsByPath",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/FileTreeListRequestInput"
},
"response": {
"anyOf": [
@@ -133038,10 +134059,7 @@
]
},
"data": {
- "type": "array",
- "items": {
- "$ref": "#/$defs/PinnedDoc"
- }
+ "$ref": "#/$defs/FileTreeListData"
},
"msg": {
"type": "string"
@@ -133098,11 +134116,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getPublishAccess",
- "handler": "getPublishAccess",
+ "path": "/api/filetree/moveDocs",
+ "handler": "moveDocs",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreePublishIDsRequestInput"
+ "$ref": "#/$defs/FileTreeMoveRequestInput"
},
"response": {
"anyOf": [
@@ -133116,7 +134134,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreePublishData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -133173,11 +134191,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/getRefCreateSavePath",
- "handler": "getRefCreateSavePath",
+ "path": "/api/filetree/moveDocsByID",
+ "handler": "moveDocsByID",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeNotebookRequestInput"
+ "$ref": "#/$defs/FileTreeMoveIDsRequestInput"
},
"response": {
"anyOf": [
@@ -133191,7 +134209,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeSavePathData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -133248,8 +134266,8 @@
},
{
"method": "POST",
- "path": "/api/filetree/getShorthandSavePath",
- "handler": "getShorthandSavePath",
+ "path": "/api/filetree/moveLocalShorthands",
+ "handler": "moveLocalShorthands",
"body": "json",
"request": {
"$ref": "#/$defs/FileTreeNotebookRequestInput"
@@ -133266,7 +134284,17 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeSavePathData"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -133323,11 +134351,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/heading2Doc",
- "handler": "heading2Doc",
+ "path": "/api/filetree/removeDoc",
+ "handler": "removeDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeHeadingDocRequestInput"
+ "$ref": "#/$defs/FileTreePathRequestInput"
},
"response": {
"anyOf": [
@@ -133398,11 +134426,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/li2Doc",
- "handler": "li2Doc",
+ "path": "/api/filetree/removeDocByID",
+ "handler": "removeDocByID",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeListItemDocRequestInput"
+ "$ref": "#/$defs/FileTreeTrimIDRequestInput"
},
"response": {
"anyOf": [
@@ -133473,11 +134501,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/listDocTree",
- "handler": "listDocTree",
+ "path": "/api/filetree/removeDocs",
+ "handler": "removeDocs",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreePathRequestInput"
+ "$ref": "#/$defs/FileTreePathsRequestInput"
},
"response": {
"anyOf": [
@@ -133491,7 +134519,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeDocTreeData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -133548,11 +134576,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/listDocsByPath",
- "handler": "listDocsByPath",
+ "path": "/api/filetree/removeIndexes",
+ "handler": "removeIndexes",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeListRequestInput"
+ "$ref": "#/$defs/FileTreePathsRequestInput"
},
"response": {
"anyOf": [
@@ -133566,7 +134594,7 @@
]
},
"data": {
- "$ref": "#/$defs/FileTreeListData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -133623,11 +134651,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/moveDocs",
- "handler": "moveDocs",
+ "path": "/api/filetree/renameDoc",
+ "handler": "renameDoc",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeMoveRequestInput"
+ "$ref": "#/$defs/FileTreeRenameRequestInput"
},
"response": {
"anyOf": [
@@ -133698,11 +134726,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/moveDocsByID",
- "handler": "moveDocsByID",
+ "path": "/api/filetree/renameDocByID",
+ "handler": "renameDocByID",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeMoveIDsRequestInput"
+ "$ref": "#/$defs/FileTreeRenameIDRequestInput"
},
"response": {
"anyOf": [
@@ -133773,11 +134801,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/moveLocalShorthands",
- "handler": "moveLocalShorthands",
- "body": "json",
+ "path": "/api/filetree/reorderDocs",
+ "handler": "reorderDocs",
+ "body": "structJSON",
"request": {
- "$ref": "#/$defs/FileTreeNotebookRequestInput"
+ "$ref": "#/$defs/FileTreeReorderRequestInput"
},
"response": {
"anyOf": [
@@ -133793,10 +134821,7 @@
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "type": "string"
- }
+ "$ref": "#/$defs/FileTreeReorderData"
},
{
"type": "null"
@@ -133839,6 +134864,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FileTreeReorderData"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -133858,11 +134893,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/removeDoc",
- "handler": "removeDoc",
+ "path": "/api/filetree/searchDocs",
+ "handler": "searchDocs",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreePathRequestInput"
+ "$ref": "#/$defs/FileTreeSearchRequestInput"
},
"response": {
"anyOf": [
@@ -133876,7 +134911,24 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "type": "array",
+ "items": {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FileTreeSearchDoc"
+ },
+ {
+ "type": "null"
+ }
+ ]
+ }
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -133933,11 +134985,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/removeDocByID",
- "handler": "removeDocByID",
- "body": "json",
+ "path": "/api/filetree/setDocSortMode",
+ "handler": "setDocSortMode",
+ "body": "structJSON",
"request": {
- "$ref": "#/$defs/FileTreeTrimIDRequestInput"
+ "$ref": "#/$defs/FileTreeSortModeRequestInput"
},
"response": {
"anyOf": [
@@ -133951,7 +135003,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FileTreeSortModeData"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -133989,6 +135048,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FileTreeSortModeData"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -134008,11 +135077,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/removeDocs",
- "handler": "removeDocs",
+ "path": "/api/filetree/setPublishAccess",
+ "handler": "setPublishAccess",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreePathsRequestInput"
+ "$ref": "#/$defs/FileTreeSetPublishRequestInput"
},
"response": {
"anyOf": [
@@ -134083,11 +135152,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/removeIndexes",
- "handler": "removeIndexes",
- "body": "json",
+ "path": "/api/filetree/setSort",
+ "handler": "setSort",
+ "body": "structJSON",
"request": {
- "$ref": "#/$defs/FileTreePathsRequestInput"
+ "$ref": "#/$defs/FileTreeSetSortRequestInput"
},
"response": {
"anyOf": [
@@ -134101,7 +135170,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FileTreeSetSortData"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -134139,6 +135215,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/FileTreeSetSortData"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -134158,11 +135244,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/renameDoc",
- "handler": "renameDoc",
+ "path": "/api/filetree/updatePinnedDocs",
+ "handler": "updatePinnedDocs",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeRenameRequestInput"
+ "$ref": "#/$defs/UpdatePinnedDocsRequestInput"
},
"response": {
"anyOf": [
@@ -134233,11 +135319,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/renameDocByID",
- "handler": "renameDocByID",
+ "path": "/api/filetree/upsertIndexes",
+ "handler": "upsertIndexes",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeRenameIDRequestInput"
+ "$ref": "#/$defs/FileTreePathsRequestInput"
},
"response": {
"anyOf": [
@@ -134308,11 +135394,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/reorderDocs",
- "handler": "reorderDocs",
- "body": "structJSON",
+ "path": "/api/format/autoSpace",
+ "handler": "autoSpace",
+ "body": "json",
"request": {
- "$ref": "#/$defs/FileTreeReorderRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -134326,14 +135412,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/FileTreeReorderData"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -134371,16 +135450,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/FileTreeReorderData"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -134400,11 +135469,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/searchDocs",
- "handler": "searchDocs",
+ "path": "/api/format/netAssets2LocalAssets",
+ "handler": "netAssets2LocalAssets",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeSearchRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -134417,20 +135486,42 @@
0
]
},
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
"data": {
"anyOf": [
{
- "type": "array",
- "items": {
- "anyOf": [
- {
- "$ref": "#/$defs/FileTreeSearchDoc"
- },
- {
- "type": "null"
- }
- ]
- }
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
},
{
"type": "null"
@@ -134446,6 +135537,42 @@
"msg",
"data"
],
+ "additionalProperties": true
+ }
+ ]
+ }
+ },
+ {
+ "method": "POST",
+ "path": "/api/format/netImg2LocalAssets",
+ "handler": "netImg2LocalAssets",
+ "body": "json",
+ "request": {
+ "$ref": "#/$defs/NetImageAssetsRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ 0
+ ]
+ },
+ "data": {
+ "type": "null"
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
"additionalProperties": false
},
{
@@ -134492,11 +135619,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/setDocSortMode",
- "handler": "setDocSortMode",
- "body": "structJSON",
+ "path": "/api/graph/getGraph",
+ "handler": "getGraph",
+ "body": "json",
"request": {
- "$ref": "#/$defs/FileTreeSortModeRequestInput"
+ "$ref": "#/$defs/GlobalGraphRequestInput"
},
"response": {
"anyOf": [
@@ -134512,10 +135639,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/FileTreeSortModeData"
+ "$ref": "#/$defs/GlobalGraphResult"
},
{
- "type": "null"
+ "$ref": "#/$defs/GraphCorrelation"
}
]
},
@@ -134559,10 +135686,10 @@
{
"anyOf": [
{
- "$ref": "#/$defs/FileTreeSortModeData"
+ "$ref": "#/$defs/GlobalGraphResult"
},
{
- "type": "null"
+ "$ref": "#/$defs/GraphCorrelation"
}
]
}
@@ -134584,86 +135711,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/setPublishAccess",
- "handler": "setPublishAccess",
+ "path": "/api/graph/getLocalGraph",
+ "handler": "getLocalGraph",
"body": "json",
"request": {
- "$ref": "#/$defs/FileTreeSetPublishRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "type": "null"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
- },
- {
- "type": "null"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/filetree/setSort",
- "handler": "setSort",
- "body": "structJSON",
- "request": {
- "$ref": "#/$defs/FileTreeSetSortRequestInput"
+ "$ref": "#/$defs/LocalGraphRequestInput"
},
"response": {
"anyOf": [
@@ -134679,10 +135731,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/FileTreeSetSortData"
+ "$ref": "#/$defs/LocalGraphResult"
},
{
- "type": "null"
+ "$ref": "#/$defs/GraphCorrelation"
}
]
},
@@ -134726,10 +135778,10 @@
{
"anyOf": [
{
- "$ref": "#/$defs/FileTreeSetSortData"
+ "$ref": "#/$defs/LocalGraphResult"
},
{
- "type": "null"
+ "$ref": "#/$defs/GraphCorrelation"
}
]
}
@@ -134751,11 +135803,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/updatePinnedDocs",
- "handler": "updatePinnedDocs",
- "body": "json",
+ "path": "/api/graph/resetGraph",
+ "handler": "resetGraph",
+ "body": "none",
"request": {
- "$ref": "#/$defs/UpdatePinnedDocsRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -134769,7 +135821,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ResetGraphData"
},
"msg": {
"type": "string"
@@ -134826,11 +135878,11 @@
},
{
"method": "POST",
- "path": "/api/filetree/upsertIndexes",
- "handler": "upsertIndexes",
- "body": "json",
+ "path": "/api/graph/resetLocalGraph",
+ "handler": "resetLocalGraph",
+ "body": "none",
"request": {
- "$ref": "#/$defs/FileTreePathsRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -134844,7 +135896,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ResetLocalGraphData"
},
"msg": {
"type": "string"
@@ -134901,11 +135953,11 @@
},
{
"method": "POST",
- "path": "/api/format/autoSpace",
- "handler": "autoSpace",
+ "path": "/api/graph/setGraphConf",
+ "handler": "setGraphConf",
"body": "json",
"request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
+ "$ref": "#/$defs/SetGraphConfRequestInput"
},
"response": {
"anyOf": [
@@ -134919,7 +135971,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/GlobalGraphConf"
+ },
+ {
+ "$ref": "#/$defs/LocalGraphConf"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -134976,11 +136035,11 @@
},
{
"method": "POST",
- "path": "/api/format/netAssets2LocalAssets",
- "handler": "netAssets2LocalAssets",
- "body": "json",
+ "path": "/api/history/clearWorkspaceHistory",
+ "handler": "clearWorkspaceHistory",
+ "body": "none",
"request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -135051,11 +136110,11 @@
},
{
"method": "POST",
- "path": "/api/format/netImg2LocalAssets",
- "handler": "netImg2LocalAssets",
+ "path": "/api/history/createAssetHistory",
+ "handler": "createAssetHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/NetImageAssetsRequestInput"
+ "$ref": "#/$defs/CreateAssetHistoryRequestInput"
},
"response": {
"anyOf": [
@@ -135126,11 +136185,11 @@
},
{
"method": "POST",
- "path": "/api/graph/getGraph",
- "handler": "getGraph",
+ "path": "/api/history/createDocHistory",
+ "handler": "createDocHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/GlobalGraphRequestInput"
+ "$ref": "#/$defs/CreateDocHistoryRequestInput"
},
"response": {
"anyOf": [
@@ -135144,14 +136203,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/GlobalGraphResult"
- },
- {
- "$ref": "#/$defs/GraphCorrelation"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -135189,16 +136241,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/GlobalGraphResult"
- },
- {
- "$ref": "#/$defs/GraphCorrelation"
- }
- ]
}
]
},
@@ -135218,11 +136260,11 @@
},
{
"method": "POST",
- "path": "/api/graph/getLocalGraph",
- "handler": "getLocalGraph",
+ "path": "/api/history/diffDocVersions",
+ "handler": "diffDocVersions",
"body": "json",
"request": {
- "$ref": "#/$defs/LocalGraphRequestInput"
+ "$ref": "#/$defs/DiffDocVersionsRequestInput"
},
"response": {
"anyOf": [
@@ -135238,59 +136280,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/LocalGraphResult"
- },
- {
- "$ref": "#/$defs/GraphCorrelation"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
- "data": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "$ref": "#/$defs/DocVersionDiffResult"
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/LocalGraphResult"
- },
- {
- "$ref": "#/$defs/GraphCorrelation"
- }
- ]
}
]
},
@@ -135303,42 +136296,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/graph/resetGraph",
- "handler": "resetGraph",
- "body": "none",
- "request": {
- "$ref": "#/$defs/EmptyRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "$ref": "#/$defs/ResetGraphData"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -135385,11 +136342,11 @@
},
{
"method": "POST",
- "path": "/api/graph/resetLocalGraph",
- "handler": "resetLocalGraph",
- "body": "none",
+ "path": "/api/history/getDocHistoryContent",
+ "handler": "getDocHistoryContent",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/DocHistoryContentRequestInput"
},
"response": {
"anyOf": [
@@ -135403,7 +136360,7 @@
]
},
"data": {
- "$ref": "#/$defs/ResetLocalGraphData"
+ "$ref": "#/$defs/DocHistoryContentData"
},
"msg": {
"type": "string"
@@ -135460,11 +136417,11 @@
},
{
"method": "POST",
- "path": "/api/graph/setGraphConf",
- "handler": "setGraphConf",
+ "path": "/api/history/getHistoryItems",
+ "handler": "getHistoryItems",
"body": "json",
"request": {
- "$ref": "#/$defs/SetGraphConfRequestInput"
+ "$ref": "#/$defs/HistoryItemsRequestInput"
},
"response": {
"anyOf": [
@@ -135478,14 +136435,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/GlobalGraphConf"
- },
- {
- "$ref": "#/$defs/LocalGraphConf"
- }
- ]
+ "$ref": "#/$defs/HistoryItemsData"
},
"msg": {
"type": "string"
@@ -135542,8 +136492,8 @@
},
{
"method": "POST",
- "path": "/api/history/clearWorkspaceHistory",
- "handler": "clearWorkspaceHistory",
+ "path": "/api/history/getNotebookHistory",
+ "handler": "getNotebookHistory",
"body": "none",
"request": {
"$ref": "#/$defs/EmptyRequestInput"
@@ -135560,7 +136510,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/NotebookHistoryData"
},
"msg": {
"type": "string"
@@ -135617,11 +136567,11 @@
},
{
"method": "POST",
- "path": "/api/history/createAssetHistory",
- "handler": "createAssetHistory",
- "body": "json",
+ "path": "/api/history/reindexHistory",
+ "handler": "reindexHistory",
+ "body": "none",
"request": {
- "$ref": "#/$defs/CreateAssetHistoryRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -135692,11 +136642,11 @@
},
{
"method": "POST",
- "path": "/api/history/createDocHistory",
- "handler": "createDocHistory",
+ "path": "/api/history/rollbackAssetsHistory",
+ "handler": "rollbackAssetsHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/CreateDocHistoryRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -135767,11 +136717,11 @@
},
{
"method": "POST",
- "path": "/api/history/diffDocVersions",
- "handler": "diffDocVersions",
+ "path": "/api/history/rollbackAttributeViewHistory",
+ "handler": "rollbackAttributeViewHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/DiffDocVersionsRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -135785,14 +136735,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/DocVersionDiffResult"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -135849,11 +136792,11 @@
},
{
"method": "POST",
- "path": "/api/history/getDocHistoryContent",
- "handler": "getDocHistoryContent",
+ "path": "/api/history/rollbackDocHistory",
+ "handler": "rollbackDocHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/DocHistoryContentRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -135867,7 +136810,7 @@
]
},
"data": {
- "$ref": "#/$defs/DocHistoryContentData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -135924,11 +136867,11 @@
},
{
"method": "POST",
- "path": "/api/history/getHistoryItems",
- "handler": "getHistoryItems",
+ "path": "/api/history/rollbackNotebookHistory",
+ "handler": "rollbackNotebookHistory",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryItemsRequestInput"
+ "$ref": "#/$defs/HistoryPathRequestInput"
},
"response": {
"anyOf": [
@@ -135942,7 +136885,7 @@
]
},
"data": {
- "$ref": "#/$defs/HistoryItemsData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -135999,11 +136942,11 @@
},
{
"method": "POST",
- "path": "/api/history/getNotebookHistory",
- "handler": "getNotebookHistory",
- "body": "none",
+ "path": "/api/history/searchHistory",
+ "handler": "searchHistory",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/SearchHistoryRequestInput"
},
"response": {
"anyOf": [
@@ -136017,7 +136960,7 @@
]
},
"data": {
- "$ref": "#/$defs/NotebookHistoryData"
+ "$ref": "#/$defs/SearchHistoryData"
},
"msg": {
"type": "string"
@@ -136074,11 +137017,11 @@
},
{
"method": "POST",
- "path": "/api/history/reindexHistory",
- "handler": "reindexHistory",
- "body": "none",
+ "path": "/api/import/cancelImportSY",
+ "handler": "cancelImportSY",
+ "body": "json",
"request": {
- "$ref": "#/$defs/EmptyRequestInput"
+ "$ref": "#/$defs/ImportTokenRequestInput"
},
"response": {
"anyOf": [
@@ -136149,11 +137092,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackAssetsHistory",
- "handler": "rollbackAssetsHistory",
+ "path": "/api/import/cancelObsidianVaultTask",
+ "handler": "cancelObsidianVaultTask",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/ObsidianTaskRequestInput"
},
"response": {
"anyOf": [
@@ -136167,7 +137110,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -136205,6 +137155,16 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
}
]
},
@@ -136224,11 +137184,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackAttributeViewHistory",
- "handler": "rollbackAttributeViewHistory",
+ "path": "/api/import/continueImportSY",
+ "handler": "continueImportSY",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/ContinueImportSYRequestInput"
},
"response": {
"anyOf": [
@@ -136242,7 +137202,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/ImportDocumentData"
},
"msg": {
"type": "string"
@@ -136299,11 +137259,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackDocHistory",
- "handler": "rollbackDocHistory",
+ "path": "/api/import/getObsidianVaultTask",
+ "handler": "getObsidianVaultTask",
"body": "json",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/ObsidianTaskRequestInput"
},
"response": {
"anyOf": [
@@ -136317,7 +137277,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -136374,11 +137341,11 @@
},
{
"method": "POST",
- "path": "/api/history/rollbackNotebookHistory",
- "handler": "rollbackNotebookHistory",
- "body": "json",
+ "path": "/api/import/importData",
+ "handler": "importData",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/HistoryPathRequestInput"
+ "$ref": "#/$defs/ImportDataRequestInput"
},
"response": {
"anyOf": [
@@ -136449,11 +137416,11 @@
},
{
"method": "POST",
- "path": "/api/history/searchHistory",
- "handler": "searchHistory",
- "body": "json",
+ "path": "/api/import/importSY",
+ "handler": "importSY",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/SearchHistoryRequestInput"
+ "$ref": "#/$defs/ImportSYRequestInput"
},
"response": {
"anyOf": [
@@ -136467,7 +137434,7 @@
]
},
"data": {
- "$ref": "#/$defs/SearchHistoryData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -136524,11 +137491,11 @@
},
{
"method": "POST",
- "path": "/api/import/cancelImportSY",
- "handler": "cancelImportSY",
- "body": "json",
+ "path": "/api/import/importSYAuto",
+ "handler": "importSYAuto",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/ImportTokenRequestInput"
+ "$ref": "#/$defs/ImportSYRequestInput"
},
"response": {
"anyOf": [
@@ -136542,7 +137509,17 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ImportAutoDocument"
+ },
+ {
+ "$ref": "#/$defs/ImportAutoNotebook"
+ },
+ {
+ "$ref": "#/$defs/ImportAutoNotebooks"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -136580,6 +137557,19 @@
},
{
"type": "null"
+ },
+ {
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ImportAutoDocument"
+ },
+ {
+ "$ref": "#/$defs/ImportAutoNotebook"
+ },
+ {
+ "$ref": "#/$defs/ImportAutoNotebooks"
+ }
+ ]
}
]
},
@@ -136599,11 +137589,11 @@
},
{
"method": "POST",
- "path": "/api/import/cancelObsidianVaultTask",
- "handler": "cancelObsidianVaultTask",
- "body": "json",
+ "path": "/api/import/importSYNotebook",
+ "handler": "importSYNotebook",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/ObsidianTaskRequestInput"
+ "$ref": "#/$defs/ImportDataRequestInput"
},
"response": {
"anyOf": [
@@ -136619,10 +137609,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ObsidianVaultTask"
+ "$ref": "#/$defs/ImportedNotebook"
},
{
- "type": "null"
+ "$ref": "#/$defs/ImportedNotebooks"
}
]
},
@@ -136662,16 +137652,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/ObsidianVaultTask"
- },
- {
- "type": "null"
- }
- ]
}
]
},
@@ -136691,11 +137671,11 @@
},
{
"method": "POST",
- "path": "/api/import/continueImportSY",
- "handler": "continueImportSY",
+ "path": "/api/import/importStdMd",
+ "handler": "importStdMd",
"body": "json",
"request": {
- "$ref": "#/$defs/ContinueImportSYRequestInput"
+ "$ref": "#/$defs/ImportMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -136709,7 +137689,7 @@
]
},
"data": {
- "$ref": "#/$defs/ImportDocumentData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -136766,11 +137746,11 @@
},
{
"method": "POST",
- "path": "/api/import/getObsidianVaultTask",
- "handler": "getObsidianVaultTask",
- "body": "json",
+ "path": "/api/import/importZipMd",
+ "handler": "importZipMd",
+ "body": "multipart",
"request": {
- "$ref": "#/$defs/ObsidianTaskRequestInput"
+ "$ref": "#/$defs/ImportZipMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -136784,14 +137764,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ObsidianVaultTask"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -136848,11 +137821,11 @@
},
{
"method": "POST",
- "path": "/api/import/importData",
- "handler": "importData",
- "body": "multipart",
+ "path": "/api/import/startObsidianVaultAnalysis",
+ "handler": "startObsidianVaultAnalysis",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportDataRequestInput"
+ "$ref": "#/$defs/ObsidianAnalysisRequestInput"
},
"response": {
"anyOf": [
@@ -136866,7 +137839,14 @@
]
},
"data": {
- "type": "null"
+ "anyOf": [
+ {
+ "$ref": "#/$defs/ObsidianVaultTask"
+ },
+ {
+ "type": "null"
+ }
+ ]
},
"msg": {
"type": "string"
@@ -136923,11 +137903,11 @@
},
{
"method": "POST",
- "path": "/api/import/importSY",
- "handler": "importSY",
- "body": "multipart",
+ "path": "/api/import/startObsidianVaultImport",
+ "handler": "startObsidianVaultImport",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportSYRequestInput"
+ "$ref": "#/$defs/ObsidianImportRequestInput"
},
"response": {
"anyOf": [
@@ -136940,42 +137920,10 @@
0
]
},
- "data": {
- "type": "null"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "$ref": "#/$defs/ObsidianVaultTask"
},
{
"type": "null"
@@ -136991,52 +137939,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/import/importSYAuto",
- "handler": "importSYAuto",
- "body": "multipart",
- "request": {
- "$ref": "#/$defs/ImportSYRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ImportAutoDocument"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebook"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebooks"
- }
- ]
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -137064,19 +137966,6 @@
},
{
"type": "null"
- },
- {
- "anyOf": [
- {
- "$ref": "#/$defs/ImportAutoDocument"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebook"
- },
- {
- "$ref": "#/$defs/ImportAutoNotebooks"
- }
- ]
}
]
},
@@ -137096,11 +137985,11 @@
},
{
"method": "POST",
- "path": "/api/import/importSYNotebook",
- "handler": "importSYNotebook",
- "body": "multipart",
+ "path": "/api/inbox/getShorthand",
+ "handler": "getShorthand",
+ "body": "json",
"request": {
- "$ref": "#/$defs/ImportDataRequestInput"
+ "$ref": "#/$defs/TrimmedIDRequestInput"
},
"response": {
"anyOf": [
@@ -137116,10 +138005,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/ImportedNotebook"
+ "$ref": "#/$defs/Shorthand"
},
{
- "$ref": "#/$defs/ImportedNotebooks"
+ "type": "null"
}
]
},
@@ -137140,7 +138029,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -137178,11 +138068,11 @@
},
{
"method": "POST",
- "path": "/api/import/importStdMd",
- "handler": "importStdMd",
+ "path": "/api/inbox/getShorthands",
+ "handler": "getShorthands",
"body": "json",
"request": {
- "$ref": "#/$defs/ImportMarkdownRequestInput"
+ "$ref": "#/$defs/ShorthandsRequestInput"
},
"response": {
"anyOf": [
@@ -137195,42 +138085,10 @@
0
]
},
- "data": {
- "type": "null"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
- "additionalProperties": false
- },
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- -1
- ]
- },
"data": {
"anyOf": [
{
- "type": "object",
- "properties": {
- "closeTimeout": {
- "type": "number"
- }
- },
- "required": [
- "closeTimeout"
- ],
- "additionalProperties": false
+ "$ref": "#/$defs/ShorthandsData"
},
{
"type": "null"
@@ -137246,42 +138104,6 @@
"msg",
"data"
],
- "additionalProperties": true
- }
- ]
- }
- },
- {
- "method": "POST",
- "path": "/api/import/importZipMd",
- "handler": "importZipMd",
- "body": "multipart",
- "request": {
- "$ref": "#/$defs/ImportZipMarkdownRequestInput"
- },
- "response": {
- "anyOf": [
- {
- "type": "object",
- "properties": {
- "code": {
- "type": "integer",
- "enum": [
- 0
- ]
- },
- "data": {
- "type": "null"
- },
- "msg": {
- "type": "string"
- }
- },
- "required": [
- "code",
- "msg",
- "data"
- ],
"additionalProperties": false
},
{
@@ -137290,7 +138112,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -137328,11 +138151,11 @@
},
{
"method": "POST",
- "path": "/api/import/startObsidianVaultAnalysis",
- "handler": "startObsidianVaultAnalysis",
+ "path": "/api/inbox/removeShorthands",
+ "handler": "removeShorthands",
"body": "json",
"request": {
- "$ref": "#/$defs/ObsidianAnalysisRequestInput"
+ "$ref": "#/$defs/RemoveShorthandsRequestInput"
},
"response": {
"anyOf": [
@@ -137346,14 +138169,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ObsidianVaultTask"
- },
- {
- "type": "null"
- }
- ]
+ "type": "null"
},
"msg": {
"type": "string"
@@ -137372,7 +138188,8 @@
"code": {
"type": "integer",
"enum": [
- -1
+ -1,
+ 1
]
},
"data": {
@@ -137410,11 +138227,11 @@
},
{
"method": "POST",
- "path": "/api/import/startObsidianVaultImport",
- "handler": "startObsidianVaultImport",
+ "path": "/api/lute/copyStdMarkdown",
+ "handler": "copyStdMarkdown",
"body": "json",
"request": {
- "$ref": "#/$defs/ObsidianImportRequestInput"
+ "$ref": "#/$defs/CopyStdMarkdownRequestInput"
},
"response": {
"anyOf": [
@@ -137428,14 +138245,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ObsidianVaultTask"
- },
- {
- "type": "null"
- }
- ]
+ "type": "string"
},
"msg": {
"type": "string"
@@ -137492,11 +138302,11 @@
},
{
"method": "POST",
- "path": "/api/inbox/getShorthand",
- "handler": "getShorthand",
+ "path": "/api/lute/html2BlockDOM",
+ "handler": "html2BlockDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/TrimmedIDRequestInput"
+ "$ref": "#/$defs/HTMLClipboardRequestInput"
},
"response": {
"anyOf": [
@@ -137512,10 +138322,10 @@
"data": {
"anyOf": [
{
- "$ref": "#/$defs/Shorthand"
+ "type": "string"
},
{
- "type": "null"
+ "$ref": "#/$defs/HTMLClipboardPreflight"
}
]
},
@@ -137536,8 +138346,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -137575,11 +138384,11 @@
},
{
"method": "POST",
- "path": "/api/inbox/getShorthands",
- "handler": "getShorthands",
+ "path": "/api/lute/md2html",
+ "handler": "md2HTML",
"body": "json",
"request": {
- "$ref": "#/$defs/ShorthandsRequestInput"
+ "$ref": "#/$defs/MarkdownHTMLRequestInput"
},
"response": {
"anyOf": [
@@ -137593,14 +138402,7 @@
]
},
"data": {
- "anyOf": [
- {
- "$ref": "#/$defs/ShorthandsData"
- },
- {
- "type": "null"
- }
- ]
+ "$ref": "#/$defs/HTMLData"
},
"msg": {
"type": "string"
@@ -137619,8 +138421,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 1
+ -1
]
},
"data": {
@@ -137658,11 +138459,11 @@
},
{
"method": "POST",
- "path": "/api/inbox/removeShorthands",
- "handler": "removeShorthands",
+ "path": "/api/lute/spinBlockDOM",
+ "handler": "spinBlockDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/RemoveShorthandsRequestInput"
+ "$ref": "#/$defs/DOMTextRequestInput"
},
"response": {
"anyOf": [
@@ -137676,7 +138477,7 @@
]
},
"data": {
- "type": "null"
+ "$ref": "#/$defs/DOMData"
},
"msg": {
"type": "string"
@@ -137696,7 +138497,7 @@
"type": "integer",
"enum": [
-1,
- 1
+ 413
]
},
"data": {
@@ -137734,11 +138535,11 @@
},
{
"method": "POST",
- "path": "/api/lute/copyStdMarkdown",
- "handler": "copyStdMarkdown",
+ "path": "/api/lute/wpsPresentation2BlockDOM",
+ "handler": "wpsPresentation2BlockDOM",
"body": "json",
"request": {
- "$ref": "#/$defs/CopyStdMarkdownRequestInput"
+ "$ref": "#/$defs/WPSPresentationRequestInput"
},
"response": {
"anyOf": [
@@ -137752,7 +138553,7 @@
]
},
"data": {
- "type": "string"
+ "$ref": "#/$defs/WPSPresentationData"
},
"msg": {
"type": "string"
@@ -137790,6 +138591,9 @@
},
{
"type": "null"
+ },
+ {
+ "$ref": "#/$defs/WPSPresentationData"
}
]
},
@@ -137809,11 +138613,11 @@
},
{
"method": "POST",
- "path": "/api/lute/html2BlockDOM",
- "handler": "html2BlockDOM",
+ "path": "/api/mcp/addOAuthClient",
+ "handler": "mcpOAuthAddClient",
"body": "json",
"request": {
- "$ref": "#/$defs/HTMLClipboardRequestInput"
+ "$ref": "#/$defs/MCPOAuthClientRequestInput"
},
"response": {
"anyOf": [
@@ -137827,14 +138631,7 @@
]
},
"data": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "$ref": "#/$defs/HTMLClipboardPreflight"
- }
- ]
+ "$ref": "#/$defs/MCPOAuthClientSecret"
},
"msg": {
"type": "string"
@@ -137891,11 +138688,11 @@
},
{
"method": "POST",
- "path": "/api/lute/md2html",
- "handler": "md2HTML",
- "body": "json",
+ "path": "/api/mcp/getOAuth",
+ "handler": "mcpOAuthGet",
+ "body": "none",
"request": {
- "$ref": "#/$defs/MarkdownHTMLRequestInput"
+ "$ref": "#/$defs/EmptyRequestInput"
},
"response": {
"anyOf": [
@@ -137909,7 +138706,7 @@
]
},
"data": {
- "$ref": "#/$defs/HTMLData"
+ "$ref": "#/$defs/MCPOAuthStatus"
},
"msg": {
"type": "string"
@@ -137966,11 +138763,11 @@
},
{
"method": "POST",
- "path": "/api/lute/spinBlockDOM",
- "handler": "spinBlockDOM",
+ "path": "/api/mcp/removeOAuthClient",
+ "handler": "mcpOAuthRemoveClient",
"body": "json",
"request": {
- "$ref": "#/$defs/DOMTextRequestInput"
+ "$ref": "#/$defs/MCPOAuthRemoveRequestInput"
},
"response": {
"anyOf": [
@@ -137984,7 +138781,7 @@
]
},
"data": {
- "$ref": "#/$defs/DOMData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -138003,8 +138800,7 @@
"code": {
"type": "integer",
"enum": [
- -1,
- 413
+ -1
]
},
"data": {
@@ -138042,11 +138838,11 @@
},
{
"method": "POST",
- "path": "/api/lute/wpsPresentation2BlockDOM",
- "handler": "wpsPresentation2BlockDOM",
+ "path": "/api/mcp/setOAuth",
+ "handler": "mcpOAuthSet",
"body": "json",
"request": {
- "$ref": "#/$defs/WPSPresentationRequestInput"
+ "$ref": "#/$defs/MCPOAuthConfigInput"
},
"response": {
"anyOf": [
@@ -138060,7 +138856,7 @@
]
},
"data": {
- "$ref": "#/$defs/WPSPresentationData"
+ "type": "null"
},
"msg": {
"type": "string"
@@ -138098,9 +138894,6 @@
},
{
"type": "null"
- },
- {
- "$ref": "#/$defs/WPSPresentationData"
}
]
},
@@ -159750,6 +160543,242 @@
]
}
},
+ {
+ "method": "POST",
+ "path": "/oauth/mcp/consent",
+ "handler": "mcpOAuthConsent",
+ "body": "form",
+ "request": {
+ "$ref": "#/$defs/MCPOAuthConsentRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 302,
+ "contentType": "text/html"
+ },
+ {
+ "status": 400,
+ "contentType": "text/html"
+ }
+ ]
+ },
+ {
+ "method": "POST",
+ "path": "/oauth/mcp/revoke",
+ "handler": "mcpOAuthRevoke",
+ "body": "form",
+ "request": {
+ "$ref": "#/$defs/MCPOAuthTokenRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 200,
+ "contentType": "application/json"
+ },
+ {
+ "status": 400,
+ "contentType": "application/json"
+ },
+ {
+ "status": 401,
+ "contentType": "application/json"
+ },
+ {
+ "status": 404,
+ "contentType": "application/json"
+ },
+ {
+ "status": 429,
+ "contentType": "application/json"
+ },
+ {
+ "status": 500,
+ "contentType": "application/json"
+ }
+ ]
+ },
+ {
+ "method": "POST",
+ "path": "/oauth/mcp/token",
+ "handler": "mcpOAuthToken",
+ "body": "form",
+ "request": {
+ "$ref": "#/$defs/MCPOAuthTokenRequestInput"
+ },
+ "response": {
+ "anyOf": [
+ {
+ "type": "string",
+ "format": "binary"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "integer",
+ "enum": [
+ -1
+ ]
+ },
+ "data": {
+ "anyOf": [
+ {
+ "type": "object",
+ "properties": {
+ "closeTimeout": {
+ "type": "number"
+ }
+ },
+ "required": [
+ "closeTimeout"
+ ],
+ "additionalProperties": false
+ },
+ {
+ "type": "null"
+ }
+ ]
+ },
+ "msg": {
+ "type": "string"
+ }
+ },
+ "required": [
+ "code",
+ "msg",
+ "data"
+ ],
+ "additionalProperties": true
+ }
+ ]
+ },
+ "output": "binary",
+ "errorStatus": 200,
+ "contentVariants": [
+ {
+ "status": 200,
+ "contentType": "application/json"
+ },
+ {
+ "status": 400,
+ "contentType": "application/json"
+ },
+ {
+ "status": 401,
+ "contentType": "application/json"
+ },
+ {
+ "status": 404,
+ "contentType": "application/json"
+ },
+ {
+ "status": 429,
+ "contentType": "application/json"
+ },
+ {
+ "status": 500,
+ "contentType": "application/json"
+ }
+ ]
+ },
{
"method": "POST",
"path": "/plugin/private/:name/*path",
diff --git a/kernel/mcp/server.go b/kernel/mcp/server.go
index 87313c3120..05248550cd 100644
--- a/kernel/mcp/server.go
+++ b/kernel/mcp/server.go
@@ -53,9 +53,9 @@ func Serve(ginServer *gin.Engine) {
// MCP 工具暴露任意工作区文件读写删、SQL、插件分发等管理级原语,必须要求管理员角色,
// 否则 Publish 匿名模式注入的 RoleReader JWT 可经此链路越权调用全部工具。
- ginServer.POST("/mcp", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, serveHTTP(handler))
- ginServer.GET("/mcp", model.CheckAuth, model.CheckAdminRole, serveHTTP(handler))
- ginServer.DELETE("/mcp", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, serveHTTP(handler))
+ ginServer.POST("/mcp", model.CheckMCPAuth, model.CheckAdminRole, model.CheckReadonly, serveHTTP(handler))
+ ginServer.GET("/mcp", model.CheckMCPAuth, model.CheckAdminRole, serveHTTP(handler))
+ ginServer.DELETE("/mcp", model.CheckMCPAuth, model.CheckAdminRole, model.CheckReadonly, serveHTTP(handler))
}
func getHTTPHandler() http.Handler {
diff --git a/kernel/model/mcp_oauth.go b/kernel/model/mcp_oauth.go
new file mode 100644
index 0000000000..5568148a1b
--- /dev/null
+++ b/kernel/model/mcp_oauth.go
@@ -0,0 +1,124 @@
+package model
+
+import (
+ "context"
+ "crypto/sha256"
+ "encoding/hex"
+ "encoding/json"
+ "fmt"
+ "net/http"
+ "path/filepath"
+ "strings"
+ "sync"
+
+ "github.com/gin-gonic/gin"
+ "github.com/modelcontextprotocol/go-sdk/auth"
+ "github.com/siyuan-note/siyuan/kernel/conf"
+ "github.com/siyuan-note/siyuan/kernel/model/mcpoauth"
+ "github.com/siyuan-note/siyuan/kernel/util"
+)
+
+var mcpOAuthStore struct {
+ sync.Mutex
+ path string
+ service *mcpoauth.Service
+}
+
+// MCPOAuthService 的授权状态属于当前工作空间,管理员认证配置变化时撤销既有授权。
+func MCPOAuthService() (*mcpoauth.Service, error) {
+ mcpOAuthStore.Lock()
+ defer mcpOAuthStore.Unlock()
+ if Conf == nil || util.ConfDir == "" {
+ return nil, mcpoauth.ErrDisabled
+ }
+ data, err := json.Marshal(struct {
+ Cookie, Password string
+ OIDC *conf.OIDC
+ }{Conf.CookieKey, Conf.AccessAuthCode, Conf.GetOIDC()})
+ if err != nil {
+ return nil, err
+ }
+ digest := sha256.Sum256(data)
+ epoch := hex.EncodeToString(digest[:])
+ path := filepath.Join(util.ConfDir, "mcp-oauth.json")
+ if mcpOAuthStore.service == nil || mcpOAuthStore.path != path {
+ service, openErr := mcpoauth.Open(path, epoch)
+ if openErr != nil {
+ return nil, openErr
+ }
+ mcpOAuthStore.path, mcpOAuthStore.service = path, service
+ }
+ if err = mcpOAuthStore.service.EnsureEpoch(epoch); err != nil {
+ return nil, err
+ }
+ return mcpOAuthStore.service, nil
+}
+
+func MCPOAuthAvailable() bool {
+ return Conf != nil && IsAccessAuthRequired() && !util.SiYuanAccessAuthCodeBypass
+}
+
+type mcpOAuthChallengeWriter struct {
+ gin.ResponseWriter
+ challenge string
+}
+
+func (w *mcpOAuthChallengeWriter) WriteHeader(status int) {
+ if status == http.StatusUnauthorized {
+ w.Header().Set("WWW-Authenticate", w.challenge)
+ }
+ w.ResponseWriter.WriteHeader(status)
+}
+
+// CheckMCPAuth 仅在 MCP 入口接受 OAuth 凭证,保留 API Token、会话和角色校验。
+func CheckMCPAuth(c *gin.Context) {
+ header := strings.Fields(c.GetHeader("Authorization"))
+ isBearer := len(header) == 2 && strings.EqualFold(header[0], "Bearer")
+ if isBearer && util.AuthCodeEquals(Conf.Api.Token, header[1]) {
+ CheckAuth(c)
+ return
+ }
+ service, err := MCPOAuthService()
+ enabled := err == nil && service.Status().Enabled && MCPOAuthAvailable()
+ if isBearer && (strings.HasPrefix(header[1], mcpoauth.AccessPrefix) || enabled) {
+ if !enabled {
+ c.AbortWithStatus(http.StatusUnauthorized)
+ return
+ }
+ // 已注入的非管理员身份不能被 OAuth 令牌提升。
+ role := GetGinContextRole(c)
+ if role == RoleReader || role == RoleEditor {
+ c.AbortWithStatus(http.StatusForbidden)
+ return
+ }
+ metadata := service.Status().PublicURL + "/.well-known/oauth-protected-resource/mcp"
+ verifier := func(context.Context, string, *http.Request) (*auth.TokenInfo, error) {
+ grant, verifyErr := service.Access(header[1])
+ if verifyErr != nil {
+ return nil, auth.ErrInvalidToken
+ }
+ return &auth.TokenInfo{UserID: grant.ID, Scopes: strings.Fields(grant.Scope), Expiration: grant.Expires}, nil
+ }
+ handler := http.HandlerFunc(func(_ http.ResponseWriter, r *http.Request) {
+ c.Request = r
+ c.Set(RoleContextKey, RoleAdministrator)
+ c.Next()
+ })
+ auth.RequireBearerToken(verifier, &auth.RequireBearerTokenOptions{ResourceMetadataURL: metadata})(handler).ServeHTTP(c.Writer, c.Request)
+ c.Abort()
+ return
+ }
+ if enabled {
+ challenge := fmt.Sprintf(`Bearer resource_metadata="%s/.well-known/oauth-protected-resource/mcp", scope="mcp offline_access"`, service.Status().PublicURL)
+ if c.GetHeader("Authorization") == "" && c.Query("token") == "" &&
+ !IsAdminRoleContext(c) && GetGinContextRole(c) != RoleReader && GetGinContextRole(c) != RoleEditor &&
+ !IsWorkspaceSessionAuthenticated(util.GetWorkspaceSession(util.GetSession(c))) {
+ c.Header("WWW-Authenticate", challenge)
+ c.AbortWithStatus(http.StatusUnauthorized)
+ return
+ }
+ c.Writer = &mcpOAuthChallengeWriter{ResponseWriter: c.Writer,
+ challenge: challenge}
+ }
+ CheckAuth(c)
+}
diff --git a/kernel/model/mcpoauth/service.go b/kernel/model/mcpoauth/service.go
new file mode 100644
index 0000000000..4e607857ad
--- /dev/null
+++ b/kernel/model/mcpoauth/service.go
@@ -0,0 +1,537 @@
+// Package mcpoauth 实现仅用于内置 MCP 的授权码、刷新和撤销,持久化文件只保存凭证摘要。
+package mcpoauth
+
+import (
+ "crypto/rand"
+ "crypto/sha256"
+ "crypto/subtle"
+ "encoding/base64"
+ "encoding/json"
+ "errors"
+ "net/url"
+ "os"
+ "path/filepath"
+ "sort"
+ "strings"
+ "sync"
+ "time"
+
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+)
+
+const AccessPrefix = "sy-mcp-a."
+const scope = "mcp"
+const maxClients = 64
+const maxGrants = 256
+const maxPending = 256
+
+var ErrInvalid = errors.New("invalid_request")
+var ErrGrant = errors.New("invalid_grant")
+var ErrClient = errors.New("invalid_client")
+var ErrDisabled = errors.New("MCP OAuth is disabled")
+
+type client struct {
+ apicontract.MCPOAuthClient
+ SecretHash string `json:"secretHash"`
+}
+
+type grant struct {
+ ClientID string `json:"clientID"`
+ AccessHash string `json:"accessHash"`
+ AccessExpires int64 `json:"accessExpires"`
+ RefreshHash string `json:"refreshHash"`
+ Expires int64 `json:"expires"`
+ Scope string `json:"scope"`
+ Spent []string `json:"spent"`
+}
+
+type state struct {
+ Version int `json:"version"`
+ Epoch string `json:"epoch"`
+ Config apicontract.MCPOAuthConfig `json:"config"`
+ Clients map[string]client `json:"clients"`
+ Grants map[string]grant `json:"grants"`
+}
+
+type Authorization struct {
+ ClientID string
+ RedirectURI string
+ State string
+ Challenge string
+ Scope string
+ Resource string
+}
+
+type pending struct {
+ Authorization
+ Binding string
+ Expires time.Time
+}
+
+type Service struct {
+ mu sync.Mutex
+ path string
+ data state
+ pending map[string]pending
+ codes map[string]pending
+ now func() time.Time
+ write func(string, []byte) error
+}
+
+func Open(path, epoch string) (*Service, error) {
+ s := &Service{path: path, now: time.Now, write: writeAtomic,
+ pending: map[string]pending{}, codes: map[string]pending{},
+ data: state{Version: 1, Epoch: epoch, Clients: map[string]client{}, Grants: map[string]grant{}}}
+ data, err := os.ReadFile(path)
+ if err != nil && !os.IsNotExist(err) {
+ return nil, err
+ }
+ if err == nil {
+ s.data = state{}
+ if err = json.Unmarshal(data, &s.data); err != nil {
+ return nil, err
+ }
+ if s.data.Version != 1 || s.data.Clients == nil || s.data.Grants == nil {
+ return nil, ErrInvalid
+ }
+ if err = validateConfig(s.data.Config); err != nil {
+ return nil, err
+ }
+ }
+ if err = s.EnsureEpoch(epoch); err != nil {
+ return nil, err
+ }
+ return s, nil
+}
+
+// writeAtomic 先完整写入同目录临时文件,再替换配置;失败时保留原文件及内存状态。
+func writeAtomic(path string, data []byte) error {
+ f, err := os.CreateTemp(filepath.Dir(path), ".mcp-oauth-*")
+ if err != nil {
+ return err
+ }
+ defer os.Remove(f.Name())
+ if err = f.Chmod(0600); err == nil {
+ _, err = f.Write(data)
+ }
+ if err == nil {
+ err = f.Sync()
+ }
+ closeErr := f.Close()
+ if err != nil {
+ return err
+ }
+ if closeErr != nil {
+ return closeErr
+ }
+ return os.Rename(f.Name(), path)
+}
+
+func (s *Service) clone() state {
+ data, _ := json.Marshal(s.data)
+ var next state
+ _ = json.Unmarshal(data, &next)
+ return next
+}
+
+func (s *Service) save(next state) error {
+ data, err := json.Marshal(next)
+ if err != nil {
+ return err
+ }
+ if err = s.write(s.path, data); err != nil {
+ return err
+ }
+ s.data = next
+ return nil
+}
+
+func (s *Service) EnsureEpoch(epoch string) error {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if s.data.Epoch == epoch {
+ return nil
+ }
+ next := s.clone()
+ next.Epoch = epoch
+ next.Grants = map[string]grant{}
+ if err := s.save(next); err != nil {
+ return err
+ }
+ s.pending, s.codes = map[string]pending{}, map[string]pending{}
+ return nil
+}
+
+func validateConfig(config apicontract.MCPOAuthConfig) error {
+ if !config.Enabled && config.PublicURL == "" {
+ return nil
+ }
+ u, err := url.Parse(config.PublicURL)
+ if err != nil || u.Scheme != "https" || u.Hostname() == "" || u.User != nil || u.Path != "" || u.RawQuery != "" || u.Fragment != "" || u.Opaque != "" || u.ForceQuery || strings.ContainsAny(config.PublicURL, "?#*") {
+ return ErrInvalid
+ }
+ return nil
+}
+
+func (s *Service) Configure(config apicontract.MCPOAuthConfig) error {
+ config.PublicURL = strings.TrimRight(strings.TrimSpace(config.PublicURL), "/")
+ if err := validateConfig(config); err != nil {
+ return err
+ }
+ if config.PublicURL != "" {
+ u, _ := url.Parse(config.PublicURL)
+ u.Host = strings.ToLower(u.Host)
+ if u.Port() == "443" {
+ u.Host = strings.TrimSuffix(u.Host, ":443")
+ }
+ config.PublicURL = u.String()
+ }
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if config == s.data.Config {
+ return nil
+ }
+ next := s.clone()
+ next.Config = config
+ next.Grants = map[string]grant{}
+ if err := s.save(next); err != nil {
+ return err
+ }
+ s.pending, s.codes = map[string]pending{}, map[string]pending{}
+ return nil
+}
+
+func (s *Service) Status() apicontract.MCPOAuthStatus {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ ret := apicontract.MCPOAuthStatus{MCPOAuthConfig: s.data.Config, Clients: []apicontract.MCPOAuthClient{}}
+ for _, c := range s.data.Clients {
+ ret.Clients = append(ret.Clients, c.MCPOAuthClient)
+ }
+ sort.Slice(ret.Clients, func(i, j int) bool { return ret.Clients[i].ID < ret.Clients[j].ID })
+ return ret
+}
+
+func random() string {
+ b := make([]byte, 32)
+ _, _ = rand.Read(b)
+ return base64.RawURLEncoding.EncodeToString(b)
+}
+
+func hash(value string) string {
+ h := sha256.Sum256([]byte(value))
+ return base64.RawURLEncoding.EncodeToString(h[:])
+}
+
+func equal(a, b string) bool { return subtle.ConstantTimeCompare([]byte(a), []byte(b)) == 1 }
+
+func (s *Service) AddClient(req apicontract.MCPOAuthClientRequest) (ret apicontract.MCPOAuthClientSecret, err error) {
+ req.Name = strings.TrimSpace(req.Name)
+ u, parseErr := url.Parse(req.RedirectURI)
+ if parseErr != nil || u.User != nil || strings.ContainsAny(req.RedirectURI, "#*") || u.Hostname() == "" || len(req.RedirectURI) > 2048 ||
+ (u.Scheme != "https" && !(u.Scheme == "http" && (u.Hostname() == "127.0.0.1" || u.Hostname() == "::1"))) || req.Name == "" || len(req.Name) > 128 {
+ return ret, ErrInvalid
+ }
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if len(s.data.Clients) >= maxClients {
+ return ret, ErrInvalid
+ }
+ ret = apicontract.MCPOAuthClientSecret{MCPOAuthClient: apicontract.MCPOAuthClient{ID: random(), Name: req.Name, RedirectURI: req.RedirectURI}, Secret: random()}
+ next := s.clone()
+ next.Clients[ret.ID] = client{MCPOAuthClient: ret.MCPOAuthClient, SecretHash: hash(ret.Secret)}
+ err = s.save(next)
+ return
+}
+
+func (s *Service) Remove(id string, all bool) error {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if id == "" && !all {
+ return ErrInvalid
+ }
+ next := s.clone()
+ if !all {
+ delete(next.Clients, id)
+ }
+ for key, g := range next.Grants {
+ if all || g.ClientID == id {
+ delete(next.Grants, key)
+ }
+ }
+ if err := s.save(next); err != nil {
+ return err
+ }
+ for key, p := range s.pending {
+ if all || p.ClientID == id {
+ delete(s.pending, key)
+ }
+ }
+ for key, p := range s.codes {
+ if all || p.ClientID == id {
+ delete(s.codes, key)
+ }
+ }
+ return nil
+}
+
+func normalizeScope(value string) (string, error) {
+ if value == "" {
+ return scope, nil
+ }
+ hasMCP, offline := false, false
+ for _, item := range strings.Fields(value) {
+ switch item {
+ case scope:
+ hasMCP = true
+ case "offline_access":
+ offline = true
+ default:
+ return "", ErrInvalid
+ }
+ }
+ if !hasMCP {
+ return "", ErrInvalid
+ }
+ if offline {
+ return "mcp offline_access", nil
+ }
+ return scope, nil
+}
+
+func (s *Service) authorizeLocked(values url.Values) (Authorization, error) {
+ a := Authorization{ClientID: values.Get("client_id"), RedirectURI: values.Get("redirect_uri"), State: values.Get("state"), Challenge: values.Get("code_challenge"), Resource: values.Get("resource")}
+ if !s.data.Config.Enabled {
+ return a, ErrDisabled
+ }
+ for _, v := range values {
+ if len(v) != 1 || len(v[0]) > 4096 {
+ return a, ErrInvalid
+ }
+ }
+ c, ok := s.data.Clients[a.ClientID]
+ challenge, err := base64.RawURLEncoding.DecodeString(a.Challenge)
+ if !ok || c.RedirectURI != a.RedirectURI || values.Get("response_type") != "code" || values.Get("code_challenge_method") != "S256" || err != nil || len(challenge) != 32 || a.Resource != s.data.Config.PublicURL+"/mcp" {
+ return a, ErrInvalid
+ }
+ a.Scope, err = normalizeScope(values.Get("scope"))
+ return a, err
+}
+
+func (s *Service) ValidateAuthorization(values url.Values) error {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ _, err := s.authorizeLocked(values)
+ return err
+}
+
+func (s *Service) Begin(values url.Values, binding string) (ticket string, c apicontract.MCPOAuthClient, err error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ a, err := s.authorizeLocked(values)
+ if err != nil {
+ return "", c, err
+ }
+ for key, p := range s.pending {
+ if !s.now().Before(p.Expires) {
+ delete(s.pending, key)
+ }
+ }
+ if len(s.pending) >= maxPending || binding == "" {
+ return "", c, ErrInvalid
+ }
+ ticket = random()
+ s.pending[hash(ticket)] = pending{Authorization: a, Binding: hash(binding), Expires: s.now().Add(10 * time.Minute)}
+ return ticket, s.data.Clients[a.ClientID].MCPOAuthClient, nil
+}
+
+func (s *Service) Consent(ticket, binding string, approve bool) (string, error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ p, ok := s.pending[hash(ticket)]
+ if !s.data.Config.Enabled || !ok || !equal(p.Binding, hash(binding)) || !s.now().Before(p.Expires) {
+ return "", ErrInvalid
+ }
+ delete(s.pending, hash(ticket))
+ u, _ := url.Parse(p.RedirectURI)
+ q := u.Query()
+ q.Set("state", p.State)
+ q.Set("iss", s.data.Config.PublicURL)
+ if approve {
+ for key, code := range s.codes {
+ if !s.now().Before(code.Expires) {
+ delete(s.codes, key)
+ }
+ }
+ if len(s.codes) >= maxPending {
+ return "", ErrInvalid
+ }
+ code := random()
+ p.Expires = s.now().Add(2 * time.Minute)
+ s.codes[hash(code)] = p
+ q.Set("code", code)
+ } else {
+ q.Set("error", "access_denied")
+ }
+ u.RawQuery = q.Encode()
+ return u.String(), nil
+}
+
+func (s *Service) authenticate(req apicontract.MCPOAuthTokenRequest) error {
+ if !s.data.Config.Enabled {
+ return ErrDisabled
+ }
+ c, ok := s.data.Clients[req.ClientID]
+ if !ok || req.ClientSecret == "" || !equal(c.SecretHash, hash(req.ClientSecret)) {
+ return ErrClient
+ }
+ return nil
+}
+
+func validVerifier(v string) bool {
+ if len(v) < 43 || len(v) > 128 {
+ return false
+ }
+ for _, c := range v {
+ if !(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9' || strings.ContainsRune("-._~", c)) {
+ return false
+ }
+ }
+ return true
+}
+
+func (s *Service) Token(req apicontract.MCPOAuthTokenRequest) (ret apicontract.MCPOAuthTokenResponse, err error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if err = s.authenticate(req); err != nil {
+ return
+ }
+ if req.Resource != s.data.Config.PublicURL+"/mcp" {
+ return ret, ErrGrant
+ }
+ next := s.clone()
+ now := s.now().Unix()
+ for id, g := range next.Grants {
+ if g.Expires <= now {
+ delete(next.Grants, id)
+ }
+ }
+ id := ""
+ var g grant
+ switch req.GrantType {
+ case "authorization_code":
+ p, ok := s.codes[hash(req.Code)]
+ if !ok || p.ClientID != req.ClientID || p.RedirectURI != req.RedirectURI || p.Resource != req.Resource || !s.now().Before(p.Expires) || !validVerifier(req.CodeVerifier) || !equal(p.Challenge, hash(req.CodeVerifier)) {
+ return ret, ErrGrant
+ }
+ delete(s.codes, hash(req.Code))
+ if len(next.Grants) >= maxGrants {
+ return ret, ErrGrant
+ }
+ id = random()
+ g = grant{ClientID: req.ClientID, Scope: p.Scope, Expires: s.now().Add(30 * 24 * time.Hour).Unix(), Spent: []string{}}
+ case "refresh_token":
+ if req.RefreshToken == "" {
+ return ret, ErrGrant
+ }
+ digest := hash(req.RefreshToken)
+ for key, candidate := range next.Grants {
+ if candidate.ClientID != req.ClientID {
+ continue
+ }
+ for _, spent := range candidate.Spent {
+ if equal(spent, digest) {
+ delete(next.Grants, key)
+ if err = s.save(next); err != nil {
+ return ret, err
+ }
+ return ret, ErrGrant
+ }
+ }
+ if candidate.RefreshHash != "" && equal(candidate.RefreshHash, digest) {
+ id, g = key, candidate
+ }
+ }
+ if id == "" || len(g.Spent) >= 4096 {
+ return ret, ErrGrant
+ }
+ if req.Scope != "" {
+ narrowed, scopeErr := normalizeScope(req.Scope)
+ if scopeErr != nil || narrowed != g.Scope && narrowed != scope {
+ return ret, ErrGrant
+ }
+ g.Scope = narrowed
+ }
+ g.Spent = append(g.Spent, g.RefreshHash)
+ default:
+ return ret, errors.New("unsupported_grant_type")
+ }
+ ret = apicontract.MCPOAuthTokenResponse{AccessToken: AccessPrefix + random(), TokenType: "Bearer", ExpiresIn: 3600, Scope: g.Scope}
+ if remaining := g.Expires - now; remaining < int64(ret.ExpiresIn) {
+ ret.ExpiresIn = int(remaining)
+ }
+ g.AccessHash, g.AccessExpires = hash(ret.AccessToken), now+int64(ret.ExpiresIn)
+ if strings.Contains(g.Scope, "offline_access") {
+ ret.RefreshToken = "sy-mcp-r." + random()
+ g.RefreshHash = hash(ret.RefreshToken)
+ } else {
+ g.Expires = g.AccessExpires
+ g.RefreshHash = ""
+ }
+ next.Grants[id] = g
+ if err = s.save(next); err != nil {
+ return apicontract.MCPOAuthTokenResponse{}, err
+ }
+ return ret, nil
+}
+
+type AccessInfo struct {
+ ID string
+ Expires time.Time
+ Scope string
+}
+
+func (s *Service) Access(token string) (AccessInfo, error) {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if !s.data.Config.Enabled {
+ return AccessInfo{}, ErrDisabled
+ }
+ digest := hash(token)
+ for id, g := range s.data.Grants {
+ if equal(g.AccessHash, digest) && g.AccessExpires > s.now().Unix() && g.Expires > s.now().Unix() {
+ return AccessInfo{ID: id, Expires: time.Unix(g.AccessExpires, 0), Scope: g.Scope}, nil
+ }
+ }
+ return AccessInfo{}, ErrGrant
+}
+
+func (s *Service) Revoke(req apicontract.MCPOAuthTokenRequest) error {
+ s.mu.Lock()
+ defer s.mu.Unlock()
+ if err := s.authenticate(req); err != nil {
+ return err
+ }
+ if req.Token == "" {
+ return ErrInvalid
+ }
+ next := s.clone()
+ digest, changed := hash(req.Token), false
+ for id, g := range next.Grants {
+ if g.ClientID != req.ClientID {
+ continue
+ }
+ match := equal(g.AccessHash, digest) || equal(g.RefreshHash, digest)
+ for _, spent := range g.Spent {
+ match = match || equal(spent, digest)
+ }
+ if match {
+ delete(next.Grants, id)
+ changed = true
+ }
+ }
+ if changed {
+ return s.save(next)
+ }
+ return nil
+}
diff --git a/kernel/model/mcpoauth/service_test.go b/kernel/model/mcpoauth/service_test.go
new file mode 100644
index 0000000000..4f749432d5
--- /dev/null
+++ b/kernel/model/mcpoauth/service_test.go
@@ -0,0 +1,295 @@
+package mcpoauth
+
+import (
+ "errors"
+ "net/url"
+ "os"
+ "path/filepath"
+ "strings"
+ "sync"
+ "testing"
+ "time"
+
+ "github.com/siyuan-note/siyuan/kernel/apicontract"
+)
+
+func setup(t *testing.T) (*Service, apicontract.MCPOAuthClientSecret) {
+ t.Helper()
+ s, err := Open(filepath.Join(t.TempDir(), "oauth.json"), "epoch")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if s.Status().Enabled {
+ t.Fatal("enabled by default")
+ }
+ if err = s.Configure(apicontract.MCPOAuthConfig{Enabled: true, PublicURL: "https://note.example.com"}); err != nil {
+ t.Fatal(err)
+ }
+ c, err := s.AddClient(apicontract.MCPOAuthClientRequest{Name: "ChatGPT", RedirectURI: "https://chatgpt.com/connector_platform_oauth_redirect"})
+ if err != nil {
+ t.Fatal(err)
+ }
+ return s, c
+}
+
+func authorization(c apicontract.MCPOAuthClientSecret, verifier string) url.Values {
+ return url.Values{"client_id": {c.ID}, "redirect_uri": {c.RedirectURI}, "response_type": {"code"}, "state": {"client-state"}, "code_challenge": {hash(verifier)}, "code_challenge_method": {"S256"}, "resource": {"https://note.example.com/mcp"}, "scope": {"mcp offline_access"}}
+}
+
+func codeRequest(t *testing.T, s *Service, c apicontract.MCPOAuthClientSecret) apicontract.MCPOAuthTokenRequest {
+ t.Helper()
+ verifier := random()
+ ticket, _, err := s.Begin(authorization(c, verifier), "browser")
+ if err != nil {
+ t.Fatal(err)
+ }
+ location, err := s.Consent(ticket, "browser", true)
+ if err != nil {
+ t.Fatal(err)
+ }
+ u, _ := url.Parse(location)
+ if u.Query().Get("state") != "client-state" || u.Query().Get("iss") != "https://note.example.com" {
+ t.Fatal(location)
+ }
+ return apicontract.MCPOAuthTokenRequest{GrantType: "authorization_code", ClientID: c.ID, ClientSecret: c.Secret, Code: u.Query().Get("code"), RedirectURI: c.RedirectURI, CodeVerifier: verifier, Resource: "https://note.example.com/mcp"}
+}
+
+func issue(t *testing.T, s *Service, c apicontract.MCPOAuthClientSecret) apicontract.MCPOAuthTokenResponse {
+ t.Helper()
+ ret, err := s.Token(codeRequest(t, s, c))
+ if err != nil {
+ t.Fatal(err)
+ }
+ return ret
+}
+
+func TestMCPOAuthLifecycle(t *testing.T) {
+ s, c := setup(t)
+ req := codeRequest(t, s, c)
+ token, err := s.Token(req)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = s.Token(req); !errors.Is(err, ErrGrant) {
+ t.Fatal("code replay accepted", err)
+ }
+ identity, err := s.Access(token.AccessToken)
+ if err != nil {
+ t.Fatal(err)
+ }
+ restarted, err := Open(s.path, "epoch")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if id, err := restarted.Access(token.AccessToken); err != nil || id != identity {
+ t.Fatal("restart lost token", err)
+ }
+ refresh := apicontract.MCPOAuthTokenRequest{GrantType: "refresh_token", ClientID: c.ID, ClientSecret: c.Secret, RefreshToken: token.RefreshToken, Resource: req.Resource}
+ rotated, err := restarted.Token(refresh)
+ if err != nil || rotated.RefreshToken == token.RefreshToken {
+ t.Fatal("refresh not rotated", err)
+ }
+ if _, err = restarted.Access(token.AccessToken); err == nil {
+ t.Fatal("old access token survived rotation")
+ }
+ if id, err := restarted.Access(rotated.AccessToken); err != nil || id.ID != identity.ID {
+ t.Fatal("refresh changed grant identity", err)
+ }
+ if _, err = restarted.Token(refresh); !errors.Is(err, ErrGrant) {
+ t.Fatal("refresh replay accepted", err)
+ }
+ if _, err = restarted.Access(rotated.AccessToken); err == nil {
+ t.Fatal("replay did not revoke grant")
+ }
+ bytes, _ := os.ReadFile(s.path)
+ for _, secret := range []string{c.Secret, token.AccessToken, token.RefreshToken, rotated.AccessToken, rotated.RefreshToken, req.Code} {
+ if strings.Contains(string(bytes), secret) {
+ t.Fatal("plaintext credential on disk")
+ }
+ }
+}
+
+func TestMCPOAuthAuthorizationValidation(t *testing.T) {
+ s, c := setup(t)
+ for _, mutation := range []func(url.Values){
+ func(v url.Values) { v.Set("redirect_uri", c.RedirectURI+"/other") },
+ func(v url.Values) { v.Set("code_challenge_method", "plain") },
+ func(v url.Values) { v.Set("code_challenge", "short") },
+ func(v url.Values) { v.Set("resource", "https://other.example/mcp") },
+ func(v url.Values) { v.Set("scope", "admin") },
+ func(v url.Values) { v.Add("client_id", c.ID) },
+ func(v url.Values) { v.Set("response_type", "token") },
+ } {
+ v := authorization(c, random())
+ mutation(v)
+ if err := s.ValidateAuthorization(v); err == nil {
+ t.Fatal("invalid authorization accepted", v)
+ }
+ }
+ ticket, _, err := s.Begin(authorization(c, random()), "browser")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = s.Consent(ticket, "attacker", true); err == nil {
+ t.Fatal("cross-browser consent accepted")
+ }
+ location, err := s.Consent(ticket, "browser", false)
+ if err != nil {
+ t.Fatal(err)
+ }
+ u, _ := url.Parse(location)
+ if u.Query().Get("error") != "access_denied" || u.Query().Get("iss") == "" || u.Query().Get("code") != "" {
+ t.Fatal(location)
+ }
+ if _, err = s.Consent(ticket, "browser", true); err == nil {
+ t.Fatal("consent replay accepted")
+ }
+}
+
+func TestMCPOAuthTokenBinding(t *testing.T) {
+ s, c := setup(t)
+ for _, mutation := range []func(*apicontract.MCPOAuthTokenRequest){
+ func(r *apicontract.MCPOAuthTokenRequest) { r.CodeVerifier = random() },
+ func(r *apicontract.MCPOAuthTokenRequest) { r.Resource += "/other" },
+ func(r *apicontract.MCPOAuthTokenRequest) { r.RedirectURI += "/other" },
+ func(r *apicontract.MCPOAuthTokenRequest) { r.ClientSecret = "wrong" },
+ func(r *apicontract.MCPOAuthTokenRequest) { r.ClientID = "wrong" },
+ } {
+ r := codeRequest(t, s, c)
+ mutation(&r)
+ if _, err := s.Token(r); err == nil {
+ t.Fatal("invalid token binding accepted")
+ }
+ }
+ r := codeRequest(t, s, c)
+ var wg sync.WaitGroup
+ var mu sync.Mutex
+ success := 0
+ for range 8 {
+ wg.Go(func() {
+ if _, err := s.Token(r); err == nil {
+ mu.Lock()
+ success++
+ mu.Unlock()
+ }
+ })
+ }
+ wg.Wait()
+ if success != 1 {
+ t.Fatal("code exchanged more than once", success)
+ }
+}
+
+func TestMCPOAuthRevocationAndConfiguration(t *testing.T) {
+ for _, action := range []string{"revoke", "remove", "all", "disable", "origin", "epoch"} {
+ t.Run(action, func(t *testing.T) {
+ s, c := setup(t)
+ token := issue(t, s, c)
+ var err error
+ switch action {
+ case "revoke":
+ err = s.Revoke(apicontract.MCPOAuthTokenRequest{ClientID: c.ID, ClientSecret: c.Secret, Token: token.RefreshToken})
+ case "remove":
+ err = s.Remove(c.ID, false)
+ case "all":
+ err = s.Remove("", true)
+ case "disable":
+ err = s.Configure(apicontract.MCPOAuthConfig{})
+ case "origin":
+ err = s.Configure(apicontract.MCPOAuthConfig{Enabled: true, PublicURL: "https://other.example"})
+ case "epoch":
+ err = s.EnsureEpoch("changed")
+ }
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = s.Access(token.AccessToken); err == nil {
+ t.Fatal("revoked token accepted")
+ }
+ s, err = Open(s.path, s.data.Epoch)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err = s.Access(token.AccessToken); err == nil {
+ t.Fatal("revoked token restored after restart")
+ }
+ })
+ }
+}
+
+func TestMCPOAuthExpiry(t *testing.T) {
+ s, c := setup(t)
+ now := time.Now()
+ s.now = func() time.Time { return now }
+ r := codeRequest(t, s, c)
+ now = now.Add(3 * time.Minute)
+ if _, err := s.Token(r); err == nil {
+ t.Fatal("expired code accepted")
+ }
+ token := issue(t, s, c)
+ now = now.Add(2 * time.Hour)
+ if _, err := s.Access(token.AccessToken); err == nil {
+ t.Fatal("expired access accepted")
+ }
+ refresh := apicontract.MCPOAuthTokenRequest{GrantType: "refresh_token", ClientID: c.ID, ClientSecret: c.Secret, RefreshToken: token.RefreshToken, Resource: "https://note.example.com/mcp"}
+ if _, err := s.Token(refresh); err != nil {
+ t.Fatal("refresh after access expiry failed", err)
+ }
+ now = now.Add(31 * 24 * time.Hour)
+ if _, err := s.Token(refresh); err == nil {
+ t.Fatal("expired refresh accepted")
+ }
+}
+
+func TestMCPOAuthPersistenceFailureAndCorruption(t *testing.T) {
+ s, c := setup(t)
+ token := issue(t, s, c)
+ before, _ := os.ReadFile(s.path)
+ s.write = func(string, []byte) error { return errors.New("disk failure") }
+ refresh := apicontract.MCPOAuthTokenRequest{GrantType: "refresh_token", ClientID: c.ID, ClientSecret: c.Secret, RefreshToken: token.RefreshToken, Resource: "https://note.example.com/mcp"}
+ if ret, err := s.Token(refresh); err == nil || ret.AccessToken != "" {
+ t.Fatal("unpersisted token issued")
+ }
+ if _, err := s.Access(token.AccessToken); err != nil {
+ t.Fatal("failed save changed memory")
+ }
+ if err := s.Configure(apicontract.MCPOAuthConfig{}); err == nil {
+ t.Fatal("failed config save accepted")
+ }
+ if !s.Status().Enabled {
+ t.Fatal("failed save changed config")
+ }
+ after, _ := os.ReadFile(s.path)
+ if string(before) != string(after) {
+ t.Fatal("failed write changed disk")
+ }
+ for _, content := range []string{`broken`, `{"version":999}`, `{}`} {
+ if err := os.WriteFile(s.path, []byte(content), 0600); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := Open(s.path, "epoch"); err == nil {
+ t.Fatal("corruption accepted")
+ }
+ after, _ = os.ReadFile(s.path)
+ if string(after) != content {
+ t.Fatal("corrupt file overwritten")
+ }
+ }
+}
+
+func TestMCPOAuthURLValidation(t *testing.T) {
+ s, _ := setup(t)
+ for _, origin := range []string{"http://example.com", "https://example.com/path", "https://[email protected]", "https://example.com?evil=1", "https://example.com#fragment", "https://example.com#", "https://"} {
+ if err := s.Configure(apicontract.MCPOAuthConfig{Enabled: true, PublicURL: origin}); err == nil {
+ t.Fatal("unsafe origin", origin)
+ }
+ }
+ if err := s.Configure(apicontract.MCPOAuthConfig{Enabled: true, PublicURL: "https://NOTE.example.com:443/"}); err != nil || s.Status().PublicURL != "https://note.example.com" {
+ t.Fatal("origin normalization", err)
+ }
+ for _, callback := range []string{"javascript:evil", "http://remote.example/callback", "https://example.com/#fragment", "https://[email protected]/callback"} {
+ if _, err := s.AddClient(apicontract.MCPOAuthClientRequest{Name: "client", RedirectURI: callback}); err == nil {
+ t.Fatal("unsafe callback", callback)
+ }
+ }
+}