"""Per-kind runners for identity sync targets. A runner is the bridge between the framework (filter, mapping, state tracking) and one downstream system's wire protocol. Public, admin-facing kinds (registered in :data:`RUNNER_REGISTRY`): * ``scim`` — generic SCIM 2.0 client. Bearer token auth. * ``navan`` — Navan SCIM 2.0 preset (api.navan.com/scim/v2). * ``google_schema`` — Google Workspace custom-schema field push. * ``feishu_contact`` — Feishu /contact/v3 directory sync (departments + users in ONE target, two internal phases). Internal helpers (NOT in the registry — admins never pick these): * :class:`DeptSyncRunner` / :class:`FeishuDepartmentRunner` — used internally by the ``feishu_contact`` orchestrator's Phase A to reconcile the dept tree before the user sweep runs. Kept as an importable class for the service layer but never exposed as a top-level sync kind, since "sync HRIS to Feishu" is one logical thing from the admin's perspective and shouldn't be split into two switches. """ from __future__ import annotations from app.domains.identity_sync.runners.base import ( DeptOutcome, DeptSyncRunner, PersonOutcome, RunSummary, SyncRunner, ) from app.domains.identity_sync.runners.feishu_contact import FeishuContactRunner from app.domains.identity_sync.runners.feishu_department import ( FeishuDepartmentRunner, ) from app.domains.identity_sync.runners.google_schema import GoogleSchemaRunner from app.domains.identity_sync.runners.huilianyi import ( HuilianyiDepartmentRunner, HuilianyiRunner, ) from app.domains.identity_sync.runners.netsuite import NetSuiteRunner from app.domains.identity_sync.runners.scim import ScimRunner from app.domains.identity_sync.runners.zoom import ZoomRunner # Public registry: kind → runner class. Navan is a SCIM preset — same # runner class, different default options. ``feishu_contact`` and # ``huilianyi`` are single admin-facing kinds whose sweeps internally # chain a dept phase + a user phase so the admin only sees one target # and one enable switch. RUNNER_REGISTRY: dict[str, type[SyncRunner]] = { "scim": ScimRunner, "navan": ScimRunner, "google_schema": GoogleSchemaRunner, "feishu_contact": FeishuContactRunner, "huilianyi": HuilianyiRunner, "netsuite": NetSuiteRunner, "zoom": ZoomRunner, } __all__ = [ "DeptOutcome", "DeptSyncRunner", "FeishuContactRunner", "FeishuDepartmentRunner", "GoogleSchemaRunner", "HuilianyiDepartmentRunner", "HuilianyiRunner", "NetSuiteRunner", "PersonOutcome", "RUNNER_REGISTRY", "RunSummary", "ScimRunner", "SyncRunner", "ZoomRunner", ]