Compare commits
2 Commits
9f37af5761
...
0453fdd88a
| Author | SHA1 | Date | |
|---|---|---|---|
| 0453fdd88a | |||
| 9f9e472ada |
@@ -1,3 +1,4 @@
|
||||
# mail_intake
|
||||
|
||||
::: mail_intake
|
||||
- [Mail Intake](mail_intake/)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Mail Intake — provider-agnostic, read-only email ingestion framework.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Mail Intake is a **contract-first library** designed to ingest, parse, and
|
||||
normalize email data from external providers (such as Gmail) into clean,
|
||||
provider-agnostic domain models.
|
||||
@@ -20,9 +24,9 @@ as a first-class module at the package root:
|
||||
The package root acts as a **namespace**, not a facade. Consumers are
|
||||
expected to import functionality explicitly from the appropriate module.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Installation
|
||||
----------------------------------------------------------------------
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
Install using pip:
|
||||
|
||||
@@ -35,9 +39,9 @@ Or with Poetry:
|
||||
Mail Intake is pure Python and has no runtime dependencies beyond those
|
||||
required by the selected provider (for example, Google APIs for Gmail).
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Basic Usage
|
||||
----------------------------------------------------------------------
|
||||
---
|
||||
|
||||
## Quick start
|
||||
|
||||
Minimal Gmail ingestion example (local development):
|
||||
|
||||
@@ -65,27 +69,41 @@ Iterating over threads:
|
||||
for thread in reader.iter_threads("subject:Interview"):
|
||||
print(thread.normalized_subject, len(thread.messages))
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Extensibility Model
|
||||
----------------------------------------------------------------------
|
||||
---
|
||||
|
||||
## Architecture
|
||||
|
||||
Mail Intake is designed to be extensible via **public contracts** exposed
|
||||
through its modules:
|
||||
|
||||
- Users MAY implement their own mail adapters by subclassing
|
||||
``adapters.MailIntakeAdapter``
|
||||
- Users MAY implement their own authentication providers by subclassing
|
||||
``auth.MailIntakeAuthProvider[T]``
|
||||
- Users MAY implement their own credential persistence layers by
|
||||
implementing ``credentials.CredentialStore[T]``
|
||||
- Users MAY implement their own mail adapters by subclassing ``adapters.MailIntakeAdapter``
|
||||
- Users MAY implement their own authentication providers by subclassing ``auth.MailIntakeAuthProvider[T]``
|
||||
- Users MAY implement their own credential persistence layers by implementing ``credentials.CredentialStore[T]``
|
||||
|
||||
Users SHOULD NOT subclass built-in adapter implementations. Built-in
|
||||
adapters (such as Gmail) are reference implementations and may change
|
||||
internally without notice.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Public API Surface
|
||||
----------------------------------------------------------------------
|
||||
**Design Guarantees:**
|
||||
- Read-only access: no mutation of provider state
|
||||
- Provider-agnostic domain models
|
||||
- Explicit configuration and dependency injection
|
||||
- No implicit global state or environment reads
|
||||
- Deterministic, testable behavior
|
||||
- Distributed-safe authentication design
|
||||
|
||||
Mail Intake favors correctness, clarity, and explicitness over convenience
|
||||
shortcuts.
|
||||
|
||||
**Core Philosophy:**
|
||||
`Mail Intake` is built as a **contract-first ingestion pipeline**:
|
||||
1. **Layered Decoupling**: Adapters handle transport, Parsers handle format normalization, and Ingestion orchestrates.
|
||||
2. **Provider Agnosticism**: Domain models and core logic never depend on provider-specific (e.g., Gmail) API internals.
|
||||
3. **Stateless Workflows**: The library functions as a read-only pipe, ensuring side-effect-free ingestion.
|
||||
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
The supported public API consists of the following top-level modules:
|
||||
|
||||
@@ -101,40 +119,7 @@ The supported public API consists of the following top-level modules:
|
||||
Classes and functions should be imported explicitly from these modules.
|
||||
No individual symbols are re-exported at the package root.
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Design Guarantees
|
||||
----------------------------------------------------------------------
|
||||
|
||||
- Read-only access: no mutation of provider state
|
||||
- Provider-agnostic domain models
|
||||
- Explicit configuration and dependency injection
|
||||
- No implicit global state or environment reads
|
||||
- Deterministic, testable behavior
|
||||
- Distributed-safe authentication design
|
||||
|
||||
Mail Intake favors correctness, clarity, and explicitness over convenience
|
||||
shortcuts.
|
||||
|
||||
## Core Philosophy
|
||||
|
||||
`Mail Intake` is built as a **contract-first ingestion pipeline**:
|
||||
|
||||
1. **Layered Decoupling**: Adapters handle transport, Parsers handle format normalization, and Ingestion orchestrates.
|
||||
2. **Provider Agnosticism**: Domain models and core logic never depend on provider-specific (e.g., Gmail) API internals.
|
||||
3. **Stateless Workflows**: The library functions as a read-only pipe, ensuring side-effect-free ingestion.
|
||||
|
||||
## Documentation Design
|
||||
|
||||
Follow these "AI-Native" docstring principles across the codebase:
|
||||
|
||||
### For Humans
|
||||
- **Namespace Clarity**: Always specify which module a class or function belongs to.
|
||||
- **Contract Explanations**: Use the `adapters` and `auth` base classes to explain extension requirements.
|
||||
|
||||
### For LLMs
|
||||
- **Dotted Paths**: Use full dotted paths in docstrings to help agents link concepts across modules.
|
||||
- **Typed Interfaces**: Provide `.pyi` stubs for every public module to ensure perfect context for AI coding tools.
|
||||
- **Canonical Exceptions**: Always use `: description` pairs in `Raises` blocks to enable structured error analysis.
|
||||
---
|
||||
"""
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Mail provider adapter implementations for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This package contains **adapter-layer implementations** responsible for
|
||||
interfacing with external mail providers and exposing a normalized,
|
||||
provider-agnostic contract to the rest of the system.
|
||||
@@ -15,8 +19,14 @@ Provider-specific logic **must not leak** outside of adapter implementations.
|
||||
All parsings, normalizations, and transformations must be handled by downstream
|
||||
components.
|
||||
|
||||
Public adapters exported from this package are considered the supported
|
||||
integration surface for mail providers.
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
MailIntakeAdapter
|
||||
MailIntakeGmailAdapter
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from .base import MailIntakeAdapter
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Mail provider adapter contracts for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the **provider-agnostic adapter interface** used for
|
||||
read-only mail ingestion.
|
||||
|
||||
@@ -17,12 +21,16 @@ class MailIntakeAdapter(ABC):
|
||||
"""
|
||||
Base adapter interface for mail providers.
|
||||
|
||||
This interface defines the minimal contract required to:
|
||||
- Discover messages matching a query
|
||||
- Retrieve full message payloads
|
||||
- Retrieve full thread payloads
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
Adapters are intentionally read-only and must not mutate provider state.
|
||||
- discover messages matching a query
|
||||
- retrieve full message payloads
|
||||
- retrieve full thread payloads
|
||||
|
||||
**Lifecycle:**
|
||||
|
||||
- adapters are intentionally read-only and must not mutate provider state
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -30,21 +38,26 @@ class MailIntakeAdapter(ABC):
|
||||
"""
|
||||
Iterate over lightweight message references matching a query.
|
||||
|
||||
Implementations must yield dictionaries containing at least:
|
||||
- ``message_id``: Provider-specific message identifier
|
||||
- ``thread_id``: Provider-specific thread identifier
|
||||
|
||||
Args:
|
||||
query: Provider-specific query string used to filter messages.
|
||||
query (str):
|
||||
Provider-specific query string used to filter messages.
|
||||
|
||||
Yields:
|
||||
Dictionaries containing message and thread identifiers.
|
||||
Dict[str, str]:
|
||||
Dictionaries containing message and thread identifiers.
|
||||
|
||||
Example yield:
|
||||
{
|
||||
"message_id": "...",
|
||||
"thread_id": "..."
|
||||
}
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``
|
||||
|
||||
Example:
|
||||
Typical yield:
|
||||
|
||||
{
|
||||
"message_id": "...",
|
||||
"thread_id": "..."
|
||||
}
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -54,11 +67,12 @@ class MailIntakeAdapter(ABC):
|
||||
Fetch a full raw message by message identifier.
|
||||
|
||||
Args:
|
||||
message_id: Provider-specific message identifier.
|
||||
message_id (str):
|
||||
Provider-specific message identifier.
|
||||
|
||||
Returns:
|
||||
Provider-native message payload
|
||||
(e.g., Gmail message JSON structure).
|
||||
Dict[str, Any]:
|
||||
Provider-native message payload (e.g., Gmail message JSON structure).
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -68,9 +82,11 @@ class MailIntakeAdapter(ABC):
|
||||
Fetch a full raw thread by thread identifier.
|
||||
|
||||
Args:
|
||||
thread_id: Provider-specific thread identifier.
|
||||
thread_id (str):
|
||||
Provider-specific thread identifier.
|
||||
|
||||
Returns:
|
||||
Provider-native thread payload.
|
||||
Dict[str, Any]:
|
||||
Provider-native thread payload.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Gmail adapter implementation for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides a **Gmail-specific implementation** of the
|
||||
`MailIntakeAdapter` contract.
|
||||
|
||||
@@ -30,15 +34,18 @@ class MailIntakeGmailAdapter(MailIntakeAdapter):
|
||||
Gmail REST API. It translates the generic mail intake contract into
|
||||
Gmail-specific API calls.
|
||||
|
||||
This class is the ONLY place where:
|
||||
- googleapiclient is imported
|
||||
- Gmail REST semantics are known
|
||||
- .execute() is called
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
Design constraints:
|
||||
- Must remain thin and imperative
|
||||
- Must not perform parsing or interpretation
|
||||
- Must not expose Gmail-specific types beyond this class
|
||||
- This class is the ONLY place where googleapiclient is imported
|
||||
- Gmail REST semantics are known
|
||||
- .execute() is called
|
||||
|
||||
**Constraints:**
|
||||
|
||||
- Must remain thin and imperative
|
||||
- Must not perform parsing or interpretation
|
||||
- Must not expose Gmail-specific types beyond this class
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@@ -50,9 +57,11 @@ class MailIntakeGmailAdapter(MailIntakeAdapter):
|
||||
Initialize the Gmail adapter.
|
||||
|
||||
Args:
|
||||
auth_provider: Authentication provider capable of supplying
|
||||
valid Gmail API credentials.
|
||||
user_id: Gmail user identifier. Defaults to `"me"`.
|
||||
auth_provider (MailIntakeAuthProvider):
|
||||
Authentication provider capable of supplying valid Gmail API credentials.
|
||||
|
||||
user_id (str):
|
||||
Gmail user identifier. Defaults to `"me"`.
|
||||
"""
|
||||
self._auth_provider = auth_provider
|
||||
self._user_id = user_id
|
||||
@@ -64,10 +73,12 @@ class MailIntakeGmailAdapter(MailIntakeAdapter):
|
||||
Lazily initialize and return the Gmail API service client.
|
||||
|
||||
Returns:
|
||||
Initialized Gmail API service instance.
|
||||
Any:
|
||||
Initialized Gmail API service instance.
|
||||
|
||||
Raises:
|
||||
MailIntakeAdapterError: If the Gmail service cannot be initialized.
|
||||
MailIntakeAdapterError:
|
||||
If the Gmail service cannot be initialized.
|
||||
"""
|
||||
if self._service is None:
|
||||
try:
|
||||
@@ -84,15 +95,16 @@ class MailIntakeGmailAdapter(MailIntakeAdapter):
|
||||
Iterate over message references matching the query.
|
||||
|
||||
Args:
|
||||
query: Gmail search query string.
|
||||
query (str):
|
||||
Gmail search query string.
|
||||
|
||||
Yields:
|
||||
Dictionaries containing:
|
||||
- ``message_id``: Gmail message ID
|
||||
- ``thread_id``: Gmail thread ID
|
||||
Dict[str, str]:
|
||||
Dictionaries containing ``message_id`` and ``thread_id``.
|
||||
|
||||
Raises:
|
||||
MailIntakeAdapterError: If the Gmail API returns an error.
|
||||
MailIntakeAdapterError:
|
||||
If the Gmail API returns an error.
|
||||
"""
|
||||
try:
|
||||
request = (
|
||||
@@ -126,13 +138,16 @@ class MailIntakeGmailAdapter(MailIntakeAdapter):
|
||||
Fetch a full Gmail message by message ID.
|
||||
|
||||
Args:
|
||||
message_id: Gmail message identifier.
|
||||
message_id (str):
|
||||
Gmail message identifier.
|
||||
|
||||
Returns:
|
||||
Provider-native Gmail message payload.
|
||||
Dict[str, Any]:
|
||||
Provider-native Gmail message payload.
|
||||
|
||||
Raises:
|
||||
MailIntakeAdapterError: If the Gmail API returns an error.
|
||||
MailIntakeAdapterError:
|
||||
If the Gmail API returns an error.
|
||||
"""
|
||||
try:
|
||||
return (
|
||||
@@ -151,13 +166,16 @@ class MailIntakeGmailAdapter(MailIntakeAdapter):
|
||||
Fetch a full Gmail thread by thread ID.
|
||||
|
||||
Args:
|
||||
thread_id: Gmail thread identifier.
|
||||
thread_id (str):
|
||||
Gmail thread identifier.
|
||||
|
||||
Returns:
|
||||
Provider-native Gmail thread payload.
|
||||
Dict[str, Any]:
|
||||
Provider-native Gmail thread payload.
|
||||
|
||||
Raises:
|
||||
MailIntakeAdapterError: If the Gmail API returns an error.
|
||||
MailIntakeAdapterError:
|
||||
If the Gmail API returns an error.
|
||||
"""
|
||||
try:
|
||||
return (
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Authentication provider implementations for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This package defines the **authentication layer** used by mail adapters
|
||||
to obtain provider-specific credentials.
|
||||
|
||||
@@ -15,6 +19,15 @@ Authentication providers:
|
||||
|
||||
Consumers should depend on the abstract interface and use concrete
|
||||
implementations only where explicitly required.
|
||||
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
MailIntakeAuthProvider
|
||||
MailIntakeGoogleAuth
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from .base import MailIntakeAuthProvider
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Authentication provider contracts for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the **authentication abstraction layer** used by mail
|
||||
adapters to obtain provider-specific credentials.
|
||||
|
||||
@@ -23,15 +27,18 @@ class MailIntakeAuthProvider(ABC, Generic[T]):
|
||||
providers and mail adapters by requiring providers to explicitly
|
||||
declare the type of credentials they return.
|
||||
|
||||
Authentication providers encapsulate all logic required to:
|
||||
- Acquire credentials from an external provider
|
||||
- Refresh or revalidate credentials as needed
|
||||
- Handle authentication-specific failure modes
|
||||
- Coordinate with credential persistence layers where applicable
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
Mail adapters must treat returned credentials as opaque and
|
||||
provider-specific, relying only on the declared credential type
|
||||
expected by the adapter.
|
||||
- Acquire credentials from an external provider
|
||||
- Refresh or revalidate credentials as needed
|
||||
- Handle authentication-specific failure modes
|
||||
- Coordinate with credential persistence layers where applicable
|
||||
|
||||
**Constraints:**
|
||||
|
||||
- Mail adapters must treat returned credentials as opaque and provider-specific
|
||||
- Mail adapters rely only on the declared credential type expected by the adapter
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -39,21 +46,21 @@ class MailIntakeAuthProvider(ABC, Generic[T]):
|
||||
"""
|
||||
Retrieve valid, provider-specific credentials.
|
||||
|
||||
This method is synchronous by design and represents the sole
|
||||
entry point through which adapters obtain authentication
|
||||
material.
|
||||
|
||||
Implementations must either return credentials of the declared
|
||||
type ``T`` that are valid at the time of return or raise an
|
||||
authentication-specific exception.
|
||||
|
||||
Returns:
|
||||
Credentials of type ``T`` suitable for immediate use by the
|
||||
corresponding mail adapter.
|
||||
T:
|
||||
Credentials of type ``T`` suitable for immediate use by the
|
||||
corresponding mail adapter.
|
||||
|
||||
Raises:
|
||||
Exception:
|
||||
An authentication-specific exception indicating that
|
||||
credentials could not be obtained or validated.
|
||||
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- This method is synchronous by design
|
||||
- Represents the sole entry point through which adapters obtain authentication material
|
||||
- Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Google authentication provider implementation for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides a **Google OAuth–based authentication provider**
|
||||
used primarily for Gmail access.
|
||||
|
||||
@@ -33,13 +37,17 @@ class MailIntakeGoogleAuth(MailIntakeAuthProvider):
|
||||
This provider implements the `MailIntakeAuthProvider` interface using
|
||||
Google's OAuth 2.0 flow and credential management libraries.
|
||||
|
||||
Responsibilities:
|
||||
- Load cached credentials from a credential store when available
|
||||
- Refresh expired credentials when possible
|
||||
- Initiate an interactive OAuth flow only when required
|
||||
- Persist refreshed or newly obtained credentials via the store
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
This class is synchronous by design and maintains a minimal internal state.
|
||||
- Load cached credentials from a credential store when available
|
||||
- Refresh expired credentials when possible
|
||||
- Initiate an interactive OAuth flow only when required
|
||||
- Persist refreshed or newly obtained credentials via the store
|
||||
|
||||
**Guarantees:**
|
||||
|
||||
- This class is synchronous by design and maintains a minimal internal state
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@@ -52,15 +60,13 @@ class MailIntakeGoogleAuth(MailIntakeAuthProvider):
|
||||
Initialize the Google authentication provider.
|
||||
|
||||
Args:
|
||||
credentials_path:
|
||||
Path to the Google OAuth client secrets file used to
|
||||
initiate the OAuth 2.0 flow.
|
||||
credentials_path (str):
|
||||
Path to the Google OAuth client secrets file used to initiate the OAuth 2.0 flow.
|
||||
|
||||
store:
|
||||
Credential store responsible for persisting and
|
||||
retrieving Google OAuth credentials.
|
||||
store (CredentialStore[Credentials]):
|
||||
Credential store responsible for persisting and retrieving Google OAuth credentials.
|
||||
|
||||
scopes:
|
||||
scopes (Sequence[str]):
|
||||
OAuth scopes required for Gmail access.
|
||||
"""
|
||||
self.credentials_path = credentials_path
|
||||
@@ -71,19 +77,23 @@ class MailIntakeGoogleAuth(MailIntakeAuthProvider):
|
||||
"""
|
||||
Retrieve valid Google OAuth credentials.
|
||||
|
||||
This method attempts to:
|
||||
1. Load cached credentials from the configured credential store
|
||||
2. Refresh expired credentials when possible
|
||||
3. Perform an interactive OAuth login as a fallback
|
||||
4. Persist valid credentials for future use
|
||||
|
||||
Returns:
|
||||
A ``google.oauth2.credentials.Credentials`` instance suitable
|
||||
for use with Google API clients.
|
||||
Credentials:
|
||||
A ``google.oauth2.credentials.Credentials`` instance suitable
|
||||
for use with Google API clients.
|
||||
|
||||
Raises:
|
||||
MailIntakeAuthError: If credentials cannot be loaded, refreshed,
|
||||
MailIntakeAuthError:
|
||||
If credentials cannot be loaded, refreshed,
|
||||
or obtained via interactive authentication.
|
||||
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- Load cached credentials from the configured credential store
|
||||
- Refresh expired credentials when possible
|
||||
- Perform an interactive OAuth login as a fallback
|
||||
- Persist valid credentials for future use
|
||||
"""
|
||||
creds = self.store.load()
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Global configuration models for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the **top-level configuration object** used to control
|
||||
mail ingestion behavior across adapters, authentication providers, and
|
||||
ingestion workflows.
|
||||
@@ -18,28 +22,37 @@ class MailIntakeConfig:
|
||||
"""
|
||||
Global configuration for mail-intake.
|
||||
|
||||
This configuration is intentionally explicit and immutable.
|
||||
No implicit environment reads or global state.
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
Design principles:
|
||||
- Immutable once constructed
|
||||
- Explicit configuration over implicit defaults
|
||||
- No direct environment or filesystem access
|
||||
|
||||
This model is safe to pass across layers and suitable for serialization.
|
||||
- This configuration is intentionally explicit and immutable
|
||||
- No implicit environment reads or global state
|
||||
- Explicit configuration over implicit defaults
|
||||
- No direct environment or filesystem access
|
||||
- This model is safe to pass across layers and suitable for serialization
|
||||
"""
|
||||
|
||||
provider: str = "gmail"
|
||||
"""Identifier of the mail provider to use (e.g., ``"gmail"``)."""
|
||||
"""
|
||||
Identifier of the mail provider to use (e.g., ``"gmail"``).
|
||||
"""
|
||||
|
||||
user_id: str = "me"
|
||||
"""Provider-specific user identifier. Defaults to the authenticated user."""
|
||||
"""
|
||||
Provider-specific user identifier. Defaults to the authenticated user.
|
||||
"""
|
||||
|
||||
readonly: bool = True
|
||||
"""Whether ingestion should operate in read-only mode."""
|
||||
"""
|
||||
Whether ingestion should operate in read-only mode.
|
||||
"""
|
||||
|
||||
credentials_path: Optional[str] = None
|
||||
"""Optional path to provider credentials configuration."""
|
||||
"""
|
||||
Optional path to provider credentials configuration.
|
||||
"""
|
||||
|
||||
token_path: Optional[str] = None
|
||||
"""Optional path to persisted authentication tokens."""
|
||||
"""
|
||||
Optional path to persisted authentication tokens.
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Credential persistence interfaces and implementations for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This package defines the abstractions and concrete implementations used
|
||||
to persist authentication credentials across Mail Intake components.
|
||||
|
||||
@@ -16,6 +20,16 @@ The package provides:
|
||||
|
||||
Credential lifecycle management, interpretation, and security policy
|
||||
decisions remain the responsibility of authentication providers.
|
||||
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
CredentialStore
|
||||
PickleCredentialStore
|
||||
RedisCredentialStore
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from mail_intake.credentials.store import CredentialStore
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Local filesystem–based credential persistence for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides a file-backed implementation of the
|
||||
``CredentialStore`` abstraction using Python's ``pickle`` module.
|
||||
|
||||
@@ -29,13 +33,16 @@ class PickleCredentialStore(CredentialStore[T]):
|
||||
filesystem. It is a simple implementation intended primarily for
|
||||
development, testing, and single-process execution contexts.
|
||||
|
||||
This implementation:
|
||||
- Stores credentials on the local filesystem
|
||||
- Uses pickle for serialization and deserialization
|
||||
- Does not provide encryption, locking, or concurrency guarantees
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
Credential lifecycle management, validation, and refresh logic are
|
||||
explicitly out of scope for this class.
|
||||
- Stores credentials on the local filesystem
|
||||
- Uses pickle for serialization and deserialization
|
||||
- Does not provide encryption, locking, or concurrency guarantees
|
||||
|
||||
**Constraints:**
|
||||
|
||||
- Credential lifecycle management, validation, and refresh logic are explicitly out of scope for this class
|
||||
"""
|
||||
|
||||
def __init__(self, path: str):
|
||||
@@ -43,7 +50,7 @@ class PickleCredentialStore(CredentialStore[T]):
|
||||
Initialize a pickle-backed credential store.
|
||||
|
||||
Args:
|
||||
path:
|
||||
path (str):
|
||||
Filesystem path where credentials will be stored.
|
||||
The file will be created or overwritten as needed.
|
||||
"""
|
||||
@@ -53,15 +60,16 @@ class PickleCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Load credentials from the local filesystem.
|
||||
|
||||
If the credential file does not exist or cannot be successfully
|
||||
deserialized, this method returns ``None``.
|
||||
|
||||
The store does not attempt to validate or interpret the returned
|
||||
credentials.
|
||||
|
||||
Returns:
|
||||
An instance of type ``T`` if credentials are present and
|
||||
successfully deserialized; otherwise ``None``.
|
||||
Optional[T]:
|
||||
An instance of type ``T`` if credentials are present and
|
||||
successfully deserialized; otherwise ``None``.
|
||||
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- If the credential file does not exist or cannot be successfully deserialized, this method returns ``None``
|
||||
- The store does not attempt to validate or interpret the returned credentials
|
||||
"""
|
||||
try:
|
||||
with open(self.path, "rb") as fh:
|
||||
@@ -73,12 +81,14 @@ class PickleCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Persist credentials to the local filesystem.
|
||||
|
||||
Any previously stored credentials at the configured path are
|
||||
overwritten.
|
||||
|
||||
Args:
|
||||
credentials:
|
||||
credentials (T):
|
||||
The credential object to persist.
|
||||
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
- Any previously stored credentials at the configured path are overwritten
|
||||
"""
|
||||
with open(self.path, "wb") as fh:
|
||||
pickle.dump(credentials, fh)
|
||||
@@ -87,8 +97,10 @@ class PickleCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Remove persisted credentials from the local filesystem.
|
||||
|
||||
This method deletes the credential file if it exists and should
|
||||
be treated as an idempotent operation.
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- This method deletes the credential file if it exists and should be treated as an idempotent operation
|
||||
"""
|
||||
import os
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Redis-backed credential persistence for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides a Redis-based implementation of the
|
||||
``CredentialStore`` abstraction, enabling credential persistence
|
||||
across distributed and horizontally scaled deployments.
|
||||
@@ -37,14 +41,16 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
distributed and horizontally scaled deployments where credentials
|
||||
must be shared across multiple processes or nodes.
|
||||
|
||||
The store is intentionally generic and delegates all serialization
|
||||
concerns to caller-provided functions. This avoids unsafe mechanisms
|
||||
such as pickle and allows credential formats to be explicitly
|
||||
controlled and audited.
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
This class is responsible only for persistence and retrieval.
|
||||
It does not interpret, validate, refresh, or otherwise manage
|
||||
the lifecycle of the credentials being stored.
|
||||
- This class is responsible only for persistence and retrieval
|
||||
- It does not interpret, validate, refresh, or otherwise manage the lifecycle of the credentials being stored
|
||||
|
||||
**Guarantees:**
|
||||
|
||||
- The store is intentionally generic and delegates all serialization concerns to caller-provided functions
|
||||
- This avoids unsafe mechanisms such as pickle and allows credential formats to be explicitly controlled and audited
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
@@ -59,31 +65,20 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
Initialize a Redis-backed credential store.
|
||||
|
||||
Args:
|
||||
redis_client:
|
||||
An initialized Redis client instance (for example,
|
||||
``redis.Redis`` or a compatible interface) used to
|
||||
communicate with the Redis server.
|
||||
redis_client (Any):
|
||||
An initialized Redis client instance (for example, ``redis.Redis`` or a compatible interface) used to communicate with the Redis server.
|
||||
|
||||
key:
|
||||
The Redis key under which credentials are stored.
|
||||
Callers are responsible for applying appropriate
|
||||
namespacing to avoid collisions.
|
||||
key (str):
|
||||
The Redis key under which credentials are stored. Callers are responsible for applying appropriate namespacing to avoid collisions.
|
||||
|
||||
serialize:
|
||||
A callable that converts a credential object of type
|
||||
``T`` into a ``bytes`` representation suitable for
|
||||
storage in Redis.
|
||||
serialize (Callable[[T], bytes]):
|
||||
A callable that converts a credential object of type ``T`` into a ``bytes`` representation suitable for storage in Redis.
|
||||
|
||||
deserialize:
|
||||
A callable that converts a ``bytes`` payload retrieved
|
||||
from Redis back into a credential object of type ``T``.
|
||||
deserialize (Callable[[bytes], T]):
|
||||
A callable that converts a ``bytes`` payload retrieved from Redis back into a credential object of type ``T``.
|
||||
|
||||
ttl_seconds:
|
||||
Optional time-to-live (TTL) for the stored credentials,
|
||||
expressed in seconds. When provided, Redis will
|
||||
automatically expire the stored credentials after the
|
||||
specified duration. If ``None``, credentials are stored
|
||||
without an expiration.
|
||||
ttl_seconds (Optional[int]):
|
||||
Optional time-to-live (TTL) for the stored credentials, expressed in seconds. When provided, Redis will automatically expire the stored credentials after the specified duration. If ``None``, credentials are stored without an expiration.
|
||||
"""
|
||||
self.redis = redis_client
|
||||
self.key = key
|
||||
@@ -95,16 +90,16 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Load credentials from Redis.
|
||||
|
||||
If no value exists for the configured key, or if the stored
|
||||
payload cannot be successfully deserialized, this method
|
||||
returns ``None``.
|
||||
|
||||
The store does not attempt to validate the returned credentials
|
||||
or determine whether they are expired or otherwise usable.
|
||||
|
||||
Returns:
|
||||
An instance of type ``T`` if credentials are present and
|
||||
successfully deserialized; otherwise ``None``.
|
||||
Optional[T]:
|
||||
An instance of type ``T`` if credentials are present and
|
||||
successfully deserialized; otherwise ``None``.
|
||||
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- If no value exists for the configured key, or if the stored payload cannot be successfully deserialized, this method returns ``None``
|
||||
- The store does not attempt to validate the returned credentials or determine whether they are expired or otherwise usable
|
||||
"""
|
||||
raw = self.redis.get(self.key)
|
||||
if not raw:
|
||||
@@ -118,13 +113,15 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Persist credentials to Redis.
|
||||
|
||||
Any previously stored credentials under the same key are
|
||||
overwritten. If a TTL is configured, the credentials will
|
||||
expire automatically after the specified duration.
|
||||
|
||||
Args:
|
||||
credentials:
|
||||
credentials (T):
|
||||
The credential object to persist.
|
||||
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
- Any previously stored credentials under the same key are overwritten
|
||||
- If a TTL is configured, the credentials will expire automatically after the specified duration
|
||||
"""
|
||||
payload = self.serialize(credentials)
|
||||
if self.ttl_seconds:
|
||||
@@ -136,7 +133,10 @@ class RedisCredentialStore(CredentialStore[T]):
|
||||
"""
|
||||
Remove stored credentials from Redis.
|
||||
|
||||
This operation deletes the configured Redis key if it exists.
|
||||
Implementations should treat this method as idempotent.
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- This operation deletes the configured Redis key if it exists
|
||||
- Implementations should treat this method as idempotent
|
||||
"""
|
||||
self.redis.delete(self.key)
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Credential persistence abstractions for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the generic persistence contract used to store and
|
||||
retrieve authentication credentials across Mail Intake components.
|
||||
|
||||
@@ -29,16 +33,18 @@ class CredentialStore(ABC, Generic[T]):
|
||||
Abstract base class defining a generic persistence interface for
|
||||
authentication credentials.
|
||||
|
||||
This interface separates *credential lifecycle management* from
|
||||
*credential storage mechanics*. Implementations are responsible
|
||||
only for persistence concerns, while authentication providers
|
||||
retain full control over credential creation, validation, refresh,
|
||||
and revocation logic.
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
The store is intentionally agnostic to:
|
||||
- The concrete credential type being stored
|
||||
- The serialization format used to persist credentials
|
||||
- The underlying storage backend or durability guarantees
|
||||
- Provide persistent storage separating life-cycle management from storage mechanics
|
||||
- Keep implementation focused only on persistence
|
||||
|
||||
**Constraints:**
|
||||
|
||||
- The store is intentionally agnostic to:
|
||||
- The concrete credential type being stored
|
||||
- The serialization format used to persist credentials
|
||||
- The underlying storage backend or durability guarantees
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -46,16 +52,16 @@ class CredentialStore(ABC, Generic[T]):
|
||||
"""
|
||||
Load previously persisted credentials.
|
||||
|
||||
Implementations should return ``None`` when no credentials are
|
||||
present or when stored credentials cannot be successfully
|
||||
decoded or deserialized.
|
||||
|
||||
The store must not attempt to validate, refresh, or otherwise
|
||||
interpret the returned credentials.
|
||||
|
||||
Returns:
|
||||
An instance of type ``T`` if credentials are available and
|
||||
loadable; otherwise ``None``.
|
||||
Optional[T]:
|
||||
An instance of type ``T`` if credentials are available and
|
||||
loadable; otherwise ``None``.
|
||||
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized
|
||||
- The store must not attempt to validate, refresh, or otherwise interpret the returned credentials
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -63,18 +69,20 @@ class CredentialStore(ABC, Generic[T]):
|
||||
"""
|
||||
Persist credentials to the underlying storage backend.
|
||||
|
||||
This method is invoked when credentials are newly obtained or
|
||||
have been refreshed and are known to be valid at the time of
|
||||
persistence.
|
||||
|
||||
Implementations are responsible for:
|
||||
- Ensuring durability appropriate to the deployment context
|
||||
- Applying encryption or access controls where required
|
||||
- Overwriting any previously stored credentials
|
||||
|
||||
Args:
|
||||
credentials:
|
||||
credentials (T):
|
||||
The credential object to persist.
|
||||
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence
|
||||
|
||||
**Responsibilities:**
|
||||
|
||||
- Ensuring durability appropriate to the deployment context
|
||||
- Applying encryption or access controls where required
|
||||
- Overwriting any previously stored credentials
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
@@ -82,9 +90,13 @@ class CredentialStore(ABC, Generic[T]):
|
||||
"""
|
||||
Remove any persisted credentials from the store.
|
||||
|
||||
This method is called when credentials are known to be invalid,
|
||||
revoked, corrupted, or otherwise unusable, and must ensure that
|
||||
no stale authentication material remains accessible.
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
Implementations should treat this operation as idempotent.
|
||||
- This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable
|
||||
- Must ensure that no stale authentication material remains accessible
|
||||
|
||||
**Guarantees:**
|
||||
|
||||
- Implementations should treat this operation as idempotent
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Exception hierarchy for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the **canonical exception types** used throughout the
|
||||
Mail Intake library.
|
||||
|
||||
@@ -14,11 +18,12 @@ class MailIntakeError(Exception):
|
||||
"""
|
||||
Base exception for all Mail Intake errors.
|
||||
|
||||
This is the root of the Mail Intake exception hierarchy.
|
||||
All errors raised by the library must derive from this class.
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
Consumers should generally catch this type when handling
|
||||
library-level failures.
|
||||
- This is the root of the Mail Intake exception hierarchy
|
||||
- All errors raised by the library must derive from this class
|
||||
- Consumers should generally catch this type when handling library-level failures
|
||||
"""
|
||||
|
||||
|
||||
@@ -26,8 +31,10 @@ class MailIntakeAuthError(MailIntakeError):
|
||||
"""
|
||||
Authentication and credential-related failures.
|
||||
|
||||
Raised when authentication providers are unable to acquire,
|
||||
refresh, or persist valid credentials.
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- Raised when authentication providers are unable to acquire, refresh, or persist valid credentials
|
||||
"""
|
||||
|
||||
|
||||
@@ -35,8 +42,10 @@ class MailIntakeAdapterError(MailIntakeError):
|
||||
"""
|
||||
Errors raised by mail provider adapters.
|
||||
|
||||
Raised when a provider adapter encounters API errors,
|
||||
transport failures, or invalid provider responses.
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- Raised when a provider adapter encounters API errors, transport failures, or invalid provider responses
|
||||
"""
|
||||
|
||||
|
||||
@@ -44,6 +53,8 @@ class MailIntakeParsingError(MailIntakeError):
|
||||
"""
|
||||
Errors encountered while parsing message content.
|
||||
|
||||
Raised when raw provider payloads cannot be interpreted
|
||||
or normalized into internal domain models.
|
||||
Notes:
|
||||
**Lifecycle:**
|
||||
|
||||
- Raised when raw provider payloads cannot be interpreted or normalized into internal domain models
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Mail ingestion orchestration for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This package contains **high-level ingestion components** responsible for
|
||||
coordinating mail retrieval, parsing, normalization, and model construction.
|
||||
|
||||
@@ -15,6 +19,14 @@ Components in this package:
|
||||
|
||||
Consumers are expected to construct a mail adapter and pass it to the
|
||||
ingestion layer to begin processing messages and threads.
|
||||
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
MailIntakeReader
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from .reader import MailIntakeReader
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
High-level mail ingestion orchestration for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides the primary, provider-agnostic entry point for
|
||||
reading and processing mail data.
|
||||
|
||||
@@ -29,19 +33,15 @@ class MailIntakeReader:
|
||||
"""
|
||||
High-level read-only ingestion interface.
|
||||
|
||||
This class is the **primary entry point** for consumers of the Mail
|
||||
Intake library.
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
It orchestrates the full ingestion pipeline:
|
||||
- Querying the adapter for message references
|
||||
- Fetching raw provider messages
|
||||
- Parsing and normalizing message data
|
||||
- Constructing domain models
|
||||
- This class is the primary entry point for consumers of the Mail Intake library
|
||||
- It orchestrates the full ingestion pipeline: Querying the adapter for message references, fetching raw provider messages, parsing and normalizing message data, constructing domain models
|
||||
|
||||
This class is intentionally:
|
||||
- Provider-agnostic
|
||||
- Stateless beyond iteration scope
|
||||
- Read-only
|
||||
**Constraints:**
|
||||
|
||||
- This class is intentionally: Provider-agnostic, stateless beyond iteration scope, read-only
|
||||
"""
|
||||
|
||||
def __init__(self, adapter: MailIntakeAdapter):
|
||||
@@ -49,8 +49,8 @@ class MailIntakeReader:
|
||||
Initialize the mail reader.
|
||||
|
||||
Args:
|
||||
adapter: Mail adapter implementation used to retrieve raw
|
||||
messages and threads from a mail provider.
|
||||
adapter (MailIntakeAdapter):
|
||||
Mail adapter implementation used to retrieve raw messages and threads from a mail provider.
|
||||
"""
|
||||
self._adapter = adapter
|
||||
|
||||
@@ -59,13 +59,16 @@ class MailIntakeReader:
|
||||
Iterate over parsed messages matching a provider query.
|
||||
|
||||
Args:
|
||||
query: Provider-specific query string used to filter messages.
|
||||
query (str):
|
||||
Provider-specific query string used to filter messages.
|
||||
|
||||
Yields:
|
||||
Fully parsed and normalized `MailIntakeMessage` instances.
|
||||
MailIntakeMessage:
|
||||
Fully parsed and normalized `MailIntakeMessage` instances.
|
||||
|
||||
Raises:
|
||||
MailIntakeParsingError: If a message cannot be parsed.
|
||||
MailIntakeParsingError:
|
||||
If a message cannot be parsed.
|
||||
"""
|
||||
for ref in self._adapter.iter_message_refs(query):
|
||||
raw = self._adapter.fetch_message(ref["message_id"])
|
||||
@@ -75,17 +78,22 @@ class MailIntakeReader:
|
||||
"""
|
||||
Iterate over threads constructed from messages matching a query.
|
||||
|
||||
Messages are grouped by `thread_id` and yielded as complete thread
|
||||
objects containing all associated messages.
|
||||
|
||||
Args:
|
||||
query: Provider-specific query string used to filter messages.
|
||||
query (str):
|
||||
Provider-specific query string used to filter messages.
|
||||
|
||||
Returns:
|
||||
An iterator of `MailIntakeThread` instances.
|
||||
Yields:
|
||||
MailIntakeThread:
|
||||
An iterator of `MailIntakeThread` instances.
|
||||
|
||||
Raises:
|
||||
MailIntakeParsingError: If a message cannot be parsed.
|
||||
MailIntakeParsingError:
|
||||
If a message cannot be parsed.
|
||||
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- Messages are grouped by `thread_id` and yielded as complete thread objects containing all associated messages
|
||||
"""
|
||||
threads: Dict[str, MailIntakeThread] = {}
|
||||
|
||||
@@ -110,14 +118,16 @@ class MailIntakeReader:
|
||||
Parse a raw provider message into a `MailIntakeMessage`.
|
||||
|
||||
Args:
|
||||
raw_message: Provider-native message payload.
|
||||
raw_message (Dict[str, Any]):
|
||||
Provider-native message payload.
|
||||
|
||||
Returns:
|
||||
A fully populated `MailIntakeMessage` instance.
|
||||
MailIntakeMessage:
|
||||
A fully populated `MailIntakeMessage` instance.
|
||||
|
||||
Raises:
|
||||
MailIntakeParsingError: If the message payload is missing required
|
||||
fields or cannot be parsed.
|
||||
MailIntakeParsingError:
|
||||
If the message payload is missing required fields or cannot be parsed.
|
||||
"""
|
||||
try:
|
||||
message_id = raw_message["id"]
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Domain models for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This package defines the **canonical, provider-agnostic data models**
|
||||
used throughout the Mail Intake ingestion pipeline.
|
||||
|
||||
@@ -11,6 +15,15 @@ Models in this package:
|
||||
- Serve as stable inputs for downstream processing and analysis
|
||||
|
||||
These models form the core internal data contract of the library.
|
||||
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
MailIntakeMessage
|
||||
MailIntakeThread
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from .message import MailIntakeMessage
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Message domain models for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the **canonical, provider-agnostic representation**
|
||||
of an individual email message as used internally by the Mail Intake
|
||||
ingestion pipeline.
|
||||
@@ -19,37 +23,58 @@ class MailIntakeMessage:
|
||||
"""
|
||||
Canonical internal representation of a single email message.
|
||||
|
||||
This model represents a fully parsed and normalized email message.
|
||||
It is intentionally provider-agnostic and suitable for persistence,
|
||||
indexing, and downstream processing.
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
No provider-specific identifiers, payloads, or API semantics
|
||||
should appear in this model.
|
||||
- This model represents a fully parsed and normalized email message
|
||||
- It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing
|
||||
|
||||
**Constraints:**
|
||||
|
||||
- No provider-specific identifiers, payloads, or API semantics should appear in this model
|
||||
"""
|
||||
|
||||
message_id: str
|
||||
"""Provider-specific message identifier."""
|
||||
"""
|
||||
Provider-specific message identifier.
|
||||
"""
|
||||
|
||||
thread_id: str
|
||||
"""Provider-specific thread identifier to which this message belongs."""
|
||||
"""
|
||||
Provider-specific thread identifier to which this message belongs.
|
||||
"""
|
||||
|
||||
timestamp: datetime
|
||||
"""Message timestamp as a timezone-naive UTC datetime."""
|
||||
"""
|
||||
Message timestamp as a timezone-naive UTC datetime.
|
||||
"""
|
||||
|
||||
from_email: str
|
||||
"""Sender email address."""
|
||||
"""
|
||||
Sender email address.
|
||||
"""
|
||||
|
||||
from_name: Optional[str]
|
||||
"""Optional human-readable sender name."""
|
||||
"""
|
||||
Optional human-readable sender name.
|
||||
"""
|
||||
|
||||
subject: str
|
||||
"""Raw subject line of the message."""
|
||||
"""
|
||||
Raw subject line of the message.
|
||||
"""
|
||||
|
||||
body_text: str
|
||||
"""Extracted plain-text body content of the message."""
|
||||
"""
|
||||
Extracted plain-text body content of the message.
|
||||
"""
|
||||
|
||||
snippet: str
|
||||
"""Short provider-supplied preview snippet of the message."""
|
||||
"""
|
||||
Short provider-supplied preview snippet of the message.
|
||||
"""
|
||||
|
||||
raw_headers: Dict[str, str]
|
||||
"""Normalized mapping of message headers (header name → value)."""
|
||||
"""
|
||||
Normalized mapping of message headers (header name → value).
|
||||
"""
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Thread domain models for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module defines the **canonical, provider-agnostic representation**
|
||||
of an email thread as used internally by the Mail Intake ingestion pipeline.
|
||||
|
||||
@@ -20,40 +24,53 @@ class MailIntakeThread:
|
||||
"""
|
||||
Canonical internal representation of an email thread.
|
||||
|
||||
A thread groups multiple related messages under a single subject
|
||||
and participant set. It is designed to support reasoning over
|
||||
conversational context such as job applications, interviews,
|
||||
follow-ups, and ongoing discussions.
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
This model is provider-agnostic and safe to persist.
|
||||
- A thread groups multiple related messages under a single subject and participant set
|
||||
- It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions
|
||||
- This model is provider-agnostic and safe to persist
|
||||
"""
|
||||
|
||||
thread_id: str
|
||||
"""Provider-specific thread identifier."""
|
||||
"""
|
||||
Provider-specific thread identifier.
|
||||
"""
|
||||
|
||||
normalized_subject: str
|
||||
"""Normalized subject line used to group related messages."""
|
||||
"""
|
||||
Normalized subject line used to group related messages.
|
||||
"""
|
||||
|
||||
participants: Set[str] = field(default_factory=set)
|
||||
"""Set of unique participant email addresses observed in the thread."""
|
||||
"""
|
||||
Set of unique participant email addresses observed in the thread.
|
||||
"""
|
||||
|
||||
messages: List[MailIntakeMessage] = field(default_factory=list)
|
||||
"""Ordered list of messages belonging to this thread."""
|
||||
"""
|
||||
Ordered list of messages belonging to this thread.
|
||||
"""
|
||||
|
||||
last_activity_at: datetime | None = None
|
||||
"""Timestamp of the most recent message in the thread."""
|
||||
"""
|
||||
Timestamp of the most recent message in the thread.
|
||||
"""
|
||||
|
||||
def add_message(self, message: MailIntakeMessage) -> None:
|
||||
"""
|
||||
Add a message to the thread and update derived fields.
|
||||
|
||||
This method:
|
||||
- Appends the message to the thread
|
||||
- Tracks unique participants
|
||||
- Updates the last activity timestamp
|
||||
|
||||
Args:
|
||||
message: Parsed mail message to add to the thread.
|
||||
message (MailIntakeMessage):
|
||||
Parsed mail message to add to the thread.
|
||||
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
- Appends the message to the thread
|
||||
- Tracks unique participants
|
||||
- Updates the last activity timestamp
|
||||
"""
|
||||
self.messages.append(message)
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Message parsing utilities for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This package contains **provider-aware but adapter-agnostic parsing helpers**
|
||||
used to extract and normalize structured information from raw mail payloads.
|
||||
|
||||
@@ -16,6 +20,17 @@ This package does not:
|
||||
|
||||
Parsing functions are designed to be composable and are orchestrated by the
|
||||
ingestion layer.
|
||||
|
||||
---
|
||||
|
||||
## Public API
|
||||
|
||||
extract_body
|
||||
parse_headers
|
||||
extract_sender
|
||||
normalize_subject
|
||||
|
||||
---
|
||||
"""
|
||||
|
||||
from .body import extract_body
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Message header parsing utilities for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides helper functions for normalizing and extracting
|
||||
useful information from provider-native message headers.
|
||||
|
||||
@@ -15,29 +19,34 @@ def parse_headers(raw_headers: List[Dict[str, str]]) -> Dict[str, str]:
|
||||
"""
|
||||
Convert a list of Gmail-style headers into a normalized dict.
|
||||
|
||||
Provider payloads (such as Gmail) typically represent headers as a list
|
||||
of name/value mappings. This function normalizes them into a
|
||||
case-insensitive dictionary keyed by lowercase header names.
|
||||
|
||||
Args:
|
||||
raw_headers: List of header dictionaries, each containing
|
||||
``name`` and ``value`` keys.
|
||||
raw_headers (List[Dict[str, str]]):
|
||||
List of header dictionaries, each containing ``name`` and ``value`` keys.
|
||||
|
||||
Returns:
|
||||
Dictionary mapping lowercase header names to stripped values.
|
||||
Dict[str, str]:
|
||||
Dictionary mapping lowercase header names to stripped values.
|
||||
|
||||
Notes:
|
||||
**Guarantees:**
|
||||
|
||||
- Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings
|
||||
- This function normalizes them into a case-insensitive dictionary keyed by lowercase header names
|
||||
|
||||
Example:
|
||||
Input:
|
||||
[
|
||||
{"name": "From", "value": "John Doe <john@example.com>"},
|
||||
{"name": "Subject", "value": "Re: Interview Update"},
|
||||
]
|
||||
|
||||
Output:
|
||||
{
|
||||
"from": "John Doe <john@example.com>",
|
||||
"subject": "Re: Interview Update",
|
||||
}
|
||||
Typical usage:
|
||||
|
||||
Input:
|
||||
[
|
||||
{"name": "From", "value": "John Doe <john@example.com>"},
|
||||
{"name": "Subject", "value": "Re: Interview Update"},
|
||||
]
|
||||
|
||||
Output:
|
||||
{
|
||||
"from": "John Doe <john@example.com>",
|
||||
"subject": "Re: Interview Update",
|
||||
}
|
||||
"""
|
||||
headers: Dict[str, str] = {}
|
||||
|
||||
@@ -57,22 +66,24 @@ def extract_sender(headers: Dict[str, str]) -> Tuple[str, Optional[str]]:
|
||||
"""
|
||||
Extract sender email and optional display name from headers.
|
||||
|
||||
This function parses the ``From`` header and attempts to extract:
|
||||
- Sender email address
|
||||
- Optional human-readable display name
|
||||
|
||||
Args:
|
||||
headers: Normalized header dictionary as returned by
|
||||
:func:`parse_headers`.
|
||||
headers (Dict[str, str]):
|
||||
Normalized header dictionary as returned by :func:`parse_headers`.
|
||||
|
||||
Returns:
|
||||
A tuple ``(email, name)`` where:
|
||||
- ``email`` is the sender email address
|
||||
- ``name`` is the display name, or ``None`` if unavailable
|
||||
Tuple[str, Optional[str]]:
|
||||
A tuple ``(email, name)`` where ``email`` is the sender email address and ``name`` is the display name, or ``None`` if unavailable.
|
||||
|
||||
Examples:
|
||||
``"John Doe <john@example.com>"`` → ``("john@example.com", "John Doe")``
|
||||
``"john@example.com"`` → ``("john@example.com", None)``
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
- This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name
|
||||
|
||||
Example:
|
||||
Typical values:
|
||||
|
||||
``"John Doe <john@example.com>"`` -> ``("john@example.com", "John Doe")``
|
||||
``"john@example.com"`` -> ``("john@example.com", None)``
|
||||
"""
|
||||
from_header = headers.get("from")
|
||||
if not from_header:
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
"""
|
||||
Subject line normalization utilities for Mail Intake.
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
This module provides helper functions for normalizing email subject lines
|
||||
to enable reliable thread-level comparison and grouping.
|
||||
|
||||
@@ -12,27 +16,34 @@ import re
|
||||
|
||||
|
||||
_PREFIX_RE = re.compile(r"^(re|fw|fwd)\s*:\s*", re.IGNORECASE)
|
||||
"""Regular expression matching common reply/forward subject prefixes."""
|
||||
"""
|
||||
Regular expression matching common reply/forward subject prefixes.
|
||||
"""
|
||||
|
||||
|
||||
def normalize_subject(subject: str) -> str:
|
||||
"""
|
||||
Normalize an email subject for thread-level comparison.
|
||||
|
||||
Operations:
|
||||
- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``
|
||||
- Repeats prefix stripping to handle stacked prefixes
|
||||
- Collapses excessive whitespace
|
||||
- Preserves original casing (no lowercasing)
|
||||
|
||||
This function is intentionally conservative and avoids aggressive
|
||||
transformations that could alter the semantic meaning of the subject.
|
||||
|
||||
Args:
|
||||
subject: Raw subject line from a message header.
|
||||
subject (str):
|
||||
Raw subject line from a message header.
|
||||
|
||||
Returns:
|
||||
Normalized subject string suitable for thread grouping.
|
||||
str:
|
||||
Normalized subject string suitable for thread grouping.
|
||||
|
||||
Notes:
|
||||
**Responsibilities:**
|
||||
|
||||
- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``
|
||||
- Repeats prefix stripping to handle stacked prefixes
|
||||
- Collapses excessive whitespace
|
||||
- Preserves original casing (no lowercasing)
|
||||
|
||||
**Guarantees:**
|
||||
|
||||
- This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject
|
||||
"""
|
||||
if not subject:
|
||||
return ""
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.adapters.base",
|
||||
"content": {
|
||||
"path": "mail_intake.adapters.base",
|
||||
"docstring": "Mail provider adapter contracts for Mail Intake.\n\nThis module defines the **provider-agnostic adapter interface** used for\nread-only mail ingestion.\n\nAdapters encapsulate all provider-specific access logic and expose a\nminimal, normalized contract to the rest of the system. No provider-specific\ntypes or semantics should leak beyond implementations of this interface.",
|
||||
"docstring": "Mail provider adapter contracts for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **provider-agnostic adapter interface** used for\nread-only mail ingestion.\n\nAdapters encapsulate all provider-specific access logic and expose a\nminimal, normalized contract to the rest of the system. No provider-specific\ntypes or semantics should leak beyond implementations of this interface.",
|
||||
"objects": {
|
||||
"ABC": {
|
||||
"name": "ABC",
|
||||
@@ -43,29 +43,29 @@
|
||||
"name": "MailIntakeAdapter",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAdapter', 16, 76)>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAdapter', 20, 92)>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 28, 49)>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 36, 62)>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 51, 63)>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 64, 77)>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 65, 76)>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 79, 92)>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.adapters.gmail",
|
||||
"content": {
|
||||
"path": "mail_intake.adapters.gmail",
|
||||
"docstring": "Gmail adapter implementation for Mail Intake.\n\nThis module provides a **Gmail-specific implementation** of the\n`MailIntakeAdapter` contract.\n\nIt is the only place in the codebase where:\n- `googleapiclient` is imported\n- Gmail REST API semantics are known\n- Low-level `.execute()` calls are made\n\nAll Gmail-specific behavior must be strictly contained within this module.",
|
||||
"docstring": "Gmail adapter implementation for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a **Gmail-specific implementation** of the\n`MailIntakeAdapter` contract.\n\nIt is the only place in the codebase where:\n- `googleapiclient` is imported\n- Gmail REST API semantics are known\n- Low-level `.execute()` calls are made\n\nAll Gmail-specific behavior must be strictly contained within this module.",
|
||||
"objects": {
|
||||
"Iterator": {
|
||||
"name": "Iterator",
|
||||
@@ -44,28 +44,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapter', 'mail_intake.adapters.base.MailIntakeAdapter')>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_message_refs', 'mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs')>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_message', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_message')>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_thread', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_thread')>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -74,21 +74,21 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapterError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapterError', 'mail_intake.exceptions.MailIntakeAdapterError')>",
|
||||
"docstring": "Errors raised by mail provider adapters.\n\nRaised when a provider adapter encounters API errors,\ntransport failures, or invalid provider responses."
|
||||
"docstring": "Errors raised by mail provider adapters.\n\nNotes:\n **Lifecycle:**\n\n - Raised when a provider adapter encounters API errors, transport failures, or invalid provider responses"
|
||||
},
|
||||
"MailIntakeAuthProvider": {
|
||||
"name": "MailIntakeAuthProvider",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthProvider', 'mail_intake.auth.base.MailIntakeAuthProvider')>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Alias.signature of Alias('get_credentials', 'mail_intake.auth.base.MailIntakeAuthProvider.get_credentials')>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -96,36 +96,36 @@
|
||||
"name": "MailIntakeGmailAdapter",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGmailAdapter', 25, 172)>",
|
||||
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nThis class is the ONLY place where:\n- googleapiclient is imported\n- Gmail REST semantics are known\n- .execute() is called\n\nDesign constraints:\n- Must remain thin and imperative\n- Must not perform parsing or interpretation\n- Must not expose Gmail-specific types beyond this class",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGmailAdapter', 29, 190)>",
|
||||
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nNotes:\n **Responsibilities:**\n\n - This class is the ONLY place where googleapiclient is imported\n - Gmail REST semantics are known\n - .execute() is called\n\n **Constraints:**\n \n - Must remain thin and imperative\n - Must not perform parsing or interpretation\n - Must not expose Gmail-specific types beyond this class",
|
||||
"members": {
|
||||
"service": {
|
||||
"name": "service",
|
||||
"kind": "attribute",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.service",
|
||||
"signature": null,
|
||||
"docstring": "Lazily initialize and return the Gmail API service client.\n\nReturns:\n Initialized Gmail API service instance.\n\nRaises:\n MailIntakeAdapterError: If the Gmail service cannot be initialized."
|
||||
"docstring": "Lazily initialize and return the Gmail API service client.\n\nReturns:\n Any:\n Initialized Gmail API service instance.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail service cannot be initialized."
|
||||
},
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.iter_message_refs",
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 82, 122)>",
|
||||
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query: Gmail search query string.\n\nYields:\n Dictionaries containing:\n - ``message_id``: Gmail message ID\n - ``thread_id``: Gmail thread ID\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 93, 134)>",
|
||||
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query (str):\n Gmail search query string.\n\nYields:\n Dict[str, str]:\n Dictionaries containing ``message_id`` and ``thread_id``.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_message",
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 124, 147)>",
|
||||
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id: Gmail message identifier.\n\nReturns:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 136, 162)>",
|
||||
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id (str):\n Gmail message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_thread",
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 149, 172)>",
|
||||
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id: Gmail thread identifier.\n\nReturns:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 164, 190)>",
|
||||
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id (str):\n Gmail thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,35 +2,35 @@
|
||||
"module": "mail_intake.adapters",
|
||||
"content": {
|
||||
"path": "mail_intake.adapters",
|
||||
"docstring": "Mail provider adapter implementations for Mail Intake.\n\nThis package contains **adapter-layer implementations** responsible for\ninterfacing with external mail providers and exposing a normalized,\nprovider-agnostic contract to the rest of the system.\n\nAdapters in this package:\n- Implement the `MailIntakeAdapter` interface\n- Encapsulate all provider-specific APIs and semantics\n- Perform read-only access to mail data\n- Return provider-native payloads without interpretation\n\nProvider-specific logic **must not leak** outside of adapter implementations.\nAll parsings, normalizations, and transformations must be handled by downstream\ncomponents.\n\nPublic adapters exported from this package are considered the supported\nintegration surface for mail providers.",
|
||||
"docstring": "Mail provider adapter implementations for Mail Intake.\n\n---\n\n## Summary\n\nThis package contains **adapter-layer implementations** responsible for\ninterfacing with external mail providers and exposing a normalized,\nprovider-agnostic contract to the rest of the system.\n\nAdapters in this package:\n- Implement the `MailIntakeAdapter` interface\n- Encapsulate all provider-specific APIs and semantics\n- Perform read-only access to mail data\n- Return provider-native payloads without interpretation\n\nProvider-specific logic **must not leak** outside of adapter implementations.\nAll parsings, normalizations, and transformations must be handled by downstream\ncomponents.\n\n---\n\n## Public API\n\n MailIntakeAdapter\n MailIntakeGmailAdapter\n\n---",
|
||||
"objects": {
|
||||
"MailIntakeAdapter": {
|
||||
"name": "MailIntakeAdapter",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.MailIntakeAdapter",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapter', 'mail_intake.adapters.base.MailIntakeAdapter')>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_message_refs', 'mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs')>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_message', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_message')>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_thread', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_thread')>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -39,35 +39,35 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.MailIntakeGmailAdapter",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeGmailAdapter', 'mail_intake.adapters.gmail.MailIntakeGmailAdapter')>",
|
||||
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nThis class is the ONLY place where:\n- googleapiclient is imported\n- Gmail REST semantics are known\n- .execute() is called\n\nDesign constraints:\n- Must remain thin and imperative\n- Must not perform parsing or interpretation\n- Must not expose Gmail-specific types beyond this class",
|
||||
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nNotes:\n **Responsibilities:**\n\n - This class is the ONLY place where googleapiclient is imported\n - Gmail REST semantics are known\n - .execute() is called\n\n **Constraints:**\n \n - Must remain thin and imperative\n - Must not perform parsing or interpretation\n - Must not expose Gmail-specific types beyond this class",
|
||||
"members": {
|
||||
"service": {
|
||||
"name": "service",
|
||||
"kind": "attribute",
|
||||
"path": "mail_intake.adapters.MailIntakeGmailAdapter.service",
|
||||
"signature": "<bound method Alias.signature of Alias('service', 'mail_intake.adapters.gmail.MailIntakeGmailAdapter.service')>",
|
||||
"docstring": "Lazily initialize and return the Gmail API service client.\n\nReturns:\n Initialized Gmail API service instance.\n\nRaises:\n MailIntakeAdapterError: If the Gmail service cannot be initialized."
|
||||
"docstring": "Lazily initialize and return the Gmail API service client.\n\nReturns:\n Any:\n Initialized Gmail API service instance.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail service cannot be initialized."
|
||||
},
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.MailIntakeGmailAdapter.iter_message_refs",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_message_refs', 'mail_intake.adapters.gmail.MailIntakeGmailAdapter.iter_message_refs')>",
|
||||
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query: Gmail search query string.\n\nYields:\n Dictionaries containing:\n - ``message_id``: Gmail message ID\n - ``thread_id``: Gmail thread ID\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query (str):\n Gmail search query string.\n\nYields:\n Dict[str, str]:\n Dictionaries containing ``message_id`` and ``thread_id``.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.MailIntakeGmailAdapter.fetch_message",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_message', 'mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_message')>",
|
||||
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id: Gmail message identifier.\n\nReturns:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id (str):\n Gmail message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.MailIntakeGmailAdapter.fetch_thread",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_thread', 'mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_thread')>",
|
||||
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id: Gmail thread identifier.\n\nReturns:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id (str):\n Gmail thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -76,7 +76,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.adapters.base",
|
||||
"signature": null,
|
||||
"docstring": "Mail provider adapter contracts for Mail Intake.\n\nThis module defines the **provider-agnostic adapter interface** used for\nread-only mail ingestion.\n\nAdapters encapsulate all provider-specific access logic and expose a\nminimal, normalized contract to the rest of the system. No provider-specific\ntypes or semantics should leak beyond implementations of this interface.",
|
||||
"docstring": "Mail provider adapter contracts for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **provider-agnostic adapter interface** used for\nread-only mail ingestion.\n\nAdapters encapsulate all provider-specific access logic and expose a\nminimal, normalized contract to the rest of the system. No provider-specific\ntypes or semantics should leak beyond implementations of this interface.",
|
||||
"members": {
|
||||
"ABC": {
|
||||
"name": "ABC",
|
||||
@@ -117,29 +117,29 @@
|
||||
"name": "MailIntakeAdapter",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAdapter', 16, 76)>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAdapter', 20, 92)>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 28, 49)>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 36, 62)>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 51, 63)>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 64, 77)>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.base.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 65, 76)>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 79, 92)>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -150,7 +150,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.adapters.gmail",
|
||||
"signature": null,
|
||||
"docstring": "Gmail adapter implementation for Mail Intake.\n\nThis module provides a **Gmail-specific implementation** of the\n`MailIntakeAdapter` contract.\n\nIt is the only place in the codebase where:\n- `googleapiclient` is imported\n- Gmail REST API semantics are known\n- Low-level `.execute()` calls are made\n\nAll Gmail-specific behavior must be strictly contained within this module.",
|
||||
"docstring": "Gmail adapter implementation for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a **Gmail-specific implementation** of the\n`MailIntakeAdapter` contract.\n\nIt is the only place in the codebase where:\n- `googleapiclient` is imported\n- Gmail REST API semantics are known\n- Low-level `.execute()` calls are made\n\nAll Gmail-specific behavior must be strictly contained within this module.",
|
||||
"members": {
|
||||
"Iterator": {
|
||||
"name": "Iterator",
|
||||
@@ -192,28 +192,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapter', 'mail_intake.adapters.base.MailIntakeAdapter')>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_message_refs', 'mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs')>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_message', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_message')>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_thread', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_thread')>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -222,21 +222,21 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAdapterError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapterError', 'mail_intake.exceptions.MailIntakeAdapterError')>",
|
||||
"docstring": "Errors raised by mail provider adapters.\n\nRaised when a provider adapter encounters API errors,\ntransport failures, or invalid provider responses."
|
||||
"docstring": "Errors raised by mail provider adapters.\n\nNotes:\n **Lifecycle:**\n\n - Raised when a provider adapter encounters API errors, transport failures, or invalid provider responses"
|
||||
},
|
||||
"MailIntakeAuthProvider": {
|
||||
"name": "MailIntakeAuthProvider",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthProvider', 'mail_intake.auth.base.MailIntakeAuthProvider')>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Alias.signature of Alias('get_credentials', 'mail_intake.auth.base.MailIntakeAuthProvider.get_credentials')>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -244,36 +244,36 @@
|
||||
"name": "MailIntakeGmailAdapter",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGmailAdapter', 25, 172)>",
|
||||
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nThis class is the ONLY place where:\n- googleapiclient is imported\n- Gmail REST semantics are known\n- .execute() is called\n\nDesign constraints:\n- Must remain thin and imperative\n- Must not perform parsing or interpretation\n- Must not expose Gmail-specific types beyond this class",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGmailAdapter', 29, 190)>",
|
||||
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nNotes:\n **Responsibilities:**\n\n - This class is the ONLY place where googleapiclient is imported\n - Gmail REST semantics are known\n - .execute() is called\n\n **Constraints:**\n \n - Must remain thin and imperative\n - Must not perform parsing or interpretation\n - Must not expose Gmail-specific types beyond this class",
|
||||
"members": {
|
||||
"service": {
|
||||
"name": "service",
|
||||
"kind": "attribute",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.service",
|
||||
"signature": null,
|
||||
"docstring": "Lazily initialize and return the Gmail API service client.\n\nReturns:\n Initialized Gmail API service instance.\n\nRaises:\n MailIntakeAdapterError: If the Gmail service cannot be initialized."
|
||||
"docstring": "Lazily initialize and return the Gmail API service client.\n\nReturns:\n Any:\n Initialized Gmail API service instance.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail service cannot be initialized."
|
||||
},
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.iter_message_refs",
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 82, 122)>",
|
||||
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query: Gmail search query string.\n\nYields:\n Dictionaries containing:\n - ``message_id``: Gmail message ID\n - ``thread_id``: Gmail thread ID\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"signature": "<bound method Function.signature of Function('iter_message_refs', 93, 134)>",
|
||||
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query (str):\n Gmail search query string.\n\nYields:\n Dict[str, str]:\n Dictionaries containing ``message_id`` and ``thread_id``.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_message",
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 124, 147)>",
|
||||
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id: Gmail message identifier.\n\nReturns:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"signature": "<bound method Function.signature of Function('fetch_message', 136, 162)>",
|
||||
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id (str):\n Gmail message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_thread",
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 149, 172)>",
|
||||
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id: Gmail thread identifier.\n\nReturns:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError: If the Gmail API returns an error."
|
||||
"signature": "<bound method Function.signature of Function('fetch_thread', 164, 190)>",
|
||||
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id (str):\n Gmail thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.auth.base",
|
||||
"content": {
|
||||
"path": "mail_intake.auth.base",
|
||||
"docstring": "Authentication provider contracts for Mail Intake.\n\nThis module defines the **authentication abstraction layer** used by mail\nadapters to obtain provider-specific credentials.\n\nAuthentication concerns are intentionally decoupled from adapter logic.\nAdapters depend only on this interface and must not be aware of how\ncredentials are acquired, refreshed, or persisted.",
|
||||
"docstring": "Authentication provider contracts for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **authentication abstraction layer** used by mail\nadapters to obtain provider-specific credentials.\n\nAuthentication concerns are intentionally decoupled from adapter logic.\nAdapters depend only on this interface and must not be aware of how\ncredentials are acquired, refreshed, or persisted.",
|
||||
"objects": {
|
||||
"ABC": {
|
||||
"name": "ABC",
|
||||
@@ -43,15 +43,15 @@
|
||||
"name": "MailIntakeAuthProvider",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.base.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAuthProvider', 18, 59)>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAuthProvider', 22, 66)>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.base.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 37, 59)>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 44, 66)>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.auth.google",
|
||||
"content": {
|
||||
"path": "mail_intake.auth.google",
|
||||
"docstring": "Google authentication provider implementation for Mail Intake.\n\nThis module provides a **Google OAuth–based authentication provider**\nused primarily for Gmail access.\n\nIt encapsulates all Google-specific authentication concerns, including:\n- Credential loading and persistence\n- Token refresh handling\n- Interactive OAuth flow initiation\n- Coordination with a credential persistence layer\n\nNo Google authentication details should leak outside this module.",
|
||||
"docstring": "Google authentication provider implementation for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a **Google OAuth–based authentication provider**\nused primarily for Gmail access.\n\nIt encapsulates all Google-specific authentication concerns, including:\n- Credential loading and persistence\n- Token refresh handling\n- Interactive OAuth flow initiation\n- Coordination with a credential persistence layer\n\nNo Google authentication details should leak outside this module.",
|
||||
"objects": {
|
||||
"os": {
|
||||
"name": "os",
|
||||
@@ -51,14 +51,14 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthProvider', 'mail_intake.auth.base.MailIntakeAuthProvider')>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Alias.signature of Alias('get_credentials', 'mail_intake.auth.base.MailIntakeAuthProvider.get_credentials')>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -67,28 +67,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -97,14 +97,14 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.MailIntakeAuthError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthError', 'mail_intake.exceptions.MailIntakeAuthError')>",
|
||||
"docstring": "Authentication and credential-related failures.\n\nRaised when authentication providers are unable to acquire,\nrefresh, or persist valid credentials."
|
||||
"docstring": "Authentication and credential-related failures.\n\nNotes:\n **Lifecycle:**\n\n - Raised when authentication providers are unable to acquire, refresh, or persist valid credentials"
|
||||
},
|
||||
"MailIntakeGoogleAuth": {
|
||||
"name": "MailIntakeGoogleAuth",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.MailIntakeGoogleAuth",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGoogleAuth', 29, 125)>",
|
||||
"docstring": "Google OAuth provider for Gmail access.\n\nThis provider implements the `MailIntakeAuthProvider` interface using\nGoogle's OAuth 2.0 flow and credential management libraries.\n\nResponsibilities:\n- Load cached credentials from a credential store when available\n- Refresh expired credentials when possible\n- Initiate an interactive OAuth flow only when required\n- Persist refreshed or newly obtained credentials via the store\n\nThis class is synchronous by design and maintains a minimal internal state.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGoogleAuth', 33, 135)>",
|
||||
"docstring": "Google OAuth provider for Gmail access.\n\nThis provider implements the `MailIntakeAuthProvider` interface using\nGoogle's OAuth 2.0 flow and credential management libraries.\n\nNotes:\n **Responsibilities:**\n\n - Load cached credentials from a credential store when available\n - Refresh expired credentials when possible\n - Initiate an interactive OAuth flow only when required\n - Persist refreshed or newly obtained credentials via the store\n\n **Guarantees:**\n\n - This class is synchronous by design and maintains a minimal internal state",
|
||||
"members": {
|
||||
"credentials_path": {
|
||||
"name": "credentials_path",
|
||||
@@ -131,8 +131,8 @@
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.MailIntakeGoogleAuth.get_credentials",
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 70, 125)>",
|
||||
"docstring": "Retrieve valid Google OAuth credentials.\n\nThis method attempts to:\n1. Load cached credentials from the configured credential store\n2. Refresh expired credentials when possible\n3. Perform an interactive OAuth login as a fallback\n4. Persist valid credentials for future use\n\nReturns:\n A ``google.oauth2.credentials.Credentials`` instance suitable\n for use with Google API clients.\n\nRaises:\n MailIntakeAuthError: If credentials cannot be loaded, refreshed,\n or obtained via interactive authentication."
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 76, 135)>",
|
||||
"docstring": "Retrieve valid Google OAuth credentials.\n\nReturns:\n Credentials:\n A ``google.oauth2.credentials.Credentials`` instance suitable\n for use with Google API clients.\n\nRaises:\n MailIntakeAuthError:\n If credentials cannot be loaded, refreshed,\n or obtained via interactive authentication.\n\nNotes:\n **Lifecycle:**\n\n - Load cached credentials from the configured credential store\n - Refresh expired credentials when possible\n - Perform an interactive OAuth login as a fallback\n - Persist valid credentials for future use"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,21 +2,21 @@
|
||||
"module": "mail_intake.auth",
|
||||
"content": {
|
||||
"path": "mail_intake.auth",
|
||||
"docstring": "Authentication provider implementations for Mail Intake.\n\nThis package defines the **authentication layer** used by mail adapters\nto obtain provider-specific credentials.\n\nIt exposes:\n- A stable, provider-agnostic authentication contract\n- Concrete authentication providers for supported platforms\n\nAuthentication providers:\n- Are responsible for credential acquisition and lifecycle management\n- Are intentionally decoupled from adapter logic\n- May be extended by users to support additional providers\n\nConsumers should depend on the abstract interface and use concrete\nimplementations only where explicitly required.",
|
||||
"docstring": "Authentication provider implementations for Mail Intake.\n\n---\n\n## Summary\n\nThis package defines the **authentication layer** used by mail adapters\nto obtain provider-specific credentials.\n\nIt exposes:\n- A stable, provider-agnostic authentication contract\n- Concrete authentication providers for supported platforms\n\nAuthentication providers:\n- Are responsible for credential acquisition and lifecycle management\n- Are intentionally decoupled from adapter logic\n- May be extended by users to support additional providers\n\nConsumers should depend on the abstract interface and use concrete\nimplementations only where explicitly required.\n\n---\n\n## Public API\n\n MailIntakeAuthProvider\n MailIntakeGoogleAuth\n\n---",
|
||||
"objects": {
|
||||
"MailIntakeAuthProvider": {
|
||||
"name": "MailIntakeAuthProvider",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthProvider', 'mail_intake.auth.base.MailIntakeAuthProvider')>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Alias.signature of Alias('get_credentials', 'mail_intake.auth.base.MailIntakeAuthProvider.get_credentials')>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -25,7 +25,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.MailIntakeGoogleAuth",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeGoogleAuth', 'mail_intake.auth.google.MailIntakeGoogleAuth')>",
|
||||
"docstring": "Google OAuth provider for Gmail access.\n\nThis provider implements the `MailIntakeAuthProvider` interface using\nGoogle's OAuth 2.0 flow and credential management libraries.\n\nResponsibilities:\n- Load cached credentials from a credential store when available\n- Refresh expired credentials when possible\n- Initiate an interactive OAuth flow only when required\n- Persist refreshed or newly obtained credentials via the store\n\nThis class is synchronous by design and maintains a minimal internal state.",
|
||||
"docstring": "Google OAuth provider for Gmail access.\n\nThis provider implements the `MailIntakeAuthProvider` interface using\nGoogle's OAuth 2.0 flow and credential management libraries.\n\nNotes:\n **Responsibilities:**\n\n - Load cached credentials from a credential store when available\n - Refresh expired credentials when possible\n - Initiate an interactive OAuth flow only when required\n - Persist refreshed or newly obtained credentials via the store\n\n **Guarantees:**\n\n - This class is synchronous by design and maintains a minimal internal state",
|
||||
"members": {
|
||||
"credentials_path": {
|
||||
"name": "credentials_path",
|
||||
@@ -53,7 +53,7 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.MailIntakeGoogleAuth.get_credentials",
|
||||
"signature": "<bound method Alias.signature of Alias('get_credentials', 'mail_intake.auth.google.MailIntakeGoogleAuth.get_credentials')>",
|
||||
"docstring": "Retrieve valid Google OAuth credentials.\n\nThis method attempts to:\n1. Load cached credentials from the configured credential store\n2. Refresh expired credentials when possible\n3. Perform an interactive OAuth login as a fallback\n4. Persist valid credentials for future use\n\nReturns:\n A ``google.oauth2.credentials.Credentials`` instance suitable\n for use with Google API clients.\n\nRaises:\n MailIntakeAuthError: If credentials cannot be loaded, refreshed,\n or obtained via interactive authentication."
|
||||
"docstring": "Retrieve valid Google OAuth credentials.\n\nReturns:\n Credentials:\n A ``google.oauth2.credentials.Credentials`` instance suitable\n for use with Google API clients.\n\nRaises:\n MailIntakeAuthError:\n If credentials cannot be loaded, refreshed,\n or obtained via interactive authentication.\n\nNotes:\n **Lifecycle:**\n\n - Load cached credentials from the configured credential store\n - Refresh expired credentials when possible\n - Perform an interactive OAuth login as a fallback\n - Persist valid credentials for future use"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -62,7 +62,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.auth.base",
|
||||
"signature": null,
|
||||
"docstring": "Authentication provider contracts for Mail Intake.\n\nThis module defines the **authentication abstraction layer** used by mail\nadapters to obtain provider-specific credentials.\n\nAuthentication concerns are intentionally decoupled from adapter logic.\nAdapters depend only on this interface and must not be aware of how\ncredentials are acquired, refreshed, or persisted.",
|
||||
"docstring": "Authentication provider contracts for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **authentication abstraction layer** used by mail\nadapters to obtain provider-specific credentials.\n\nAuthentication concerns are intentionally decoupled from adapter logic.\nAdapters depend only on this interface and must not be aware of how\ncredentials are acquired, refreshed, or persisted.",
|
||||
"members": {
|
||||
"ABC": {
|
||||
"name": "ABC",
|
||||
@@ -103,15 +103,15 @@
|
||||
"name": "MailIntakeAuthProvider",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.base.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAuthProvider', 18, 59)>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAuthProvider', 22, 66)>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.base.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 37, 59)>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 44, 66)>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,7 +122,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.auth.google",
|
||||
"signature": null,
|
||||
"docstring": "Google authentication provider implementation for Mail Intake.\n\nThis module provides a **Google OAuth–based authentication provider**\nused primarily for Gmail access.\n\nIt encapsulates all Google-specific authentication concerns, including:\n- Credential loading and persistence\n- Token refresh handling\n- Interactive OAuth flow initiation\n- Coordination with a credential persistence layer\n\nNo Google authentication details should leak outside this module.",
|
||||
"docstring": "Google authentication provider implementation for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a **Google OAuth–based authentication provider**\nused primarily for Gmail access.\n\nIt encapsulates all Google-specific authentication concerns, including:\n- Credential loading and persistence\n- Token refresh handling\n- Interactive OAuth flow initiation\n- Coordination with a credential persistence layer\n\nNo Google authentication details should leak outside this module.",
|
||||
"members": {
|
||||
"os": {
|
||||
"name": "os",
|
||||
@@ -171,14 +171,14 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.MailIntakeAuthProvider",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthProvider', 'mail_intake.auth.base.MailIntakeAuthProvider')>",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nAuthentication providers encapsulate all logic required to:\n- Acquire credentials from an external provider\n- Refresh or revalidate credentials as needed\n- Handle authentication-specific failure modes\n- Coordinate with credential persistence layers where applicable\n\nMail adapters must treat returned credentials as opaque and\nprovider-specific, relying only on the declared credential type\nexpected by the adapter.",
|
||||
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider\n - Refresh or revalidate credentials as needed\n - Handle authentication-specific failure modes\n - Coordinate with credential persistence layers where applicable\n\n **Constraints:**\n \n - Mail adapters must treat returned credentials as opaque and provider-specific\n - Mail adapters rely only on the declared credential type expected by the adapter",
|
||||
"members": {
|
||||
"get_credentials": {
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.MailIntakeAuthProvider.get_credentials",
|
||||
"signature": "<bound method Alias.signature of Alias('get_credentials', 'mail_intake.auth.base.MailIntakeAuthProvider.get_credentials')>",
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nThis method is synchronous by design and represents the sole\nentry point through which adapters obtain authentication\nmaterial.\n\nImplementations must either return credentials of the declared\ntype ``T`` that are valid at the time of return or raise an\nauthentication-specific exception.\n\nReturns:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated."
|
||||
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type ``T`` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design\n - Represents the sole entry point through which adapters obtain authentication material\n - Implementations must either return credentials of the declared type ``T`` that are valid at the time of return or raise an exception"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -187,28 +187,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -217,14 +217,14 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.MailIntakeAuthError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAuthError', 'mail_intake.exceptions.MailIntakeAuthError')>",
|
||||
"docstring": "Authentication and credential-related failures.\n\nRaised when authentication providers are unable to acquire,\nrefresh, or persist valid credentials."
|
||||
"docstring": "Authentication and credential-related failures.\n\nNotes:\n **Lifecycle:**\n\n - Raised when authentication providers are unable to acquire, refresh, or persist valid credentials"
|
||||
},
|
||||
"MailIntakeGoogleAuth": {
|
||||
"name": "MailIntakeGoogleAuth",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.auth.google.MailIntakeGoogleAuth",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGoogleAuth', 29, 125)>",
|
||||
"docstring": "Google OAuth provider for Gmail access.\n\nThis provider implements the `MailIntakeAuthProvider` interface using\nGoogle's OAuth 2.0 flow and credential management libraries.\n\nResponsibilities:\n- Load cached credentials from a credential store when available\n- Refresh expired credentials when possible\n- Initiate an interactive OAuth flow only when required\n- Persist refreshed or newly obtained credentials via the store\n\nThis class is synchronous by design and maintains a minimal internal state.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeGoogleAuth', 33, 135)>",
|
||||
"docstring": "Google OAuth provider for Gmail access.\n\nThis provider implements the `MailIntakeAuthProvider` interface using\nGoogle's OAuth 2.0 flow and credential management libraries.\n\nNotes:\n **Responsibilities:**\n\n - Load cached credentials from a credential store when available\n - Refresh expired credentials when possible\n - Initiate an interactive OAuth flow only when required\n - Persist refreshed or newly obtained credentials via the store\n\n **Guarantees:**\n\n - This class is synchronous by design and maintains a minimal internal state",
|
||||
"members": {
|
||||
"credentials_path": {
|
||||
"name": "credentials_path",
|
||||
@@ -251,8 +251,8 @@
|
||||
"name": "get_credentials",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.auth.google.MailIntakeGoogleAuth.get_credentials",
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 70, 125)>",
|
||||
"docstring": "Retrieve valid Google OAuth credentials.\n\nThis method attempts to:\n1. Load cached credentials from the configured credential store\n2. Refresh expired credentials when possible\n3. Perform an interactive OAuth login as a fallback\n4. Persist valid credentials for future use\n\nReturns:\n A ``google.oauth2.credentials.Credentials`` instance suitable\n for use with Google API clients.\n\nRaises:\n MailIntakeAuthError: If credentials cannot be loaded, refreshed,\n or obtained via interactive authentication."
|
||||
"signature": "<bound method Function.signature of Function('get_credentials', 76, 135)>",
|
||||
"docstring": "Retrieve valid Google OAuth credentials.\n\nReturns:\n Credentials:\n A ``google.oauth2.credentials.Credentials`` instance suitable\n for use with Google API clients.\n\nRaises:\n MailIntakeAuthError:\n If credentials cannot be loaded, refreshed,\n or obtained via interactive authentication.\n\nNotes:\n **Lifecycle:**\n\n - Load cached credentials from the configured credential store\n - Refresh expired credentials when possible\n - Perform an interactive OAuth login as a fallback\n - Persist valid credentials for future use"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.config",
|
||||
"content": {
|
||||
"path": "mail_intake.config",
|
||||
"docstring": "Global configuration models for Mail Intake.\n\nThis module defines the **top-level configuration object** used to control\nmail ingestion behavior across adapters, authentication providers, and\ningestion workflows.\n\nConfiguration is intentionally explicit, immutable, and free of implicit\nenvironment reads to ensure predictability and testability.",
|
||||
"docstring": "Global configuration models for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **top-level configuration object** used to control\nmail ingestion behavior across adapters, authentication providers, and\ningestion workflows.\n\nConfiguration is intentionally explicit, immutable, and free of implicit\nenvironment reads to ensure predictability and testability.",
|
||||
"objects": {
|
||||
"dataclass": {
|
||||
"name": "dataclass",
|
||||
@@ -22,8 +22,8 @@
|
||||
"name": "MailIntakeConfig",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.config.MailIntakeConfig",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeConfig', 16, 45)>",
|
||||
"docstring": "Global configuration for mail-intake.\n\nThis configuration is intentionally explicit and immutable.\nNo implicit environment reads or global state.\n\nDesign principles:\n- Immutable once constructed\n- Explicit configuration over implicit defaults\n- No direct environment or filesystem access\n\nThis model is safe to pass across layers and suitable for serialization.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeConfig', 20, 58)>",
|
||||
"docstring": "Global configuration for mail-intake.\n\nNotes:\n **Guarantees:**\n\n - This configuration is intentionally explicit and immutable\n - No implicit environment reads or global state\n - Explicit configuration over implicit defaults\n - No direct environment or filesystem access\n - This model is safe to pass across layers and suitable for serialization",
|
||||
"members": {
|
||||
"provider": {
|
||||
"name": "provider",
|
||||
|
||||
@@ -2,35 +2,35 @@
|
||||
"module": "mail_intake.credentials",
|
||||
"content": {
|
||||
"path": "mail_intake.credentials",
|
||||
"docstring": "Credential persistence interfaces and implementations for Mail Intake.\n\nThis package defines the abstractions and concrete implementations used\nto persist authentication credentials across Mail Intake components.\n\nThe credential persistence layer is intentionally decoupled from\nauthentication logic. Authentication providers are responsible for\ncredential acquisition, validation, and refresh, while implementations\nwithin this package are responsible solely for storage and retrieval.\n\nThe package provides:\n- A generic ``CredentialStore`` abstraction defining the persistence contract\n- Local filesystem–based storage for development and single-node use\n- Distributed, Redis-backed storage for production and scaled deployments\n\nCredential lifecycle management, interpretation, and security policy\ndecisions remain the responsibility of authentication providers.",
|
||||
"docstring": "Credential persistence interfaces and implementations for Mail Intake.\n\n---\n\n## Summary\n\nThis package defines the abstractions and concrete implementations used\nto persist authentication credentials across Mail Intake components.\n\nThe credential persistence layer is intentionally decoupled from\nauthentication logic. Authentication providers are responsible for\ncredential acquisition, validation, and refresh, while implementations\nwithin this package are responsible solely for storage and retrieval.\n\nThe package provides:\n- A generic ``CredentialStore`` abstraction defining the persistence contract\n- Local filesystem–based storage for development and single-node use\n- Distributed, Redis-backed storage for production and scaled deployments\n\nCredential lifecycle management, interpretation, and security policy\ndecisions remain the responsibility of authentication providers.\n\n---\n\n## Public API\n\n CredentialStore\n PickleCredentialStore\n RedisCredentialStore\n\n---",
|
||||
"objects": {
|
||||
"CredentialStore": {
|
||||
"name": "CredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -39,7 +39,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.PickleCredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('PickleCredentialStore', 'mail_intake.credentials.pickle.PickleCredentialStore')>",
|
||||
"docstring": "Filesystem-backed credential store using pickle serialization.\n\nThis store persists credentials as a pickled object on the local\nfilesystem. It is a simple implementation intended primarily for\ndevelopment, testing, and single-process execution contexts.\n\nThis implementation:\n- Stores credentials on the local filesystem\n- Uses pickle for serialization and deserialization\n- Does not provide encryption, locking, or concurrency guarantees\n\nCredential lifecycle management, validation, and refresh logic are\nexplicitly out of scope for this class.",
|
||||
"docstring": "Filesystem-backed credential store using pickle serialization.\n\nThis store persists credentials as a pickled object on the local\nfilesystem. It is a simple implementation intended primarily for\ndevelopment, testing, and single-process execution contexts.\n\nNotes:\n **Guarantees:**\n\n - Stores credentials on the local filesystem\n - Uses pickle for serialization and deserialization\n - Does not provide encryption, locking, or concurrency guarantees\n\n **Constraints:**\n \n - Credential lifecycle management, validation, and refresh logic are explicitly out of scope for this class",
|
||||
"members": {
|
||||
"path": {
|
||||
"name": "path",
|
||||
@@ -53,21 +53,21 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.PickleCredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.pickle.PickleCredentialStore.load')>",
|
||||
"docstring": "Load credentials from the local filesystem.\n\nIf the credential file does not exist or cannot be successfully\ndeserialized, this method returns ``None``.\n\nThe store does not attempt to validate or interpret the returned\ncredentials.\n\nReturns:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``."
|
||||
"docstring": "Load credentials from the local filesystem.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - If the credential file does not exist or cannot be successfully deserialized, this method returns ``None``\n - The store does not attempt to validate or interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.PickleCredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.pickle.PickleCredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the local filesystem.\n\nAny previously stored credentials at the configured path are\noverwritten.\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the local filesystem.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Responsibilities:**\n\n - Any previously stored credentials at the configured path are overwritten"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.PickleCredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.pickle.PickleCredentialStore.clear')>",
|
||||
"docstring": "Remove persisted credentials from the local filesystem.\n\nThis method deletes the credential file if it exists and should\nbe treated as an idempotent operation."
|
||||
"docstring": "Remove persisted credentials from the local filesystem.\n\nNotes:\n **Lifecycle:**\n\n - This method deletes the credential file if it exists and should be treated as an idempotent operation"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -76,7 +76,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.RedisCredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('RedisCredentialStore', 'mail_intake.credentials.redis.RedisCredentialStore')>",
|
||||
"docstring": "Redis-backed implementation of ``CredentialStore``.\n\nThis store persists credentials in Redis and is suitable for\ndistributed and horizontally scaled deployments where credentials\nmust be shared across multiple processes or nodes.\n\nThe store is intentionally generic and delegates all serialization\nconcerns to caller-provided functions. This avoids unsafe mechanisms\nsuch as pickle and allows credential formats to be explicitly\ncontrolled and audited.\n\nThis class is responsible only for persistence and retrieval.\nIt does not interpret, validate, refresh, or otherwise manage\nthe lifecycle of the credentials being stored.",
|
||||
"docstring": "Redis-backed implementation of ``CredentialStore``.\n\nThis store persists credentials in Redis and is suitable for\ndistributed and horizontally scaled deployments where credentials\nmust be shared across multiple processes or nodes.\n\nNotes:\n **Responsibilities:**\n\n - This class is responsible only for persistence and retrieval\n - It does not interpret, validate, refresh, or otherwise manage the lifecycle of the credentials being stored\n\n **Guarantees:**\n\n - The store is intentionally generic and delegates all serialization concerns to caller-provided functions\n - This avoids unsafe mechanisms such as pickle and allows credential formats to be explicitly controlled and audited",
|
||||
"members": {
|
||||
"redis": {
|
||||
"name": "redis",
|
||||
@@ -118,21 +118,21 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.RedisCredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.redis.RedisCredentialStore.load')>",
|
||||
"docstring": "Load credentials from Redis.\n\nIf no value exists for the configured key, or if the stored\npayload cannot be successfully deserialized, this method\nreturns ``None``.\n\nThe store does not attempt to validate the returned credentials\nor determine whether they are expired or otherwise usable.\n\nReturns:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``."
|
||||
"docstring": "Load credentials from Redis.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - If no value exists for the configured key, or if the stored payload cannot be successfully deserialized, this method returns ``None``\n - The store does not attempt to validate the returned credentials or determine whether they are expired or otherwise usable"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.RedisCredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.redis.RedisCredentialStore.save')>",
|
||||
"docstring": "Persist credentials to Redis.\n\nAny previously stored credentials under the same key are\noverwritten. If a TTL is configured, the credentials will\nexpire automatically after the specified duration.\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to Redis.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Responsibilities:**\n\n - Any previously stored credentials under the same key are overwritten\n - If a TTL is configured, the credentials will expire automatically after the specified duration"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.RedisCredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.redis.RedisCredentialStore.clear')>",
|
||||
"docstring": "Remove stored credentials from Redis.\n\nThis operation deletes the configured Redis key if it exists.\nImplementations should treat this method as idempotent."
|
||||
"docstring": "Remove stored credentials from Redis.\n\nNotes:\n **Lifecycle:**\n\n - This operation deletes the configured Redis key if it exists\n - Implementations should treat this method as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -141,7 +141,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.credentials.pickle",
|
||||
"signature": null,
|
||||
"docstring": "Local filesystem–based credential persistence for Mail Intake.\n\nThis module provides a file-backed implementation of the\n``CredentialStore`` abstraction using Python's ``pickle`` module.\n\nThe pickle-based credential store is intended for local development,\nsingle-node deployments, and controlled environments where credentials\ndo not need to be shared across processes or machines.\n\nDue to the security and portability risks associated with pickle-based\nserialization, this implementation is not suitable for distributed or\nuntrusted environments.",
|
||||
"docstring": "Local filesystem–based credential persistence for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a file-backed implementation of the\n``CredentialStore`` abstraction using Python's ``pickle`` module.\n\nThe pickle-based credential store is intended for local development,\nsingle-node deployments, and controlled environments where credentials\ndo not need to be shared across processes or machines.\n\nDue to the security and portability risks associated with pickle-based\nserialization, this implementation is not suitable for distributed or\nuntrusted environments.",
|
||||
"members": {
|
||||
"pickle": {
|
||||
"name": "pickle",
|
||||
@@ -169,28 +169,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -205,8 +205,8 @@
|
||||
"name": "PickleCredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore",
|
||||
"signature": "<bound method Class.signature of Class('PickleCredentialStore', 24, 96)>",
|
||||
"docstring": "Filesystem-backed credential store using pickle serialization.\n\nThis store persists credentials as a pickled object on the local\nfilesystem. It is a simple implementation intended primarily for\ndevelopment, testing, and single-process execution contexts.\n\nThis implementation:\n- Stores credentials on the local filesystem\n- Uses pickle for serialization and deserialization\n- Does not provide encryption, locking, or concurrency guarantees\n\nCredential lifecycle management, validation, and refresh logic are\nexplicitly out of scope for this class.",
|
||||
"signature": "<bound method Class.signature of Class('PickleCredentialStore', 28, 108)>",
|
||||
"docstring": "Filesystem-backed credential store using pickle serialization.\n\nThis store persists credentials as a pickled object on the local\nfilesystem. It is a simple implementation intended primarily for\ndevelopment, testing, and single-process execution contexts.\n\nNotes:\n **Guarantees:**\n\n - Stores credentials on the local filesystem\n - Uses pickle for serialization and deserialization\n - Does not provide encryption, locking, or concurrency guarantees\n\n **Constraints:**\n \n - Credential lifecycle management, validation, and refresh logic are explicitly out of scope for this class",
|
||||
"members": {
|
||||
"path": {
|
||||
"name": "path",
|
||||
@@ -219,22 +219,22 @@
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore.load",
|
||||
"signature": "<bound method Function.signature of Function('load', 52, 70)>",
|
||||
"docstring": "Load credentials from the local filesystem.\n\nIf the credential file does not exist or cannot be successfully\ndeserialized, this method returns ``None``.\n\nThe store does not attempt to validate or interpret the returned\ncredentials.\n\nReturns:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``."
|
||||
"signature": "<bound method Function.signature of Function('load', 59, 78)>",
|
||||
"docstring": "Load credentials from the local filesystem.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - If the credential file does not exist or cannot be successfully deserialized, this method returns ``None``\n - The store does not attempt to validate or interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore.save",
|
||||
"signature": "<bound method Function.signature of Function('save', 72, 84)>",
|
||||
"docstring": "Persist credentials to the local filesystem.\n\nAny previously stored credentials at the configured path are\noverwritten.\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"signature": "<bound method Function.signature of Function('save', 80, 94)>",
|
||||
"docstring": "Persist credentials to the local filesystem.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Responsibilities:**\n\n - Any previously stored credentials at the configured path are overwritten"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore.clear",
|
||||
"signature": "<bound method Function.signature of Function('clear', 86, 96)>",
|
||||
"docstring": "Remove persisted credentials from the local filesystem.\n\nThis method deletes the credential file if it exists and should\nbe treated as an idempotent operation."
|
||||
"signature": "<bound method Function.signature of Function('clear', 96, 108)>",
|
||||
"docstring": "Remove persisted credentials from the local filesystem.\n\nNotes:\n **Lifecycle:**\n\n - This method deletes the credential file if it exists and should be treated as an idempotent operation"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.credentials.redis",
|
||||
"signature": null,
|
||||
"docstring": "Redis-backed credential persistence for Mail Intake.\n\nThis module provides a Redis-based implementation of the\n``CredentialStore`` abstraction, enabling credential persistence\nacross distributed and horizontally scaled deployments.\n\nThe Redis credential store is designed for environments where\nauthentication credentials must be shared safely across multiple\nprocesses, containers, or nodes, such as container orchestration\nplatforms and microservice architectures.\n\nKey characteristics:\n- Distributed-safe, shared storage using Redis\n- Explicit, caller-defined serialization and deserialization\n- No reliance on unsafe mechanisms such as pickle\n- Optional time-to-live (TTL) support for automatic credential expiry\n\nThis module is responsible solely for persistence concerns.\nCredential validation, refresh, rotation, and acquisition remain the\nresponsibility of authentication provider implementations.",
|
||||
"docstring": "Redis-backed credential persistence for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a Redis-based implementation of the\n``CredentialStore`` abstraction, enabling credential persistence\nacross distributed and horizontally scaled deployments.\n\nThe Redis credential store is designed for environments where\nauthentication credentials must be shared safely across multiple\nprocesses, containers, or nodes, such as container orchestration\nplatforms and microservice architectures.\n\nKey characteristics:\n- Distributed-safe, shared storage using Redis\n- Explicit, caller-defined serialization and deserialization\n- No reliance on unsafe mechanisms such as pickle\n- Optional time-to-live (TTL) support for automatic credential expiry\n\nThis module is responsible solely for persistence concerns.\nCredential validation, refresh, rotation, and acquisition remain the\nresponsibility of authentication provider implementations.",
|
||||
"members": {
|
||||
"Optional": {
|
||||
"name": "Optional",
|
||||
@@ -273,28 +273,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -309,8 +309,8 @@
|
||||
"name": "RedisCredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore",
|
||||
"signature": "<bound method Class.signature of Class('RedisCredentialStore', 32, 142)>",
|
||||
"docstring": "Redis-backed implementation of ``CredentialStore``.\n\nThis store persists credentials in Redis and is suitable for\ndistributed and horizontally scaled deployments where credentials\nmust be shared across multiple processes or nodes.\n\nThe store is intentionally generic and delegates all serialization\nconcerns to caller-provided functions. This avoids unsafe mechanisms\nsuch as pickle and allows credential formats to be explicitly\ncontrolled and audited.\n\nThis class is responsible only for persistence and retrieval.\nIt does not interpret, validate, refresh, or otherwise manage\nthe lifecycle of the credentials being stored.",
|
||||
"signature": "<bound method Class.signature of Class('RedisCredentialStore', 36, 142)>",
|
||||
"docstring": "Redis-backed implementation of ``CredentialStore``.\n\nThis store persists credentials in Redis and is suitable for\ndistributed and horizontally scaled deployments where credentials\nmust be shared across multiple processes or nodes.\n\nNotes:\n **Responsibilities:**\n\n - This class is responsible only for persistence and retrieval\n - It does not interpret, validate, refresh, or otherwise manage the lifecycle of the credentials being stored\n\n **Guarantees:**\n\n - The store is intentionally generic and delegates all serialization concerns to caller-provided functions\n - This avoids unsafe mechanisms such as pickle and allows credential formats to be explicitly controlled and audited",
|
||||
"members": {
|
||||
"redis": {
|
||||
"name": "redis",
|
||||
@@ -351,22 +351,22 @@
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore.load",
|
||||
"signature": "<bound method Function.signature of Function('load', 94, 115)>",
|
||||
"docstring": "Load credentials from Redis.\n\nIf no value exists for the configured key, or if the stored\npayload cannot be successfully deserialized, this method\nreturns ``None``.\n\nThe store does not attempt to validate the returned credentials\nor determine whether they are expired or otherwise usable.\n\nReturns:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``."
|
||||
"signature": "<bound method Function.signature of Function('load', 89, 110)>",
|
||||
"docstring": "Load credentials from Redis.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - If no value exists for the configured key, or if the stored payload cannot be successfully deserialized, this method returns ``None``\n - The store does not attempt to validate the returned credentials or determine whether they are expired or otherwise usable"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore.save",
|
||||
"signature": "<bound method Function.signature of Function('save', 117, 133)>",
|
||||
"docstring": "Persist credentials to Redis.\n\nAny previously stored credentials under the same key are\noverwritten. If a TTL is configured, the credentials will\nexpire automatically after the specified duration.\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"signature": "<bound method Function.signature of Function('save', 112, 130)>",
|
||||
"docstring": "Persist credentials to Redis.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Responsibilities:**\n\n - Any previously stored credentials under the same key are overwritten\n - If a TTL is configured, the credentials will expire automatically after the specified duration"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore.clear",
|
||||
"signature": "<bound method Function.signature of Function('clear', 135, 142)>",
|
||||
"docstring": "Remove stored credentials from Redis.\n\nThis operation deletes the configured Redis key if it exists.\nImplementations should treat this method as idempotent."
|
||||
"signature": "<bound method Function.signature of Function('clear', 132, 142)>",
|
||||
"docstring": "Remove stored credentials from Redis.\n\nNotes:\n **Lifecycle:**\n\n - This operation deletes the configured Redis key if it exists\n - Implementations should treat this method as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -384,7 +384,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.credentials.store",
|
||||
"signature": null,
|
||||
"docstring": "Credential persistence abstractions for Mail Intake.\n\nThis module defines the generic persistence contract used to store and\nretrieve authentication credentials across Mail Intake components.\n\nThe ``CredentialStore`` abstraction establishes a strict separation\nbetween credential *lifecycle management* and credential *storage*.\nAuthentication providers are responsible for acquiring, validating,\nrefreshing, and revoking credentials, while concrete store\nimplementations are responsible solely for persistence concerns.\n\nBy remaining agnostic to credential structure, serialization format,\nand storage backend, this module enables multiple persistence\nstrategies—such as local files, in-memory caches, distributed stores,\nor secrets managers—without coupling authentication logic to any\nspecific storage mechanism.",
|
||||
"docstring": "Credential persistence abstractions for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the generic persistence contract used to store and\nretrieve authentication credentials across Mail Intake components.\n\nThe ``CredentialStore`` abstraction establishes a strict separation\nbetween credential *lifecycle management* and credential *storage*.\nAuthentication providers are responsible for acquiring, validating,\nrefreshing, and revoking credentials, while concrete store\nimplementations are responsible solely for persistence concerns.\n\nBy remaining agnostic to credential structure, serialization format,\nand storage backend, this module enables multiple persistence\nstrategies—such as local files, in-memory caches, distributed stores,\nor secrets managers—without coupling authentication logic to any\nspecific storage mechanism.",
|
||||
"members": {
|
||||
"ABC": {
|
||||
"name": "ABC",
|
||||
@@ -432,29 +432,29 @@
|
||||
"name": "CredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.store.CredentialStore",
|
||||
"signature": "<bound method Class.signature of Class('CredentialStore', 27, 90)>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"signature": "<bound method Class.signature of Class('CredentialStore', 31, 102)>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.store.CredentialStore.load",
|
||||
"signature": "<bound method Function.signature of Function('load', 44, 59)>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"signature": "<bound method Function.signature of Function('load', 50, 65)>",
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.store.CredentialStore.save",
|
||||
"signature": "<bound method Function.signature of Function('save', 61, 78)>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"signature": "<bound method Function.signature of Function('save', 67, 86)>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.store.CredentialStore.clear",
|
||||
"signature": "<bound method Function.signature of Function('clear', 80, 90)>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"signature": "<bound method Function.signature of Function('clear', 88, 102)>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.credentials.pickle",
|
||||
"content": {
|
||||
"path": "mail_intake.credentials.pickle",
|
||||
"docstring": "Local filesystem–based credential persistence for Mail Intake.\n\nThis module provides a file-backed implementation of the\n``CredentialStore`` abstraction using Python's ``pickle`` module.\n\nThe pickle-based credential store is intended for local development,\nsingle-node deployments, and controlled environments where credentials\ndo not need to be shared across processes or machines.\n\nDue to the security and portability risks associated with pickle-based\nserialization, this implementation is not suitable for distributed or\nuntrusted environments.",
|
||||
"docstring": "Local filesystem–based credential persistence for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a file-backed implementation of the\n``CredentialStore`` abstraction using Python's ``pickle`` module.\n\nThe pickle-based credential store is intended for local development,\nsingle-node deployments, and controlled environments where credentials\ndo not need to be shared across processes or machines.\n\nDue to the security and portability risks associated with pickle-based\nserialization, this implementation is not suitable for distributed or\nuntrusted environments.",
|
||||
"objects": {
|
||||
"pickle": {
|
||||
"name": "pickle",
|
||||
@@ -30,28 +30,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -66,8 +66,8 @@
|
||||
"name": "PickleCredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore",
|
||||
"signature": "<bound method Class.signature of Class('PickleCredentialStore', 24, 96)>",
|
||||
"docstring": "Filesystem-backed credential store using pickle serialization.\n\nThis store persists credentials as a pickled object on the local\nfilesystem. It is a simple implementation intended primarily for\ndevelopment, testing, and single-process execution contexts.\n\nThis implementation:\n- Stores credentials on the local filesystem\n- Uses pickle for serialization and deserialization\n- Does not provide encryption, locking, or concurrency guarantees\n\nCredential lifecycle management, validation, and refresh logic are\nexplicitly out of scope for this class.",
|
||||
"signature": "<bound method Class.signature of Class('PickleCredentialStore', 28, 108)>",
|
||||
"docstring": "Filesystem-backed credential store using pickle serialization.\n\nThis store persists credentials as a pickled object on the local\nfilesystem. It is a simple implementation intended primarily for\ndevelopment, testing, and single-process execution contexts.\n\nNotes:\n **Guarantees:**\n\n - Stores credentials on the local filesystem\n - Uses pickle for serialization and deserialization\n - Does not provide encryption, locking, or concurrency guarantees\n\n **Constraints:**\n \n - Credential lifecycle management, validation, and refresh logic are explicitly out of scope for this class",
|
||||
"members": {
|
||||
"path": {
|
||||
"name": "path",
|
||||
@@ -80,22 +80,22 @@
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore.load",
|
||||
"signature": "<bound method Function.signature of Function('load', 52, 70)>",
|
||||
"docstring": "Load credentials from the local filesystem.\n\nIf the credential file does not exist or cannot be successfully\ndeserialized, this method returns ``None``.\n\nThe store does not attempt to validate or interpret the returned\ncredentials.\n\nReturns:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``."
|
||||
"signature": "<bound method Function.signature of Function('load', 59, 78)>",
|
||||
"docstring": "Load credentials from the local filesystem.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - If the credential file does not exist or cannot be successfully deserialized, this method returns ``None``\n - The store does not attempt to validate or interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore.save",
|
||||
"signature": "<bound method Function.signature of Function('save', 72, 84)>",
|
||||
"docstring": "Persist credentials to the local filesystem.\n\nAny previously stored credentials at the configured path are\noverwritten.\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"signature": "<bound method Function.signature of Function('save', 80, 94)>",
|
||||
"docstring": "Persist credentials to the local filesystem.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Responsibilities:**\n\n - Any previously stored credentials at the configured path are overwritten"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.pickle.PickleCredentialStore.clear",
|
||||
"signature": "<bound method Function.signature of Function('clear', 86, 96)>",
|
||||
"docstring": "Remove persisted credentials from the local filesystem.\n\nThis method deletes the credential file if it exists and should\nbe treated as an idempotent operation."
|
||||
"signature": "<bound method Function.signature of Function('clear', 96, 108)>",
|
||||
"docstring": "Remove persisted credentials from the local filesystem.\n\nNotes:\n **Lifecycle:**\n\n - This method deletes the credential file if it exists and should be treated as an idempotent operation"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.credentials.redis",
|
||||
"content": {
|
||||
"path": "mail_intake.credentials.redis",
|
||||
"docstring": "Redis-backed credential persistence for Mail Intake.\n\nThis module provides a Redis-based implementation of the\n``CredentialStore`` abstraction, enabling credential persistence\nacross distributed and horizontally scaled deployments.\n\nThe Redis credential store is designed for environments where\nauthentication credentials must be shared safely across multiple\nprocesses, containers, or nodes, such as container orchestration\nplatforms and microservice architectures.\n\nKey characteristics:\n- Distributed-safe, shared storage using Redis\n- Explicit, caller-defined serialization and deserialization\n- No reliance on unsafe mechanisms such as pickle\n- Optional time-to-live (TTL) support for automatic credential expiry\n\nThis module is responsible solely for persistence concerns.\nCredential validation, refresh, rotation, and acquisition remain the\nresponsibility of authentication provider implementations.",
|
||||
"docstring": "Redis-backed credential persistence for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides a Redis-based implementation of the\n``CredentialStore`` abstraction, enabling credential persistence\nacross distributed and horizontally scaled deployments.\n\nThe Redis credential store is designed for environments where\nauthentication credentials must be shared safely across multiple\nprocesses, containers, or nodes, such as container orchestration\nplatforms and microservice architectures.\n\nKey characteristics:\n- Distributed-safe, shared storage using Redis\n- Explicit, caller-defined serialization and deserialization\n- No reliance on unsafe mechanisms such as pickle\n- Optional time-to-live (TTL) support for automatic credential expiry\n\nThis module is responsible solely for persistence concerns.\nCredential validation, refresh, rotation, and acquisition remain the\nresponsibility of authentication provider implementations.",
|
||||
"objects": {
|
||||
"Optional": {
|
||||
"name": "Optional",
|
||||
@@ -30,28 +30,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore",
|
||||
"signature": "<bound method Alias.signature of Alias('CredentialStore', 'mail_intake.credentials.store.CredentialStore')>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore.load",
|
||||
"signature": "<bound method Alias.signature of Alias('load', 'mail_intake.credentials.store.CredentialStore.load')>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore.save",
|
||||
"signature": "<bound method Alias.signature of Alias('save', 'mail_intake.credentials.store.CredentialStore.save')>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.CredentialStore.clear",
|
||||
"signature": "<bound method Alias.signature of Alias('clear', 'mail_intake.credentials.store.CredentialStore.clear')>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -66,8 +66,8 @@
|
||||
"name": "RedisCredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore",
|
||||
"signature": "<bound method Class.signature of Class('RedisCredentialStore', 32, 142)>",
|
||||
"docstring": "Redis-backed implementation of ``CredentialStore``.\n\nThis store persists credentials in Redis and is suitable for\ndistributed and horizontally scaled deployments where credentials\nmust be shared across multiple processes or nodes.\n\nThe store is intentionally generic and delegates all serialization\nconcerns to caller-provided functions. This avoids unsafe mechanisms\nsuch as pickle and allows credential formats to be explicitly\ncontrolled and audited.\n\nThis class is responsible only for persistence and retrieval.\nIt does not interpret, validate, refresh, or otherwise manage\nthe lifecycle of the credentials being stored.",
|
||||
"signature": "<bound method Class.signature of Class('RedisCredentialStore', 36, 142)>",
|
||||
"docstring": "Redis-backed implementation of ``CredentialStore``.\n\nThis store persists credentials in Redis and is suitable for\ndistributed and horizontally scaled deployments where credentials\nmust be shared across multiple processes or nodes.\n\nNotes:\n **Responsibilities:**\n\n - This class is responsible only for persistence and retrieval\n - It does not interpret, validate, refresh, or otherwise manage the lifecycle of the credentials being stored\n\n **Guarantees:**\n\n - The store is intentionally generic and delegates all serialization concerns to caller-provided functions\n - This avoids unsafe mechanisms such as pickle and allows credential formats to be explicitly controlled and audited",
|
||||
"members": {
|
||||
"redis": {
|
||||
"name": "redis",
|
||||
@@ -108,22 +108,22 @@
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore.load",
|
||||
"signature": "<bound method Function.signature of Function('load', 94, 115)>",
|
||||
"docstring": "Load credentials from Redis.\n\nIf no value exists for the configured key, or if the stored\npayload cannot be successfully deserialized, this method\nreturns ``None``.\n\nThe store does not attempt to validate the returned credentials\nor determine whether they are expired or otherwise usable.\n\nReturns:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``."
|
||||
"signature": "<bound method Function.signature of Function('load', 89, 110)>",
|
||||
"docstring": "Load credentials from Redis.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are present and\n successfully deserialized; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - If no value exists for the configured key, or if the stored payload cannot be successfully deserialized, this method returns ``None``\n - The store does not attempt to validate the returned credentials or determine whether they are expired or otherwise usable"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore.save",
|
||||
"signature": "<bound method Function.signature of Function('save', 117, 133)>",
|
||||
"docstring": "Persist credentials to Redis.\n\nAny previously stored credentials under the same key are\noverwritten. If a TTL is configured, the credentials will\nexpire automatically after the specified duration.\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"signature": "<bound method Function.signature of Function('save', 112, 130)>",
|
||||
"docstring": "Persist credentials to Redis.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Responsibilities:**\n\n - Any previously stored credentials under the same key are overwritten\n - If a TTL is configured, the credentials will expire automatically after the specified duration"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.redis.RedisCredentialStore.clear",
|
||||
"signature": "<bound method Function.signature of Function('clear', 135, 142)>",
|
||||
"docstring": "Remove stored credentials from Redis.\n\nThis operation deletes the configured Redis key if it exists.\nImplementations should treat this method as idempotent."
|
||||
"signature": "<bound method Function.signature of Function('clear', 132, 142)>",
|
||||
"docstring": "Remove stored credentials from Redis.\n\nNotes:\n **Lifecycle:**\n\n - This operation deletes the configured Redis key if it exists\n - Implementations should treat this method as idempotent"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.credentials.store",
|
||||
"content": {
|
||||
"path": "mail_intake.credentials.store",
|
||||
"docstring": "Credential persistence abstractions for Mail Intake.\n\nThis module defines the generic persistence contract used to store and\nretrieve authentication credentials across Mail Intake components.\n\nThe ``CredentialStore`` abstraction establishes a strict separation\nbetween credential *lifecycle management* and credential *storage*.\nAuthentication providers are responsible for acquiring, validating,\nrefreshing, and revoking credentials, while concrete store\nimplementations are responsible solely for persistence concerns.\n\nBy remaining agnostic to credential structure, serialization format,\nand storage backend, this module enables multiple persistence\nstrategies—such as local files, in-memory caches, distributed stores,\nor secrets managers—without coupling authentication logic to any\nspecific storage mechanism.",
|
||||
"docstring": "Credential persistence abstractions for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the generic persistence contract used to store and\nretrieve authentication credentials across Mail Intake components.\n\nThe ``CredentialStore`` abstraction establishes a strict separation\nbetween credential *lifecycle management* and credential *storage*.\nAuthentication providers are responsible for acquiring, validating,\nrefreshing, and revoking credentials, while concrete store\nimplementations are responsible solely for persistence concerns.\n\nBy remaining agnostic to credential structure, serialization format,\nand storage backend, this module enables multiple persistence\nstrategies—such as local files, in-memory caches, distributed stores,\nor secrets managers—without coupling authentication logic to any\nspecific storage mechanism.",
|
||||
"objects": {
|
||||
"ABC": {
|
||||
"name": "ABC",
|
||||
@@ -50,29 +50,29 @@
|
||||
"name": "CredentialStore",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.credentials.store.CredentialStore",
|
||||
"signature": "<bound method Class.signature of Class('CredentialStore', 27, 90)>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nThis interface separates *credential lifecycle management* from\n*credential storage mechanics*. Implementations are responsible\nonly for persistence concerns, while authentication providers\nretain full control over credential creation, validation, refresh,\nand revocation logic.\n\nThe store is intentionally agnostic to:\n- The concrete credential type being stored\n- The serialization format used to persist credentials\n- The underlying storage backend or durability guarantees",
|
||||
"signature": "<bound method Class.signature of Class('CredentialStore', 31, 102)>",
|
||||
"docstring": "Abstract base class defining a generic persistence interface for\nauthentication credentials.\n\nNotes:\n **Responsibilities:**\n\n - Provide persistent storage separating life-cycle management from storage mechanics\n - Keep implementation focused only on persistence\n \n **Constraints:**\n \n - The store is intentionally agnostic to:\n - The concrete credential type being stored\n - The serialization format used to persist credentials\n - The underlying storage backend or durability guarantees",
|
||||
"members": {
|
||||
"load": {
|
||||
"name": "load",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.store.CredentialStore.load",
|
||||
"signature": "<bound method Function.signature of Function('load', 44, 59)>",
|
||||
"docstring": "Load previously persisted credentials.\n\nImplementations should return ``None`` when no credentials are\npresent or when stored credentials cannot be successfully\ndecoded or deserialized.\n\nThe store must not attempt to validate, refresh, or otherwise\ninterpret the returned credentials.\n\nReturns:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``."
|
||||
"signature": "<bound method Function.signature of Function('load', 50, 65)>",
|
||||
"docstring": "Load previously persisted credentials.\n\nReturns:\n Optional[T]:\n An instance of type ``T`` if credentials are available and\n loadable; otherwise ``None``.\n\nNotes:\n **Guarantees:**\n\n - Implementations should return ``None`` when no credentials are present or when stored credentials cannot be successfully decoded or deserialized\n - The store must not attempt to validate, refresh, or otherwise interpret the returned credentials"
|
||||
},
|
||||
"save": {
|
||||
"name": "save",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.store.CredentialStore.save",
|
||||
"signature": "<bound method Function.signature of Function('save', 61, 78)>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nThis method is invoked when credentials are newly obtained or\nhave been refreshed and are known to be valid at the time of\npersistence.\n\nImplementations are responsible for:\n- Ensuring durability appropriate to the deployment context\n- Applying encryption or access controls where required\n- Overwriting any previously stored credentials\n\nArgs:\n credentials:\n The credential object to persist."
|
||||
"signature": "<bound method Function.signature of Function('save', 67, 86)>",
|
||||
"docstring": "Persist credentials to the underlying storage backend.\n\nArgs:\n credentials (T):\n The credential object to persist.\n\nNotes:\n **Lifecycle:**\n\n - This method is invoked when credentials are newly obtained or have been refreshed and are known to be valid at the time of persistence\n\n **Responsibilities:**\n\n - Ensuring durability appropriate to the deployment context\n - Applying encryption or access controls where required\n - Overwriting any previously stored credentials"
|
||||
},
|
||||
"clear": {
|
||||
"name": "clear",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.credentials.store.CredentialStore.clear",
|
||||
"signature": "<bound method Function.signature of Function('clear', 80, 90)>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nThis method is called when credentials are known to be invalid,\nrevoked, corrupted, or otherwise unusable, and must ensure that\nno stale authentication material remains accessible.\n\nImplementations should treat this operation as idempotent."
|
||||
"signature": "<bound method Function.signature of Function('clear', 88, 102)>",
|
||||
"docstring": "Remove any persisted credentials from the store.\n\nNotes:\n **Lifecycle:**\n\n - This method is called when credentials are known to be invalid, revoked, corrupted, or otherwise unusable\n - Must ensure that no stale authentication material remains accessible\n\n **Guarantees:**\n\n - Implementations should treat this operation as idempotent"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,35 +2,35 @@
|
||||
"module": "mail_intake.exceptions",
|
||||
"content": {
|
||||
"path": "mail_intake.exceptions",
|
||||
"docstring": "Exception hierarchy for Mail Intake.\n\nThis module defines the **canonical exception types** used throughout the\nMail Intake library.\n\nAll library-raised errors derive from `MailIntakeError`. Consumers are\nencouraged to catch this base type (or specific subclasses) rather than\nprovider-specific or third-party exceptions.",
|
||||
"docstring": "Exception hierarchy for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **canonical exception types** used throughout the\nMail Intake library.\n\nAll library-raised errors derive from `MailIntakeError`. Consumers are\nencouraged to catch this base type (or specific subclasses) rather than\nprovider-specific or third-party exceptions.",
|
||||
"objects": {
|
||||
"MailIntakeError": {
|
||||
"name": "MailIntakeError",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.exceptions.MailIntakeError",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeError', 13, 22)>",
|
||||
"docstring": "Base exception for all Mail Intake errors.\n\nThis is the root of the Mail Intake exception hierarchy.\nAll errors raised by the library must derive from this class.\n\nConsumers should generally catch this type when handling\nlibrary-level failures."
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeError', 17, 27)>",
|
||||
"docstring": "Base exception for all Mail Intake errors.\n\nNotes:\n **Guarantees:**\n\n - This is the root of the Mail Intake exception hierarchy\n - All errors raised by the library must derive from this class\n - Consumers should generally catch this type when handling library-level failures"
|
||||
},
|
||||
"MailIntakeAuthError": {
|
||||
"name": "MailIntakeAuthError",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.exceptions.MailIntakeAuthError",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAuthError', 25, 31)>",
|
||||
"docstring": "Authentication and credential-related failures.\n\nRaised when authentication providers are unable to acquire,\nrefresh, or persist valid credentials."
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAuthError', 30, 38)>",
|
||||
"docstring": "Authentication and credential-related failures.\n\nNotes:\n **Lifecycle:**\n\n - Raised when authentication providers are unable to acquire, refresh, or persist valid credentials"
|
||||
},
|
||||
"MailIntakeAdapterError": {
|
||||
"name": "MailIntakeAdapterError",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.exceptions.MailIntakeAdapterError",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAdapterError', 34, 40)>",
|
||||
"docstring": "Errors raised by mail provider adapters.\n\nRaised when a provider adapter encounters API errors,\ntransport failures, or invalid provider responses."
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeAdapterError', 41, 49)>",
|
||||
"docstring": "Errors raised by mail provider adapters.\n\nNotes:\n **Lifecycle:**\n\n - Raised when a provider adapter encounters API errors, transport failures, or invalid provider responses"
|
||||
},
|
||||
"MailIntakeParsingError": {
|
||||
"name": "MailIntakeParsingError",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.exceptions.MailIntakeParsingError",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeParsingError', 43, 49)>",
|
||||
"docstring": "Errors encountered while parsing message content.\n\nRaised when raw provider payloads cannot be interpreted\nor normalized into internal domain models."
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeParsingError', 52, 60)>",
|
||||
"docstring": "Errors encountered while parsing message content.\n\nNotes:\n **Lifecycle:**\n\n - Raised when raw provider payloads cannot be interpreted or normalized into internal domain models"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,28 +2,28 @@
|
||||
"module": "mail_intake.ingestion",
|
||||
"content": {
|
||||
"path": "mail_intake.ingestion",
|
||||
"docstring": "Mail ingestion orchestration for Mail Intake.\n\nThis package contains **high-level ingestion components** responsible for\ncoordinating mail retrieval, parsing, normalization, and model construction.\n\nIt represents the **top of the ingestion pipeline** and is intended to be the\nprimary interaction surface for library consumers.\n\nComponents in this package:\n- Are provider-agnostic\n- Depend only on adapter and parser contracts\n- Contain no provider-specific API logic\n- Expose read-only ingestion workflows\n\nConsumers are expected to construct a mail adapter and pass it to the\ningestion layer to begin processing messages and threads.",
|
||||
"docstring": "Mail ingestion orchestration for Mail Intake.\n\n---\n\n## Summary\n\nThis package contains **high-level ingestion components** responsible for\ncoordinating mail retrieval, parsing, normalization, and model construction.\n\nIt represents the **top of the ingestion pipeline** and is intended to be the\nprimary interaction surface for library consumers.\n\nComponents in this package:\n- Are provider-agnostic\n- Depend only on adapter and parser contracts\n- Contain no provider-specific API logic\n- Expose read-only ingestion workflows\n\nConsumers are expected to construct a mail adapter and pass it to the\ningestion layer to begin processing messages and threads.\n\n---\n\n## Public API\n\n MailIntakeReader\n\n---",
|
||||
"objects": {
|
||||
"MailIntakeReader": {
|
||||
"name": "MailIntakeReader",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.MailIntakeReader",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeReader', 'mail_intake.ingestion.reader.MailIntakeReader')>",
|
||||
"docstring": "High-level read-only ingestion interface.\n\nThis class is the **primary entry point** for consumers of the Mail\nIntake library.\n\nIt orchestrates the full ingestion pipeline:\n- Querying the adapter for message references\n- Fetching raw provider messages\n- Parsing and normalizing message data\n- Constructing domain models\n\nThis class is intentionally:\n- Provider-agnostic\n- Stateless beyond iteration scope\n- Read-only",
|
||||
"docstring": "High-level read-only ingestion interface.\n\nNotes:\n **Responsibilities:**\n\n - This class is the primary entry point for consumers of the Mail Intake library\n - It orchestrates the full ingestion pipeline: Querying the adapter for message references, fetching raw provider messages, parsing and normalizing message data, constructing domain models\n\n **Constraints:**\n \n - This class is intentionally: Provider-agnostic, stateless beyond iteration scope, read-only",
|
||||
"members": {
|
||||
"iter_messages": {
|
||||
"name": "iter_messages",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.MailIntakeReader.iter_messages",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_messages', 'mail_intake.ingestion.reader.MailIntakeReader.iter_messages')>",
|
||||
"docstring": "Iterate over parsed messages matching a provider query.\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Fully parsed and normalized `MailIntakeMessage` instances.\n\nRaises:\n MailIntakeParsingError: If a message cannot be parsed."
|
||||
"docstring": "Iterate over parsed messages matching a provider query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n MailIntakeMessage:\n Fully parsed and normalized `MailIntakeMessage` instances.\n\nRaises:\n MailIntakeParsingError:\n If a message cannot be parsed."
|
||||
},
|
||||
"iter_threads": {
|
||||
"name": "iter_threads",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.MailIntakeReader.iter_threads",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_threads', 'mail_intake.ingestion.reader.MailIntakeReader.iter_threads')>",
|
||||
"docstring": "Iterate over threads constructed from messages matching a query.\n\nMessages are grouped by `thread_id` and yielded as complete thread\nobjects containing all associated messages.\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nReturns:\n An iterator of `MailIntakeThread` instances.\n\nRaises:\n MailIntakeParsingError: If a message cannot be parsed."
|
||||
"docstring": "Iterate over threads constructed from messages matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n MailIntakeThread:\n An iterator of `MailIntakeThread` instances.\n\nRaises:\n MailIntakeParsingError:\n If a message cannot be parsed.\n\nNotes:\n **Guarantees:**\n\n - Messages are grouped by `thread_id` and yielded as complete thread objects containing all associated messages"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -32,7 +32,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.ingestion.reader",
|
||||
"signature": null,
|
||||
"docstring": "High-level mail ingestion orchestration for Mail Intake.\n\nThis module provides the primary, provider-agnostic entry point for\nreading and processing mail data.\n\nIt coordinates:\n- Mail adapter access\n- Message and thread iteration\n- Header and body parsing\n- Normalization and model construction\n\nNo provider-specific logic or API semantics are permitted in this layer.",
|
||||
"docstring": "High-level mail ingestion orchestration for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides the primary, provider-agnostic entry point for\nreading and processing mail data.\n\nIt coordinates:\n- Mail adapter access\n- Message and thread iteration\n- Header and body parsing\n- Normalization and model construction\n\nNo provider-specific logic or API semantics are permitted in this layer.",
|
||||
"members": {
|
||||
"datetime": {
|
||||
"name": "datetime",
|
||||
@@ -67,28 +67,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapter', 'mail_intake.adapters.base.MailIntakeAdapter')>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_message_refs', 'mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs')>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_message', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_message')>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_thread', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_thread')>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -97,7 +97,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeMessage",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeMessage', 'mail_intake.models.message.MailIntakeMessage')>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
@@ -169,7 +169,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeThread",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeThread', 'mail_intake.models.thread.MailIntakeThread')>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nA thread groups multiple related messages under a single subject\nand participant set. It is designed to support reasoning over\nconversational context such as job applications, interviews,\nfollow-ups, and ongoing discussions.\n\nThis model is provider-agnostic and safe to persist.",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nNotes:\n **Guarantees:**\n\n - A thread groups multiple related messages under a single subject and participant set\n - It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions\n - This model is provider-agnostic and safe to persist",
|
||||
"members": {
|
||||
"thread_id": {
|
||||
"name": "thread_id",
|
||||
@@ -211,7 +211,7 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeThread.add_message",
|
||||
"signature": "<bound method Alias.signature of Alias('add_message', 'mail_intake.models.thread.MailIntakeThread.add_message')>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nThis method:\n- Appends the message to the thread\n- Tracks unique participants\n- Updates the last activity timestamp\n\nArgs:\n message: Parsed mail message to add to the thread."
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nArgs:\n message (MailIntakeMessage):\n Parsed mail message to add to the thread.\n\nNotes:\n **Responsibilities:**\n\n - Appends the message to the thread\n - Tracks unique participants\n - Updates the last activity timestamp"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -220,14 +220,14 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.parse_headers",
|
||||
"signature": "<bound method Alias.signature of Alias('parse_headers', 'mail_intake.parsers.headers.parse_headers')>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nProvider payloads (such as Gmail) typically represent headers as a list\nof name/value mappings. This function normalizes them into a\ncase-insensitive dictionary keyed by lowercase header names.\n\nArgs:\n raw_headers: List of header dictionaries, each containing\n ``name`` and ``value`` keys.\n\nReturns:\n Dictionary mapping lowercase header names to stripped values.\n\nExample:\n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nArgs:\n raw_headers (List[Dict[str, str]]):\n List of header dictionaries, each containing ``name`` and ``value`` keys.\n\nReturns:\n Dict[str, str]:\n Dictionary mapping lowercase header names to stripped values.\n\nNotes:\n **Guarantees:**\n\n - Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings\n - This function normalizes them into a case-insensitive dictionary keyed by lowercase header names\n\nExample:\n Typical usage:\n \n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
},
|
||||
"extract_sender": {
|
||||
"name": "extract_sender",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.extract_sender",
|
||||
"signature": "<bound method Alias.signature of Alias('extract_sender', 'mail_intake.parsers.headers.extract_sender')>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nThis function parses the ``From`` header and attempts to extract:\n- Sender email address\n- Optional human-readable display name\n\nArgs:\n headers: Normalized header dictionary as returned by\n :func:`parse_headers`.\n\nReturns:\n A tuple ``(email, name)`` where:\n - ``email`` is the sender email address\n - ``name`` is the display name, or ``None`` if unavailable\n\nExamples:\n ``\"John Doe <john@example.com>\"`` → ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` → ``(\"john@example.com\", None)``"
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nArgs:\n headers (Dict[str, str]):\n Normalized header dictionary as returned by :func:`parse_headers`.\n\nReturns:\n Tuple[str, Optional[str]]:\n A tuple ``(email, name)`` where ``email`` is the sender email address and ``name`` is the display name, or ``None`` if unavailable.\n\nNotes:\n **Responsibilities:**\n\n - This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name\n\nExample:\n Typical values:\n\n ``\"John Doe <john@example.com>\"`` -> ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` -> ``(\"john@example.com\", None)``"
|
||||
},
|
||||
"extract_body": {
|
||||
"name": "extract_body",
|
||||
@@ -241,35 +241,35 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.normalize_subject",
|
||||
"signature": "<bound method Alias.signature of Alias('normalize_subject', 'mail_intake.parsers.subject.normalize_subject')>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nOperations:\n- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n- Repeats prefix stripping to handle stacked prefixes\n- Collapses excessive whitespace\n- Preserves original casing (no lowercasing)\n\nThis function is intentionally conservative and avoids aggressive\ntransformations that could alter the semantic meaning of the subject.\n\nArgs:\n subject: Raw subject line from a message header.\n\nReturns:\n Normalized subject string suitable for thread grouping."
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nArgs:\n subject (str):\n Raw subject line from a message header.\n\nReturns:\n str:\n Normalized subject string suitable for thread grouping.\n\nNotes:\n **Responsibilities:**\n\n - Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n - Repeats prefix stripping to handle stacked prefixes\n - Collapses excessive whitespace\n - Preserves original casing (no lowercasing)\n\n **Guarantees:**\n\n - This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject"
|
||||
},
|
||||
"MailIntakeParsingError": {
|
||||
"name": "MailIntakeParsingError",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeParsingError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeParsingError', 'mail_intake.exceptions.MailIntakeParsingError')>",
|
||||
"docstring": "Errors encountered while parsing message content.\n\nRaised when raw provider payloads cannot be interpreted\nor normalized into internal domain models."
|
||||
"docstring": "Errors encountered while parsing message content.\n\nNotes:\n **Lifecycle:**\n\n - Raised when raw provider payloads cannot be interpreted or normalized into internal domain models"
|
||||
},
|
||||
"MailIntakeReader": {
|
||||
"name": "MailIntakeReader",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeReader",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeReader', 28, 155)>",
|
||||
"docstring": "High-level read-only ingestion interface.\n\nThis class is the **primary entry point** for consumers of the Mail\nIntake library.\n\nIt orchestrates the full ingestion pipeline:\n- Querying the adapter for message references\n- Fetching raw provider messages\n- Parsing and normalizing message data\n- Constructing domain models\n\nThis class is intentionally:\n- Provider-agnostic\n- Stateless beyond iteration scope\n- Read-only",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeReader', 32, 165)>",
|
||||
"docstring": "High-level read-only ingestion interface.\n\nNotes:\n **Responsibilities:**\n\n - This class is the primary entry point for consumers of the Mail Intake library\n - It orchestrates the full ingestion pipeline: Querying the adapter for message references, fetching raw provider messages, parsing and normalizing message data, constructing domain models\n\n **Constraints:**\n \n - This class is intentionally: Provider-agnostic, stateless beyond iteration scope, read-only",
|
||||
"members": {
|
||||
"iter_messages": {
|
||||
"name": "iter_messages",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeReader.iter_messages",
|
||||
"signature": "<bound method Function.signature of Function('iter_messages', 57, 72)>",
|
||||
"docstring": "Iterate over parsed messages matching a provider query.\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Fully parsed and normalized `MailIntakeMessage` instances.\n\nRaises:\n MailIntakeParsingError: If a message cannot be parsed."
|
||||
"signature": "<bound method Function.signature of Function('iter_messages', 57, 75)>",
|
||||
"docstring": "Iterate over parsed messages matching a provider query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n MailIntakeMessage:\n Fully parsed and normalized `MailIntakeMessage` instances.\n\nRaises:\n MailIntakeParsingError:\n If a message cannot be parsed."
|
||||
},
|
||||
"iter_threads": {
|
||||
"name": "iter_threads",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeReader.iter_threads",
|
||||
"signature": "<bound method Function.signature of Function('iter_threads', 74, 106)>",
|
||||
"docstring": "Iterate over threads constructed from messages matching a query.\n\nMessages are grouped by `thread_id` and yielded as complete thread\nobjects containing all associated messages.\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nReturns:\n An iterator of `MailIntakeThread` instances.\n\nRaises:\n MailIntakeParsingError: If a message cannot be parsed."
|
||||
"signature": "<bound method Function.signature of Function('iter_threads', 77, 114)>",
|
||||
"docstring": "Iterate over threads constructed from messages matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n MailIntakeThread:\n An iterator of `MailIntakeThread` instances.\n\nRaises:\n MailIntakeParsingError:\n If a message cannot be parsed.\n\nNotes:\n **Guarantees:**\n\n - Messages are grouped by `thread_id` and yielded as complete thread objects containing all associated messages"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.ingestion.reader",
|
||||
"content": {
|
||||
"path": "mail_intake.ingestion.reader",
|
||||
"docstring": "High-level mail ingestion orchestration for Mail Intake.\n\nThis module provides the primary, provider-agnostic entry point for\nreading and processing mail data.\n\nIt coordinates:\n- Mail adapter access\n- Message and thread iteration\n- Header and body parsing\n- Normalization and model construction\n\nNo provider-specific logic or API semantics are permitted in this layer.",
|
||||
"docstring": "High-level mail ingestion orchestration for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides the primary, provider-agnostic entry point for\nreading and processing mail data.\n\nIt coordinates:\n- Mail adapter access\n- Message and thread iteration\n- Header and body parsing\n- Normalization and model construction\n\nNo provider-specific logic or API semantics are permitted in this layer.",
|
||||
"objects": {
|
||||
"datetime": {
|
||||
"name": "datetime",
|
||||
@@ -37,28 +37,28 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeAdapter', 'mail_intake.adapters.base.MailIntakeAdapter')>",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nThis interface defines the minimal contract required to:\n- Discover messages matching a query\n- Retrieve full message payloads\n- Retrieve full thread payloads\n\nAdapters are intentionally read-only and must not mutate provider state.",
|
||||
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - discover messages matching a query\n - retrieve full message payloads\n - retrieve full thread payloads\n\n **Lifecycle:**\n\n - adapters are intentionally read-only and must not mutate provider state",
|
||||
"members": {
|
||||
"iter_message_refs": {
|
||||
"name": "iter_message_refs",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter.iter_message_refs",
|
||||
"signature": "<bound method Alias.signature of Alias('iter_message_refs', 'mail_intake.adapters.base.MailIntakeAdapter.iter_message_refs')>",
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nImplementations must yield dictionaries containing at least:\n- ``message_id``: Provider-specific message identifier\n- ``thread_id``: Provider-specific thread identifier\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Dictionaries containing message and thread identifiers.\n\nExample yield:\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n Dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least ``message_id`` and ``thread_id``\n\nExample:\n Typical yield:\n\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }"
|
||||
},
|
||||
"fetch_message": {
|
||||
"name": "fetch_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter.fetch_message",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_message', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_message')>",
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id: Provider-specific message identifier.\n\nReturns:\n Provider-native message payload\n (e.g., Gmail message JSON structure)."
|
||||
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
||||
},
|
||||
"fetch_thread": {
|
||||
"name": "fetch_thread",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeAdapter.fetch_thread",
|
||||
"signature": "<bound method Alias.signature of Alias('fetch_thread', 'mail_intake.adapters.base.MailIntakeAdapter.fetch_thread')>",
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id: Provider-specific thread identifier.\n\nReturns:\n Provider-native thread payload."
|
||||
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n Dict[str, Any]:\n Provider-native thread payload."
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -67,7 +67,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeMessage",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeMessage', 'mail_intake.models.message.MailIntakeMessage')>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
@@ -139,7 +139,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeThread",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeThread', 'mail_intake.models.thread.MailIntakeThread')>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nA thread groups multiple related messages under a single subject\nand participant set. It is designed to support reasoning over\nconversational context such as job applications, interviews,\nfollow-ups, and ongoing discussions.\n\nThis model is provider-agnostic and safe to persist.",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nNotes:\n **Guarantees:**\n\n - A thread groups multiple related messages under a single subject and participant set\n - It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions\n - This model is provider-agnostic and safe to persist",
|
||||
"members": {
|
||||
"thread_id": {
|
||||
"name": "thread_id",
|
||||
@@ -181,7 +181,7 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeThread.add_message",
|
||||
"signature": "<bound method Alias.signature of Alias('add_message', 'mail_intake.models.thread.MailIntakeThread.add_message')>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nThis method:\n- Appends the message to the thread\n- Tracks unique participants\n- Updates the last activity timestamp\n\nArgs:\n message: Parsed mail message to add to the thread."
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nArgs:\n message (MailIntakeMessage):\n Parsed mail message to add to the thread.\n\nNotes:\n **Responsibilities:**\n\n - Appends the message to the thread\n - Tracks unique participants\n - Updates the last activity timestamp"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -190,14 +190,14 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.parse_headers",
|
||||
"signature": "<bound method Alias.signature of Alias('parse_headers', 'mail_intake.parsers.headers.parse_headers')>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nProvider payloads (such as Gmail) typically represent headers as a list\nof name/value mappings. This function normalizes them into a\ncase-insensitive dictionary keyed by lowercase header names.\n\nArgs:\n raw_headers: List of header dictionaries, each containing\n ``name`` and ``value`` keys.\n\nReturns:\n Dictionary mapping lowercase header names to stripped values.\n\nExample:\n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nArgs:\n raw_headers (List[Dict[str, str]]):\n List of header dictionaries, each containing ``name`` and ``value`` keys.\n\nReturns:\n Dict[str, str]:\n Dictionary mapping lowercase header names to stripped values.\n\nNotes:\n **Guarantees:**\n\n - Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings\n - This function normalizes them into a case-insensitive dictionary keyed by lowercase header names\n\nExample:\n Typical usage:\n \n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
},
|
||||
"extract_sender": {
|
||||
"name": "extract_sender",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.extract_sender",
|
||||
"signature": "<bound method Alias.signature of Alias('extract_sender', 'mail_intake.parsers.headers.extract_sender')>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nThis function parses the ``From`` header and attempts to extract:\n- Sender email address\n- Optional human-readable display name\n\nArgs:\n headers: Normalized header dictionary as returned by\n :func:`parse_headers`.\n\nReturns:\n A tuple ``(email, name)`` where:\n - ``email`` is the sender email address\n - ``name`` is the display name, or ``None`` if unavailable\n\nExamples:\n ``\"John Doe <john@example.com>\"`` → ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` → ``(\"john@example.com\", None)``"
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nArgs:\n headers (Dict[str, str]):\n Normalized header dictionary as returned by :func:`parse_headers`.\n\nReturns:\n Tuple[str, Optional[str]]:\n A tuple ``(email, name)`` where ``email`` is the sender email address and ``name`` is the display name, or ``None`` if unavailable.\n\nNotes:\n **Responsibilities:**\n\n - This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name\n\nExample:\n Typical values:\n\n ``\"John Doe <john@example.com>\"`` -> ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` -> ``(\"john@example.com\", None)``"
|
||||
},
|
||||
"extract_body": {
|
||||
"name": "extract_body",
|
||||
@@ -211,35 +211,35 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.normalize_subject",
|
||||
"signature": "<bound method Alias.signature of Alias('normalize_subject', 'mail_intake.parsers.subject.normalize_subject')>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nOperations:\n- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n- Repeats prefix stripping to handle stacked prefixes\n- Collapses excessive whitespace\n- Preserves original casing (no lowercasing)\n\nThis function is intentionally conservative and avoids aggressive\ntransformations that could alter the semantic meaning of the subject.\n\nArgs:\n subject: Raw subject line from a message header.\n\nReturns:\n Normalized subject string suitable for thread grouping."
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nArgs:\n subject (str):\n Raw subject line from a message header.\n\nReturns:\n str:\n Normalized subject string suitable for thread grouping.\n\nNotes:\n **Responsibilities:**\n\n - Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n - Repeats prefix stripping to handle stacked prefixes\n - Collapses excessive whitespace\n - Preserves original casing (no lowercasing)\n\n **Guarantees:**\n\n - This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject"
|
||||
},
|
||||
"MailIntakeParsingError": {
|
||||
"name": "MailIntakeParsingError",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeParsingError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeParsingError', 'mail_intake.exceptions.MailIntakeParsingError')>",
|
||||
"docstring": "Errors encountered while parsing message content.\n\nRaised when raw provider payloads cannot be interpreted\nor normalized into internal domain models."
|
||||
"docstring": "Errors encountered while parsing message content.\n\nNotes:\n **Lifecycle:**\n\n - Raised when raw provider payloads cannot be interpreted or normalized into internal domain models"
|
||||
},
|
||||
"MailIntakeReader": {
|
||||
"name": "MailIntakeReader",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeReader",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeReader', 28, 155)>",
|
||||
"docstring": "High-level read-only ingestion interface.\n\nThis class is the **primary entry point** for consumers of the Mail\nIntake library.\n\nIt orchestrates the full ingestion pipeline:\n- Querying the adapter for message references\n- Fetching raw provider messages\n- Parsing and normalizing message data\n- Constructing domain models\n\nThis class is intentionally:\n- Provider-agnostic\n- Stateless beyond iteration scope\n- Read-only",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeReader', 32, 165)>",
|
||||
"docstring": "High-level read-only ingestion interface.\n\nNotes:\n **Responsibilities:**\n\n - This class is the primary entry point for consumers of the Mail Intake library\n - It orchestrates the full ingestion pipeline: Querying the adapter for message references, fetching raw provider messages, parsing and normalizing message data, constructing domain models\n\n **Constraints:**\n \n - This class is intentionally: Provider-agnostic, stateless beyond iteration scope, read-only",
|
||||
"members": {
|
||||
"iter_messages": {
|
||||
"name": "iter_messages",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeReader.iter_messages",
|
||||
"signature": "<bound method Function.signature of Function('iter_messages', 57, 72)>",
|
||||
"docstring": "Iterate over parsed messages matching a provider query.\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nYields:\n Fully parsed and normalized `MailIntakeMessage` instances.\n\nRaises:\n MailIntakeParsingError: If a message cannot be parsed."
|
||||
"signature": "<bound method Function.signature of Function('iter_messages', 57, 75)>",
|
||||
"docstring": "Iterate over parsed messages matching a provider query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n MailIntakeMessage:\n Fully parsed and normalized `MailIntakeMessage` instances.\n\nRaises:\n MailIntakeParsingError:\n If a message cannot be parsed."
|
||||
},
|
||||
"iter_threads": {
|
||||
"name": "iter_threads",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.ingestion.reader.MailIntakeReader.iter_threads",
|
||||
"signature": "<bound method Function.signature of Function('iter_threads', 74, 106)>",
|
||||
"docstring": "Iterate over threads constructed from messages matching a query.\n\nMessages are grouped by `thread_id` and yielded as complete thread\nobjects containing all associated messages.\n\nArgs:\n query: Provider-specific query string used to filter messages.\n\nReturns:\n An iterator of `MailIntakeThread` instances.\n\nRaises:\n MailIntakeParsingError: If a message cannot be parsed."
|
||||
"signature": "<bound method Function.signature of Function('iter_threads', 77, 114)>",
|
||||
"docstring": "Iterate over threads constructed from messages matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nYields:\n MailIntakeThread:\n An iterator of `MailIntakeThread` instances.\n\nRaises:\n MailIntakeParsingError:\n If a message cannot be parsed.\n\nNotes:\n **Guarantees:**\n\n - Messages are grouped by `thread_id` and yielded as complete thread objects containing all associated messages"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2,14 +2,14 @@
|
||||
"module": "mail_intake.models",
|
||||
"content": {
|
||||
"path": "mail_intake.models",
|
||||
"docstring": "Domain models for Mail Intake.\n\nThis package defines the **canonical, provider-agnostic data models**\nused throughout the Mail Intake ingestion pipeline.\n\nModels in this package:\n- Represent fully parsed and normalized mail data\n- Are safe to persist, serialize, and index\n- Contain no provider-specific payloads or API semantics\n- Serve as stable inputs for downstream processing and analysis\n\nThese models form the core internal data contract of the library.",
|
||||
"docstring": "Domain models for Mail Intake.\n\n---\n\n## Summary\n\nThis package defines the **canonical, provider-agnostic data models**\nused throughout the Mail Intake ingestion pipeline.\n\nModels in this package:\n- Represent fully parsed and normalized mail data\n- Are safe to persist, serialize, and index\n- Contain no provider-specific payloads or API semantics\n- Serve as stable inputs for downstream processing and analysis\n\nThese models form the core internal data contract of the library.\n\n---\n\n## Public API\n\n MailIntakeMessage\n MailIntakeThread\n\n---",
|
||||
"objects": {
|
||||
"MailIntakeMessage": {
|
||||
"name": "MailIntakeMessage",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.MailIntakeMessage",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeMessage', 'mail_intake.models.message.MailIntakeMessage')>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
@@ -81,7 +81,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.MailIntakeThread",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeThread', 'mail_intake.models.thread.MailIntakeThread')>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nA thread groups multiple related messages under a single subject\nand participant set. It is designed to support reasoning over\nconversational context such as job applications, interviews,\nfollow-ups, and ongoing discussions.\n\nThis model is provider-agnostic and safe to persist.",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nNotes:\n **Guarantees:**\n\n - A thread groups multiple related messages under a single subject and participant set\n - It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions\n - This model is provider-agnostic and safe to persist",
|
||||
"members": {
|
||||
"thread_id": {
|
||||
"name": "thread_id",
|
||||
@@ -123,7 +123,7 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.models.MailIntakeThread.add_message",
|
||||
"signature": "<bound method Alias.signature of Alias('add_message', 'mail_intake.models.thread.MailIntakeThread.add_message')>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nThis method:\n- Appends the message to the thread\n- Tracks unique participants\n- Updates the last activity timestamp\n\nArgs:\n message: Parsed mail message to add to the thread."
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nArgs:\n message (MailIntakeMessage):\n Parsed mail message to add to the thread.\n\nNotes:\n **Responsibilities:**\n\n - Appends the message to the thread\n - Tracks unique participants\n - Updates the last activity timestamp"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -132,7 +132,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.models.message",
|
||||
"signature": null,
|
||||
"docstring": "Message domain models for Mail Intake.\n\nThis module defines the **canonical, provider-agnostic representation**\nof an individual email message as used internally by the Mail Intake\ningestion pipeline.\n\nModels in this module are safe to persist and must not contain any\nprovider-specific fields or semantics.",
|
||||
"docstring": "Message domain models for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **canonical, provider-agnostic representation**\nof an individual email message as used internally by the Mail Intake\ningestion pipeline.\n\nModels in this module are safe to persist and must not contain any\nprovider-specific fields or semantics.",
|
||||
"members": {
|
||||
"dataclass": {
|
||||
"name": "dataclass",
|
||||
@@ -166,8 +166,8 @@
|
||||
"name": "MailIntakeMessage",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.message.MailIntakeMessage",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeMessage', 17, 55)>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeMessage', 21, 80)>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
@@ -241,7 +241,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.models.thread",
|
||||
"signature": null,
|
||||
"docstring": "Thread domain models for Mail Intake.\n\nThis module defines the **canonical, provider-agnostic representation**\nof an email thread as used internally by the Mail Intake ingestion pipeline.\n\nThreads group related messages and serve as the primary unit of reasoning\nfor higher-level correspondence workflows.",
|
||||
"docstring": "Thread domain models for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **canonical, provider-agnostic representation**\nof an email thread as used internally by the Mail Intake ingestion pipeline.\n\nThreads group related messages and serve as the primary unit of reasoning\nfor higher-level correspondence workflows.",
|
||||
"members": {
|
||||
"dataclass": {
|
||||
"name": "dataclass",
|
||||
@@ -283,7 +283,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.thread.MailIntakeMessage",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeMessage', 'mail_intake.models.message.MailIntakeMessage')>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
@@ -354,8 +354,8 @@
|
||||
"name": "MailIntakeThread",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.thread.MailIntakeThread",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeThread', 18, 64)>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nA thread groups multiple related messages under a single subject\nand participant set. It is designed to support reasoning over\nconversational context such as job applications, interviews,\nfollow-ups, and ongoing discussions.\n\nThis model is provider-agnostic and safe to persist.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeThread', 22, 81)>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nNotes:\n **Guarantees:**\n\n - A thread groups multiple related messages under a single subject and participant set\n - It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions\n - This model is provider-agnostic and safe to persist",
|
||||
"members": {
|
||||
"thread_id": {
|
||||
"name": "thread_id",
|
||||
@@ -396,8 +396,8 @@
|
||||
"name": "add_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.models.thread.MailIntakeThread.add_message",
|
||||
"signature": "<bound method Function.signature of Function('add_message', 46, 64)>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nThis method:\n- Appends the message to the thread\n- Tracks unique participants\n- Updates the last activity timestamp\n\nArgs:\n message: Parsed mail message to add to the thread."
|
||||
"signature": "<bound method Function.signature of Function('add_message', 60, 81)>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nArgs:\n message (MailIntakeMessage):\n Parsed mail message to add to the thread.\n\nNotes:\n **Responsibilities:**\n\n - Appends the message to the thread\n - Tracks unique participants\n - Updates the last activity timestamp"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.models.message",
|
||||
"content": {
|
||||
"path": "mail_intake.models.message",
|
||||
"docstring": "Message domain models for Mail Intake.\n\nThis module defines the **canonical, provider-agnostic representation**\nof an individual email message as used internally by the Mail Intake\ningestion pipeline.\n\nModels in this module are safe to persist and must not contain any\nprovider-specific fields or semantics.",
|
||||
"docstring": "Message domain models for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **canonical, provider-agnostic representation**\nof an individual email message as used internally by the Mail Intake\ningestion pipeline.\n\nModels in this module are safe to persist and must not contain any\nprovider-specific fields or semantics.",
|
||||
"objects": {
|
||||
"dataclass": {
|
||||
"name": "dataclass",
|
||||
@@ -36,8 +36,8 @@
|
||||
"name": "MailIntakeMessage",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.message.MailIntakeMessage",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeMessage', 17, 55)>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeMessage', 21, 80)>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.models.thread",
|
||||
"content": {
|
||||
"path": "mail_intake.models.thread",
|
||||
"docstring": "Thread domain models for Mail Intake.\n\nThis module defines the **canonical, provider-agnostic representation**\nof an email thread as used internally by the Mail Intake ingestion pipeline.\n\nThreads group related messages and serve as the primary unit of reasoning\nfor higher-level correspondence workflows.",
|
||||
"docstring": "Thread domain models for Mail Intake.\n\n---\n\n## Summary\n\nThis module defines the **canonical, provider-agnostic representation**\nof an email thread as used internally by the Mail Intake ingestion pipeline.\n\nThreads group related messages and serve as the primary unit of reasoning\nfor higher-level correspondence workflows.",
|
||||
"objects": {
|
||||
"dataclass": {
|
||||
"name": "dataclass",
|
||||
@@ -44,7 +44,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.thread.MailIntakeMessage",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeMessage', 'mail_intake.models.message.MailIntakeMessage')>",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nThis model represents a fully parsed and normalized email message.\nIt is intentionally provider-agnostic and suitable for persistence,\nindexing, and downstream processing.\n\nNo provider-specific identifiers, payloads, or API semantics\nshould appear in this model.",
|
||||
"docstring": "Canonical internal representation of a single email message.\n\nNotes:\n **Guarantees:**\n\n - This model represents a fully parsed and normalized email message\n - It is intentionally provider-agnostic and suitable for persistence, indexing, and downstream processing\n\n **Constraints:**\n \n - No provider-specific identifiers, payloads, or API semantics should appear in this model",
|
||||
"members": {
|
||||
"message_id": {
|
||||
"name": "message_id",
|
||||
@@ -115,8 +115,8 @@
|
||||
"name": "MailIntakeThread",
|
||||
"kind": "class",
|
||||
"path": "mail_intake.models.thread.MailIntakeThread",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeThread', 18, 64)>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nA thread groups multiple related messages under a single subject\nand participant set. It is designed to support reasoning over\nconversational context such as job applications, interviews,\nfollow-ups, and ongoing discussions.\n\nThis model is provider-agnostic and safe to persist.",
|
||||
"signature": "<bound method Class.signature of Class('MailIntakeThread', 22, 81)>",
|
||||
"docstring": "Canonical internal representation of an email thread.\n\nNotes:\n **Guarantees:**\n\n - A thread groups multiple related messages under a single subject and participant set\n - It is designed to support reasoning over conversational context such as job applications, interviews, follow-ups, and ongoing discussions\n - This model is provider-agnostic and safe to persist",
|
||||
"members": {
|
||||
"thread_id": {
|
||||
"name": "thread_id",
|
||||
@@ -157,8 +157,8 @@
|
||||
"name": "add_message",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.models.thread.MailIntakeThread.add_message",
|
||||
"signature": "<bound method Function.signature of Function('add_message', 46, 64)>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nThis method:\n- Appends the message to the thread\n- Tracks unique participants\n- Updates the last activity timestamp\n\nArgs:\n message: Parsed mail message to add to the thread."
|
||||
"signature": "<bound method Function.signature of Function('add_message', 60, 81)>",
|
||||
"docstring": "Add a message to the thread and update derived fields.\n\nArgs:\n message (MailIntakeMessage):\n Parsed mail message to add to the thread.\n\nNotes:\n **Responsibilities:**\n\n - Appends the message to the thread\n - Tracks unique participants\n - Updates the last activity timestamp"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.parsers.body.MailIntakeParsingError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeParsingError', 'mail_intake.exceptions.MailIntakeParsingError')>",
|
||||
"docstring": "Errors encountered while parsing message content.\n\nRaised when raw provider payloads cannot be interpreted\nor normalized into internal domain models."
|
||||
"docstring": "Errors encountered while parsing message content.\n\nNotes:\n **Lifecycle:**\n\n - Raised when raw provider payloads cannot be interpreted or normalized into internal domain models"
|
||||
},
|
||||
"extract_body": {
|
||||
"name": "extract_body",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.parsers.headers",
|
||||
"content": {
|
||||
"path": "mail_intake.parsers.headers",
|
||||
"docstring": "Message header parsing utilities for Mail Intake.\n\nThis module provides helper functions for normalizing and extracting\nuseful information from provider-native message headers.\n\nThe functions here are intentionally simple and tolerant of malformed\nor incomplete header data.",
|
||||
"docstring": "Message header parsing utilities for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides helper functions for normalizing and extracting\nuseful information from provider-native message headers.\n\nThe functions here are intentionally simple and tolerant of malformed\nor incomplete header data.",
|
||||
"objects": {
|
||||
"Dict": {
|
||||
"name": "Dict",
|
||||
@@ -36,15 +36,15 @@
|
||||
"name": "parse_headers",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.headers.parse_headers",
|
||||
"signature": "<bound method Function.signature of Function('parse_headers', 14, 53)>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nProvider payloads (such as Gmail) typically represent headers as a list\nof name/value mappings. This function normalizes them into a\ncase-insensitive dictionary keyed by lowercase header names.\n\nArgs:\n raw_headers: List of header dictionaries, each containing\n ``name`` and ``value`` keys.\n\nReturns:\n Dictionary mapping lowercase header names to stripped values.\n\nExample:\n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
"signature": "<bound method Function.signature of Function('parse_headers', 18, 62)>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nArgs:\n raw_headers (List[Dict[str, str]]):\n List of header dictionaries, each containing ``name`` and ``value`` keys.\n\nReturns:\n Dict[str, str]:\n Dictionary mapping lowercase header names to stripped values.\n\nNotes:\n **Guarantees:**\n\n - Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings\n - This function normalizes them into a case-insensitive dictionary keyed by lowercase header names\n\nExample:\n Typical usage:\n \n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
},
|
||||
"extract_sender": {
|
||||
"name": "extract_sender",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.headers.extract_sender",
|
||||
"signature": "<bound method Function.signature of Function('extract_sender', 56, 87)>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nThis function parses the ``From`` header and attempts to extract:\n- Sender email address\n- Optional human-readable display name\n\nArgs:\n headers: Normalized header dictionary as returned by\n :func:`parse_headers`.\n\nReturns:\n A tuple ``(email, name)`` where:\n - ``email`` is the sender email address\n - ``name`` is the display name, or ``None`` if unavailable\n\nExamples:\n ``\"John Doe <john@example.com>\"`` → ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` → ``(\"john@example.com\", None)``"
|
||||
"signature": "<bound method Function.signature of Function('extract_sender', 65, 98)>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nArgs:\n headers (Dict[str, str]):\n Normalized header dictionary as returned by :func:`parse_headers`.\n\nReturns:\n Tuple[str, Optional[str]]:\n A tuple ``(email, name)`` where ``email`` is the sender email address and ``name`` is the display name, or ``None`` if unavailable.\n\nNotes:\n **Responsibilities:**\n\n - This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name\n\nExample:\n Typical values:\n\n ``\"John Doe <john@example.com>\"`` -> ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` -> ``(\"john@example.com\", None)``"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.parsers",
|
||||
"content": {
|
||||
"path": "mail_intake.parsers",
|
||||
"docstring": "Message parsing utilities for Mail Intake.\n\nThis package contains **provider-aware but adapter-agnostic parsing helpers**\nused to extract and normalize structured information from raw mail payloads.\n\nParsers in this package are responsible for:\n- Interpreting provider-native message structures\n- Extracting meaningful fields such as headers, body text, and subjects\n- Normalizing data into consistent internal representations\n\nThis package does not:\n- Perform network or IO operations\n- Contain provider API logic\n- Construct domain models directly\n\nParsing functions are designed to be composable and are orchestrated by the\ningestion layer.",
|
||||
"docstring": "Message parsing utilities for Mail Intake.\n\n---\n\n## Summary\n\nThis package contains **provider-aware but adapter-agnostic parsing helpers**\nused to extract and normalize structured information from raw mail payloads.\n\nParsers in this package are responsible for:\n- Interpreting provider-native message structures\n- Extracting meaningful fields such as headers, body text, and subjects\n- Normalizing data into consistent internal representations\n\nThis package does not:\n- Perform network or IO operations\n- Contain provider API logic\n- Construct domain models directly\n\nParsing functions are designed to be composable and are orchestrated by the\ningestion layer.\n\n---\n\n## Public API\n\n extract_body\n parse_headers\n extract_sender\n normalize_subject\n\n---",
|
||||
"objects": {
|
||||
"extract_body": {
|
||||
"name": "extract_body",
|
||||
@@ -16,21 +16,21 @@
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.parse_headers",
|
||||
"signature": "<bound method Alias.signature of Alias('parse_headers', 'mail_intake.parsers.headers.parse_headers')>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nProvider payloads (such as Gmail) typically represent headers as a list\nof name/value mappings. This function normalizes them into a\ncase-insensitive dictionary keyed by lowercase header names.\n\nArgs:\n raw_headers: List of header dictionaries, each containing\n ``name`` and ``value`` keys.\n\nReturns:\n Dictionary mapping lowercase header names to stripped values.\n\nExample:\n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nArgs:\n raw_headers (List[Dict[str, str]]):\n List of header dictionaries, each containing ``name`` and ``value`` keys.\n\nReturns:\n Dict[str, str]:\n Dictionary mapping lowercase header names to stripped values.\n\nNotes:\n **Guarantees:**\n\n - Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings\n - This function normalizes them into a case-insensitive dictionary keyed by lowercase header names\n\nExample:\n Typical usage:\n \n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
},
|
||||
"extract_sender": {
|
||||
"name": "extract_sender",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.extract_sender",
|
||||
"signature": "<bound method Alias.signature of Alias('extract_sender', 'mail_intake.parsers.headers.extract_sender')>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nThis function parses the ``From`` header and attempts to extract:\n- Sender email address\n- Optional human-readable display name\n\nArgs:\n headers: Normalized header dictionary as returned by\n :func:`parse_headers`.\n\nReturns:\n A tuple ``(email, name)`` where:\n - ``email`` is the sender email address\n - ``name`` is the display name, or ``None`` if unavailable\n\nExamples:\n ``\"John Doe <john@example.com>\"`` → ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` → ``(\"john@example.com\", None)``"
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nArgs:\n headers (Dict[str, str]):\n Normalized header dictionary as returned by :func:`parse_headers`.\n\nReturns:\n Tuple[str, Optional[str]]:\n A tuple ``(email, name)`` where ``email`` is the sender email address and ``name`` is the display name, or ``None`` if unavailable.\n\nNotes:\n **Responsibilities:**\n\n - This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name\n\nExample:\n Typical values:\n\n ``\"John Doe <john@example.com>\"`` -> ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` -> ``(\"john@example.com\", None)``"
|
||||
},
|
||||
"normalize_subject": {
|
||||
"name": "normalize_subject",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.normalize_subject",
|
||||
"signature": "<bound method Alias.signature of Alias('normalize_subject', 'mail_intake.parsers.subject.normalize_subject')>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nOperations:\n- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n- Repeats prefix stripping to handle stacked prefixes\n- Collapses excessive whitespace\n- Preserves original casing (no lowercasing)\n\nThis function is intentionally conservative and avoids aggressive\ntransformations that could alter the semantic meaning of the subject.\n\nArgs:\n subject: Raw subject line from a message header.\n\nReturns:\n Normalized subject string suitable for thread grouping."
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nArgs:\n subject (str):\n Raw subject line from a message header.\n\nReturns:\n str:\n Normalized subject string suitable for thread grouping.\n\nNotes:\n **Responsibilities:**\n\n - Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n - Repeats prefix stripping to handle stacked prefixes\n - Collapses excessive whitespace\n - Preserves original casing (no lowercasing)\n\n **Guarantees:**\n\n - This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject"
|
||||
},
|
||||
"body": {
|
||||
"name": "body",
|
||||
@@ -79,7 +79,7 @@
|
||||
"kind": "class",
|
||||
"path": "mail_intake.parsers.body.MailIntakeParsingError",
|
||||
"signature": "<bound method Alias.signature of Alias('MailIntakeParsingError', 'mail_intake.exceptions.MailIntakeParsingError')>",
|
||||
"docstring": "Errors encountered while parsing message content.\n\nRaised when raw provider payloads cannot be interpreted\nor normalized into internal domain models."
|
||||
"docstring": "Errors encountered while parsing message content.\n\nNotes:\n **Lifecycle:**\n\n - Raised when raw provider payloads cannot be interpreted or normalized into internal domain models"
|
||||
},
|
||||
"extract_body": {
|
||||
"name": "extract_body",
|
||||
@@ -95,7 +95,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.parsers.headers",
|
||||
"signature": null,
|
||||
"docstring": "Message header parsing utilities for Mail Intake.\n\nThis module provides helper functions for normalizing and extracting\nuseful information from provider-native message headers.\n\nThe functions here are intentionally simple and tolerant of malformed\nor incomplete header data.",
|
||||
"docstring": "Message header parsing utilities for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides helper functions for normalizing and extracting\nuseful information from provider-native message headers.\n\nThe functions here are intentionally simple and tolerant of malformed\nor incomplete header data.",
|
||||
"members": {
|
||||
"Dict": {
|
||||
"name": "Dict",
|
||||
@@ -129,15 +129,15 @@
|
||||
"name": "parse_headers",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.headers.parse_headers",
|
||||
"signature": "<bound method Function.signature of Function('parse_headers', 14, 53)>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nProvider payloads (such as Gmail) typically represent headers as a list\nof name/value mappings. This function normalizes them into a\ncase-insensitive dictionary keyed by lowercase header names.\n\nArgs:\n raw_headers: List of header dictionaries, each containing\n ``name`` and ``value`` keys.\n\nReturns:\n Dictionary mapping lowercase header names to stripped values.\n\nExample:\n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
"signature": "<bound method Function.signature of Function('parse_headers', 18, 62)>",
|
||||
"docstring": "Convert a list of Gmail-style headers into a normalized dict.\n\nArgs:\n raw_headers (List[Dict[str, str]]):\n List of header dictionaries, each containing ``name`` and ``value`` keys.\n\nReturns:\n Dict[str, str]:\n Dictionary mapping lowercase header names to stripped values.\n\nNotes:\n **Guarantees:**\n\n - Provider payloads (such as Gmail) typically represent headers as a list of name/value mappings\n - This function normalizes them into a case-insensitive dictionary keyed by lowercase header names\n\nExample:\n Typical usage:\n \n Input:\n [\n {\"name\": \"From\", \"value\": \"John Doe <john@example.com>\"},\n {\"name\": \"Subject\", \"value\": \"Re: Interview Update\"},\n ]\n\n Output:\n {\n \"from\": \"John Doe <john@example.com>\",\n \"subject\": \"Re: Interview Update\",\n }"
|
||||
},
|
||||
"extract_sender": {
|
||||
"name": "extract_sender",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.headers.extract_sender",
|
||||
"signature": "<bound method Function.signature of Function('extract_sender', 56, 87)>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nThis function parses the ``From`` header and attempts to extract:\n- Sender email address\n- Optional human-readable display name\n\nArgs:\n headers: Normalized header dictionary as returned by\n :func:`parse_headers`.\n\nReturns:\n A tuple ``(email, name)`` where:\n - ``email`` is the sender email address\n - ``name`` is the display name, or ``None`` if unavailable\n\nExamples:\n ``\"John Doe <john@example.com>\"`` → ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` → ``(\"john@example.com\", None)``"
|
||||
"signature": "<bound method Function.signature of Function('extract_sender', 65, 98)>",
|
||||
"docstring": "Extract sender email and optional display name from headers.\n\nArgs:\n headers (Dict[str, str]):\n Normalized header dictionary as returned by :func:`parse_headers`.\n\nReturns:\n Tuple[str, Optional[str]]:\n A tuple ``(email, name)`` where ``email`` is the sender email address and ``name`` is the display name, or ``None`` if unavailable.\n\nNotes:\n **Responsibilities:**\n\n - This function parses the ``From`` header and attempts to extract sender email address and optional human-readable display name\n\nExample:\n Typical values:\n\n ``\"John Doe <john@example.com>\"`` -> ``(\"john@example.com\", \"John Doe\")``\n ``\"john@example.com\"`` -> ``(\"john@example.com\", None)``"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -146,7 +146,7 @@
|
||||
"kind": "module",
|
||||
"path": "mail_intake.parsers.subject",
|
||||
"signature": null,
|
||||
"docstring": "Subject line normalization utilities for Mail Intake.\n\nThis module provides helper functions for normalizing email subject lines\nto enable reliable thread-level comparison and grouping.\n\nNormalization is intentionally conservative to avoid altering semantic\nmeaning while removing common reply and forward prefixes.",
|
||||
"docstring": "Subject line normalization utilities for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides helper functions for normalizing email subject lines\nto enable reliable thread-level comparison and grouping.\n\nNormalization is intentionally conservative to avoid altering semantic\nmeaning while removing common reply and forward prefixes.",
|
||||
"members": {
|
||||
"re": {
|
||||
"name": "re",
|
||||
@@ -159,8 +159,8 @@
|
||||
"name": "normalize_subject",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.subject.normalize_subject",
|
||||
"signature": "<bound method Function.signature of Function('normalize_subject', 18, 52)>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nOperations:\n- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n- Repeats prefix stripping to handle stacked prefixes\n- Collapses excessive whitespace\n- Preserves original casing (no lowercasing)\n\nThis function is intentionally conservative and avoids aggressive\ntransformations that could alter the semantic meaning of the subject.\n\nArgs:\n subject: Raw subject line from a message header.\n\nReturns:\n Normalized subject string suitable for thread grouping."
|
||||
"signature": "<bound method Function.signature of Function('normalize_subject', 24, 63)>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nArgs:\n subject (str):\n Raw subject line from a message header.\n\nReturns:\n str:\n Normalized subject string suitable for thread grouping.\n\nNotes:\n **Responsibilities:**\n\n - Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n - Repeats prefix stripping to handle stacked prefixes\n - Collapses excessive whitespace\n - Preserves original casing (no lowercasing)\n\n **Guarantees:**\n\n - This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"module": "mail_intake.parsers.subject",
|
||||
"content": {
|
||||
"path": "mail_intake.parsers.subject",
|
||||
"docstring": "Subject line normalization utilities for Mail Intake.\n\nThis module provides helper functions for normalizing email subject lines\nto enable reliable thread-level comparison and grouping.\n\nNormalization is intentionally conservative to avoid altering semantic\nmeaning while removing common reply and forward prefixes.",
|
||||
"docstring": "Subject line normalization utilities for Mail Intake.\n\n---\n\n## Summary\n\nThis module provides helper functions for normalizing email subject lines\nto enable reliable thread-level comparison and grouping.\n\nNormalization is intentionally conservative to avoid altering semantic\nmeaning while removing common reply and forward prefixes.",
|
||||
"objects": {
|
||||
"re": {
|
||||
"name": "re",
|
||||
@@ -15,8 +15,8 @@
|
||||
"name": "normalize_subject",
|
||||
"kind": "function",
|
||||
"path": "mail_intake.parsers.subject.normalize_subject",
|
||||
"signature": "<bound method Function.signature of Function('normalize_subject', 18, 52)>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nOperations:\n- Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n- Repeats prefix stripping to handle stacked prefixes\n- Collapses excessive whitespace\n- Preserves original casing (no lowercasing)\n\nThis function is intentionally conservative and avoids aggressive\ntransformations that could alter the semantic meaning of the subject.\n\nArgs:\n subject: Raw subject line from a message header.\n\nReturns:\n Normalized subject string suitable for thread grouping."
|
||||
"signature": "<bound method Function.signature of Function('normalize_subject', 24, 63)>",
|
||||
"docstring": "Normalize an email subject for thread-level comparison.\n\nArgs:\n subject (str):\n Raw subject line from a message header.\n\nReturns:\n str:\n Normalized subject string suitable for thread grouping.\n\nNotes:\n **Responsibilities:**\n\n - Strips common prefixes such as ``Re:``, ``Fwd:``, and ``FW:``\n - Repeats prefix stripping to handle stacked prefixes\n - Collapses excessive whitespace\n - Preserves original casing (no lowercasing)\n\n **Guarantees:**\n\n - This function is intentionally conservative and avoids aggressive transformations that could alter the semantic meaning of the subject"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
33
mkdocs.yml
33
mkdocs.yml
@@ -8,12 +8,19 @@ theme:
|
||||
text: Inter
|
||||
code: JetBrains Mono
|
||||
features:
|
||||
- navigation.tabs
|
||||
- navigation.sections
|
||||
- navigation.expand
|
||||
- navigation.top
|
||||
- navigation.instant
|
||||
- navigation.tracking
|
||||
- navigation.indexes
|
||||
- content.code.copy
|
||||
- content.code.annotate
|
||||
- content.tabs.link
|
||||
- content.action.edit
|
||||
- search.highlight
|
||||
- search.share
|
||||
- search.suggest
|
||||
plugins:
|
||||
- search
|
||||
- mkdocstrings:
|
||||
@@ -31,6 +38,30 @@ plugins:
|
||||
annotations_path: brief
|
||||
show_root_heading: true
|
||||
group_by_category: true
|
||||
show_category_heading: true
|
||||
show_object_full_path: false
|
||||
show_symbol_type_heading: true
|
||||
markdown_extensions:
|
||||
- pymdownx.superfences
|
||||
- pymdownx.inlinehilite
|
||||
- pymdownx.snippets
|
||||
- admonition
|
||||
- pymdownx.details
|
||||
- pymdownx.superfences
|
||||
- pymdownx.highlight:
|
||||
linenums: true
|
||||
anchor_linenums: true
|
||||
line_spans: __span
|
||||
pygments_lang_class: true
|
||||
- pymdownx.tabbed:
|
||||
alternate_style: true
|
||||
- pymdownx.tasklist:
|
||||
custom_checkbox: true
|
||||
- tables
|
||||
- footnotes
|
||||
- pymdownx.caret
|
||||
- pymdownx.tilde
|
||||
- pymdownx.mark
|
||||
site_name: mail_intake
|
||||
nav:
|
||||
- Home: index.md
|
||||
|
||||
Reference in New Issue
Block a user