[30388f42] Infrastructure Hardening: Repaired CE/Connector DB schema, fixed frontend styling build, implemented robust echo shield in worker v2.1.1, and integrated Lead Engine into gateway.
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
import requests
|
||||
import json
|
||||
from getpass import getpass
|
||||
|
||||
def debug_search_databases():
|
||||
print("--- Notion Datenbank Such-Debugger ---")
|
||||
token = getpass("Bitte gib deinen Notion API Key ein (Eingabe wird nicht angezeigt): ")
|
||||
|
||||
if not token:
|
||||
print("\nFehler: Kein Token eingegeben. Abbruch.")
|
||||
return
|
||||
|
||||
print("\n... Sende Suchanfrage an Notion für alle Datenbanken...")
|
||||
|
||||
url = "https://api.notion.com/v1/search"
|
||||
headers = {
|
||||
"Authorization": f"Bearer {token}",
|
||||
"Content-Type": "application/json",
|
||||
"Notion-Version": "2022-06-28"
|
||||
}
|
||||
payload = {
|
||||
"filter": {
|
||||
"value": "database",
|
||||
"property": "object"
|
||||
},
|
||||
"sort": {
|
||||
"direction": "ascending",
|
||||
"timestamp": "last_edited_time"
|
||||
}
|
||||
}
|
||||
|
||||
try:
|
||||
response = requests.post(url, headers=headers, json=payload)
|
||||
response.raise_for_status() # Hebt HTTPError für 4xx/5xx Statuscodes hervor
|
||||
|
||||
results = response.json().get("results", [])
|
||||
|
||||
if not results:
|
||||
print("\nKeine Datenbanken gefunden, auf die die Integration Zugriff hat.")
|
||||
print("Bitte stelle sicher, dass die Integration auf Top-Level-Seiten geteilt ist.")
|
||||
return
|
||||
|
||||
print(f"\nGefundene Datenbanken ({len(results)} insgesamt):")
|
||||
print("--------------------------------------------------")
|
||||
for db in results:
|
||||
db_id = db["id"]
|
||||
db_title_parts = db.get("title", [])
|
||||
db_title = db_title_parts[0].get("plain_text", "(Unbenannt)") if db_title_parts else "(Unbenannt)"
|
||||
print(f"Titel: '{db_title}'\n ID: {db_id}\n")
|
||||
print("--------------------------------------------------")
|
||||
print("Bitte überprüfe die genauen Titel und IDs für 'Projects' und 'All Tasks'.")
|
||||
|
||||
except requests.exceptions.RequestException as e:
|
||||
print(f"\n❌ FEHLER! Fehler bei der Suche nach Datenbanken: {e}")
|
||||
if hasattr(e, 'response') and e.response is not None:
|
||||
print(f"HTTP Status Code: {e.response.status_code}")
|
||||
try:
|
||||
print(f"Antwort des Servers: {json.dumps(e.response.json(), indent=2)}")
|
||||
except:
|
||||
print(f"Antwort des Servers: {e.response.text}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
debug_search_databases()
|
||||
Reference in New Issue
Block a user