# elastic/enterprise-search-sharepoint-server-connector architecture

> Architecture diagram of the GitHub repository elastic/enterprise-search-sharepoint-server-connector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/elastic/enterprise-search-sharepoint-server-connector
- Repository: https://github.com/elastic/enterprise-search-sharepoint-server-connector

## Overview

This is an Elastic Workplace Search connector for SharePoint Server. An operator configures and launches a CLI command; full or incremental sync fetches SharePoint records, transforms them into connector documents, queues batches, and indexes them into Workplace Search. Separate commands bootstrap a content source, test connectivity, reconcile deletions, and synchronize document permissions. Full and incremental jobs retain local IDs and checkpoints. Source excerpts establish the sync and client responsibilities; several ancillary command implementations were not sampled, so their links are included only where the README or source index supports them.

Main entry points: [`ees_sharepoint/base_command.py`](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/base_command.py) (Command foundation), [`ees_sharepoint/cli.py`](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/cli.py) (CLI dispatcher), [`ees_sharepoint/incremental_sync_command.py`](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/incremental_sync_command.py) (Incremental sync), [`ees_sharepoint/full_sync_command.py`](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/full_sync_command.py) (Full sync)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Command entry"]
  node_cli["CLI dispatcher<br/>[cli.py]"]
  node_bootstrap["Source bootstrap"]
  node_connectivity["Connection test"]
  node_base["Command foundation<br/>[base_command.py]"]
  node_config["Configuration<br/>[configuration.py]"]
end

subgraph group_sync["Content synchronization"]
  node_schema["Document schema<br/>[schema.py]"]
  node_full["Full sync"]
  node_incremental["Incremental sync"]
  node_fetch["SharePoint extraction<br/>[sync_sharepoint.py]"]
  node_adapter["Document adapter<br/>[adapter.py]"]
  node_extract["Content extraction utilities<br/>[utils.py]"]
  node_queue["Connector queue<br/>[connector_queue.py]"]
  node_index_worker["Index worker"]
end

subgraph group_state["Local state"]
  node_ids[("Document ID storage<br/>[local_storage.py]")]
  node_checkpoint[("Sync checkpoints<br/>[checkpointing.py]")]
end

subgraph group_services["External services"]
  node_sp_client["SharePoint API client"]
  node_es_wrapper["Workplace Search client"]
  node_workplace[("Workplace Search")]
  node_sharepoint[("SharePoint Server")]
end

subgraph group_access["Permissions and cleanup"]
  node_deletion["Deletion reconciliation"]
  node_permission["Permission sync"]
  node_permissions["User-group permissions"]
end

node_operator(("Operator"))

node_operator -->|"runs command"| node_cli
node_cli -->|"dispatches to"| node_bootstrap
node_cli -->|"dispatches to"| node_full
node_cli -->|"dispatches to"| node_incremental
node_cli -->|"dispatches to"| node_deletion
node_cli -->|"dispatches to"| node_permission
node_bootstrap -->|"inherits from"| node_base
node_full -->|"inherits from"| node_base
node_incremental -->|"inherits from"| node_base
node_base -->|"loads"| node_config
node_base -->|"creates"| node_sp_client
node_base -->|"creates"| node_es_wrapper
node_base -->|"creates"| node_ids
node_config -->|"uses"| node_schema
node_full -->|"fetches records"| node_fetch
node_incremental -->|"fetches records"| node_fetch
node_full -->|"creates and signals"| node_queue
node_incremental -->|"creates and signals"| node_queue
node_full -->|"starts consumers"| node_index_worker
node_incremental -->|"starts consumers"| node_index_worker
node_index_worker -->|"consumes batches"| node_queue
node_index_worker -->|"indexes batches"| node_es_wrapper
node_es_wrapper -->|"indexes and deletes"| node_workplace
node_fetch -->|"queries API"| node_sp_client
node_sp_client -->|"sends requests"| node_sharepoint
node_fetch -->|"uses schema"| node_adapter
node_fetch -->|"uses helpers"| node_extract
node_full -->|"loads and saves IDs"| node_ids
node_incremental -->|"loads and saves IDs"| node_ids
node_incremental -->|"reads and sets"| node_checkpoint
node_index_worker -->|"records progress"| node_checkpoint
node_deletion -->|"inherits from"| node_base
node_deletion -->|"checks deleted records"| node_sp_client
node_deletion -->|"deletes documents"| node_es_wrapper
node_permission -->|"inherits from"| node_base
node_permission -->|"fetches users"| node_sp_client
node_permission -->|"uses permission logic"| node_permissions
node_permission -->|"uses checkpoints"| node_checkpoint
node_permission -->|"updates permissions"| node_es_wrapper
node_es_wrapper -->|"manages permissions"| node_workplace
node_cli -->|"dispatches to"| node_connectivity
node_bootstrap -.->|"creates content source"| node_workplace

click node_cli "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/cli.py"
click node_bootstrap "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/bootstrap_command.py"
click node_connectivity "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/test_connectivity.py"
click node_base "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/base_command.py"
click node_config "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/configuration.py"
click node_schema "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/schema.py"
click node_full "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/full_sync_command.py"
click node_incremental "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/incremental_sync_command.py"
click node_fetch "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/sync_sharepoint.py"
click node_sp_client "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/sharepoint_client.py"
click node_adapter "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/adapter.py"
click node_extract "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/utils.py"
click node_queue "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/connector_queue.py"
click node_index_worker "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/sync_enterprise_search.py"
click node_es_wrapper "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/enterprise_search_wrapper.py"
click node_ids "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/local_storage.py"
click node_checkpoint "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/checkpointing.py"
click node_deletion "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/deletion_sync_command.py"
click node_permission "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/permission_sync_command.py"
click node_permissions "https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/usergroup_permissions.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_bootstrap,node_connectivity,node_base,node_config toneBlue
class node_schema,node_full,node_incremental,node_fetch,node_adapter,node_extract,node_queue,node_index_worker toneAmber
class node_ids,node_checkpoint toneMint
class node_sp_client,node_es_wrapper,node_workplace,node_sharepoint toneRose
class node_deletion,node_permission,node_permissions,node_operator toneIndigo
```

## Components

### Command entry

- [CLI dispatcher](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/cli.py): `ees_sharepoint/cli.py`
- [Source bootstrap](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/bootstrap_command.py): `ees_sharepoint/bootstrap_command.py`
- [Connection test](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/test_connectivity.py): `ees_sharepoint/test_connectivity.py`
- [Command foundation](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/base_command.py): `ees_sharepoint/base_command.py`
- [Configuration](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/configuration.py): `ees_sharepoint/configuration.py`

### Content synchronization

- [Document schema](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/schema.py): `ees_sharepoint/schema.py`
- [Full sync](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/full_sync_command.py): `ees_sharepoint/full_sync_command.py`
- [Incremental sync](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/incremental_sync_command.py): `ees_sharepoint/incremental_sync_command.py`
- [SharePoint extraction](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/sync_sharepoint.py): `ees_sharepoint/sync_sharepoint.py`
- [Document adapter](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/adapter.py): `ees_sharepoint/adapter.py`
- [Content extraction utilities](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/utils.py): `ees_sharepoint/utils.py`
- [Connector queue](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/connector_queue.py): `ees_sharepoint/connector_queue.py`
- [Index worker](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/sync_enterprise_search.py): `ees_sharepoint/sync_enterprise_search.py`

### Local state

- [Document ID storage](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/local_storage.py): `ees_sharepoint/local_storage.py`
- [Sync checkpoints](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/checkpointing.py): `ees_sharepoint/checkpointing.py`

### External services

- [SharePoint API client](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/sharepoint_client.py): `ees_sharepoint/sharepoint_client.py`
- [Workplace Search client](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/enterprise_search_wrapper.py): `ees_sharepoint/enterprise_search_wrapper.py`
- **Workplace Search**
- **SharePoint Server**

### Permissions and cleanup

- [Deletion reconciliation](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/deletion_sync_command.py): `ees_sharepoint/deletion_sync_command.py`
- [Permission sync](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/permission_sync_command.py): `ees_sharepoint/permission_sync_command.py`
- [User-group permissions](https://github.com/elastic/enterprise-search-sharepoint-server-connector/blob/main/ees_sharepoint/usergroup_permissions.py): `ees_sharepoint/usergroup_permissions.py`

### Other components

- **Operator**

## Connections

- Operator → CLI dispatcher: runs command (evidence: `README.md`)
- CLI dispatcher → Source bootstrap: dispatches to (evidence: `ees_sharepoint/cli.py`)
- CLI dispatcher → Full sync: dispatches to (evidence: `ees_sharepoint/cli.py`)
- CLI dispatcher → Incremental sync: dispatches to (evidence: `ees_sharepoint/cli.py`)
- CLI dispatcher → Deletion reconciliation: dispatches to (evidence: `ees_sharepoint/cli.py`)
- CLI dispatcher → Permission sync: dispatches to (evidence: `ees_sharepoint/cli.py`)
- Source bootstrap → Command foundation: inherits from (evidence: `ees_sharepoint/bootstrap_command.py`)
- Full sync → Command foundation: inherits from (evidence: `ees_sharepoint/full_sync_command.py`)
- Incremental sync → Command foundation: inherits from (evidence: `ees_sharepoint/incremental_sync_command.py`)
- Command foundation → Configuration: loads (evidence: `ees_sharepoint/base_command.py`)
- Command foundation → SharePoint API client: creates (evidence: `ees_sharepoint/base_command.py`)
- Command foundation → Workplace Search client: creates (evidence: `ees_sharepoint/base_command.py`)
- Command foundation → Document ID storage: creates (evidence: `ees_sharepoint/base_command.py`)
- Configuration → Document schema: uses (evidence: `ees_sharepoint/configuration.py`)
- Full sync → SharePoint extraction: fetches records (evidence: `ees_sharepoint/full_sync_command.py`)
- Incremental sync → SharePoint extraction: fetches records (evidence: `ees_sharepoint/incremental_sync_command.py`)
- Full sync → Connector queue: creates and signals (evidence: `ees_sharepoint/full_sync_command.py`)
- Incremental sync → Connector queue: creates and signals (evidence: `ees_sharepoint/incremental_sync_command.py`)
- Full sync → Index worker: starts consumers (evidence: `ees_sharepoint/full_sync_command.py`)
- Incremental sync → Index worker: starts consumers (evidence: `ees_sharepoint/incremental_sync_command.py`)
- Index worker → Connector queue: consumes batches (evidence: `ees_sharepoint/sync_enterprise_search.py`)
- Index worker → Workplace Search client: indexes batches (evidence: `ees_sharepoint/sync_enterprise_search.py`)
- Workplace Search client → Workplace Search: indexes and deletes (evidence: `ees_sharepoint/enterprise_search_wrapper.py`)
- SharePoint extraction → SharePoint API client: queries API (evidence: `ees_sharepoint/sync_sharepoint.py`)
- SharePoint API client → SharePoint Server: sends requests (evidence: `ees_sharepoint/sharepoint_client.py`)
- SharePoint extraction → Document adapter: uses schema (evidence: `ees_sharepoint/sync_sharepoint.py`)
- SharePoint extraction → Content extraction utilities: uses helpers (evidence: `ees_sharepoint/sync_sharepoint.py`)
- Full sync → Document ID storage: loads and saves IDs (evidence: `ees_sharepoint/full_sync_command.py`)
- Incremental sync → Document ID storage: loads and saves IDs (evidence: `ees_sharepoint/incremental_sync_command.py`)
- Incremental sync → Sync checkpoints: reads and sets (evidence: `ees_sharepoint/incremental_sync_command.py`)
- Index worker → Sync checkpoints: records progress (evidence: `ees_sharepoint/sync_enterprise_search.py`)
- Deletion reconciliation → Command foundation: inherits from (evidence: `ees_sharepoint/deletion_sync_command.py`)
- Deletion reconciliation → SharePoint API client: checks deleted records (evidence: `ees_sharepoint/deletion_sync_command.py`)
- Deletion reconciliation → Workplace Search client: deletes documents (evidence: `ees_sharepoint/deletion_sync_command.py`)
- Permission sync → Command foundation: inherits from (evidence: `ees_sharepoint/permission_sync_command.py`)
- Permission sync → SharePoint API client: fetches users (evidence: `ees_sharepoint/permission_sync_command.py`)
- Permission sync → User-group permissions: uses permission logic (evidence: `ees_sharepoint/permission_sync_command.py`)
- Permission sync → Sync checkpoints: uses checkpoints (evidence: `ees_sharepoint/permission_sync_command.py`)
- Permission sync → Workplace Search client: updates permissions (evidence: `ees_sharepoint/permission_sync_command.py`)
- Workplace Search client → Workplace Search: manages permissions (evidence: `ees_sharepoint/enterprise_search_wrapper.py`)
- CLI dispatcher → Connection test: dispatches to (evidence: `ees_sharepoint/cli.py`)
- Source bootstrap → Workplace Search: creates content source (evidence: `README.md`)
