From bd968832aea7cde5da890e45294d1ec59567bced Mon Sep 17 00:00:00 2001 From: Roman Buryan Date: Fri, 6 Nov 2026 14:27:18 +0300 Subject: [PATCH] =?UTF-8?q?[WORK]=20=D0=9F=D1=80=D0=BE=D1=80=D1=8B=D0=B2:?= =?UTF-8?q?=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D1=8B=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=B8=D0=BC=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8=20Yealink=20=D0=B8=D0=B7=D0=B2=D0=BB=D0=B5=D0=BA=D0=B0?= =?UTF-8?q?=D1=8E=D1=82=D1=81=D1=8F=20=D0=B8=D0=B7=20ProseMirror-JSON;=202?= =?UTF-8?q?5=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=20(audio=20I/O=20+=20?= =?UTF-8?q?=D0=BA=D1=80=D0=BE=D0=BD=D1=88=D1=82=D0=B5=D0=B9=D0=BD=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ops/work/COMPATIBILITY-SOURCE.md | 95 ++- ...-input-and-output-compatibility-lists.yaml | 583 ++++++++++++++++++ .../mounts-bracket-compatibility-lists.yaml | 452 ++++++++++++++ ops/work/tools/fetch_doc_tables.py | 118 ++++ 4 files changed, 1199 insertions(+), 49 deletions(-) create mode 100644 ops/work/compat/raw/audio-input-and-output-compatibility-lists.yaml create mode 100644 ops/work/compat/raw/mounts-bracket-compatibility-lists.yaml create mode 100644 ops/work/tools/fetch_doc_tables.py diff --git a/ops/work/COMPATIBILITY-SOURCE.md b/ops/work/COMPATIBILITY-SOURCE.md index 6f13472..2d53b57 100644 --- a/ops/work/COMPATIBILITY-SOURCE.md +++ b/ops/work/COMPATIBILITY-SOURCE.md @@ -1,65 +1,62 @@ -# Официальные таблицы совместимости Yealink +# Официальные списки совместимости Yealink — как добываем -Дата: 06.11.2026. Источник: **support.yealink.com** (официальные руководства вендора). +Дата: 06.11.2026. Источник: **support.yealink.com** (официальный портал вендора). -## Что нашли +## Прорыв: данные достаются из ProseMirror-JSON -В руководствах Yealink есть раздел **Accessories Compatibility** с таблицей: +Страницы поддержки — **Nuxt SPA**, `web_fetch` и `curl` отдают пустую оболочку. +Но контент лежит в `', html, re.S) + if not m: + return [] + try: + data = json.loads(m.group(1).strip()) + except Exception: + return [] + docs = [] + + def walk(o): + if isinstance(o, str): + s = o.strip() + if s.startswith('{"type":"doc"'): + try: + docs.append(json.loads(s)) + except Exception: + pass + elif isinstance(o, list): + for v in o: + walk(v) + elif isinstance(o, dict): + for v in o.values(): + walk(v) + walk(data) + return docs + + +def text_of(node): + if not isinstance(node, dict): + return "" + if node.get("type") == "text": + return node.get("text", "") + parts = [text_of(c) for c in node.get("content") or []] + return "".join(parts) + + +def tables_of(doc): + """Возвращает список таблиц: [[cell, cell, ...], ...].""" + out = [] + + def walk(n): + if not isinstance(n, dict): + return + if n.get("type") == "table": + rows = [] + for row in n.get("content") or []: + if row.get("type") != "tableRow": + continue + cells = [] + for cell in row.get("content") or []: + cells.append(re.sub(r"\s+", " ", text_of(cell)).strip()) + if cells: + rows.append(cells) + if rows: + out.append(rows) + return + for c in n.get("content") or []: + walk(c) + walk(doc) + return out + + +def main(): + urls = sys.argv[1:] + if not urls: + print("использование: fetch_doc_tables.py [...]") + return 1 + import yaml + os.makedirs(OUT, exist_ok=True) + for url in urls: + html = fetch(url) + docs = prosemirror_docs(html) + slug = url.rstrip("/").split("/")[-2] or "doc" + print("\n=== %s ===" % slug) + print(" документов ProseMirror: %d" % len(docs)) + all_tables = [] + for d in docs: + all_tables += tables_of(d) + print(" таблиц: %d" % len(all_tables)) + for i, t in enumerate(all_tables[:3]): + print(" таблица %d: %d строк" % (i + 1, len(t))) + for row in t[:4]: + print(" ", " | ".join(c[:22] for c in row[:5])) + path = os.path.join(OUT, "raw", "%s.yaml" % re.sub(r"[^a-z0-9-]", "_", slug.lower())) + os.makedirs(os.path.dirname(path), exist_ok=True) + with open(path, "w", encoding="utf-8") as f: + yaml.safe_dump({"source": url, "tables": all_tables}, f, + allow_unicode=True, sort_keys=False, width=200) + print(" сохранено:", path) + return 0 + + +if __name__ == "__main__": + sys.exit(main())