refactor: docs
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ namespace KTXF\Mail\Service;
|
||||
|
||||
use Generator;
|
||||
use KTXF\Mail\Collection\CollectionBaseInterface;
|
||||
use KTXF\Mail\Entity\EntityBaseInterface;
|
||||
use KTXF\Mail\Object\AddressInterface;
|
||||
use KTXF\Resource\BinaryResource;
|
||||
use KTXF\Resource\Delta\Delta;
|
||||
@@ -22,10 +23,9 @@ use KTXF\Resource\Range\RangeType;
|
||||
use KTXF\Resource\Sort\ISort;
|
||||
|
||||
/**
|
||||
* Mail Service Base Interface
|
||||
* Service Base Interface
|
||||
*
|
||||
* Core interface for mail services with full protocol support (IMAP, JMAP, EWS, ActiveSync, Gmail API, etc.)
|
||||
* Provides identity, addressing, capability information, and collection/message operations.
|
||||
* Minimum interface for a service, providing read-only access to collections and entities.
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
public const CAPABILITY_ENTITY_SORT_DATE_SENT = 'sent';
|
||||
public const CAPABILITY_ENTITY_SORT_SIZE = 'size';
|
||||
|
||||
public const JSON_TYPE = 'mail.service';
|
||||
public const JSON_TYPE = 'mail:service';
|
||||
public const PROPERTY_PRIMARY_ADDRESS = 'primaryAddress';
|
||||
public const PROPERTY_SECONDARY_ADDRESSES = 'secondaryAddresses';
|
||||
|
||||
@@ -113,7 +113,7 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
* @param IFilter|null $filter Optional filter criteria
|
||||
* @param ISort|null $sort Optional sort order
|
||||
*
|
||||
* @return array<string|int,CollectionBaseInterface> Collections indexed by ID
|
||||
* @return array<string|int,CollectionBaseInterface> Collections indexed by identifier
|
||||
*/
|
||||
public function collectionList(string|int $location, ?IFilter $filter = null, ?ISort $sort = null): array;
|
||||
|
||||
@@ -140,9 +140,9 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int ...$identifiers Collection IDs to check
|
||||
* @param string|int ...$identifiers Collection identifiers to check
|
||||
*
|
||||
* @return array<string|int,bool> Map of ID => exists
|
||||
* @return array<string|int,bool> Map of identifier => exists
|
||||
*/
|
||||
public function collectionExtant(string|int $location, string|int ...$identifiers): array;
|
||||
|
||||
@@ -151,44 +151,44 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $identifier Collection ID
|
||||
* @param string|int $identifier Collection identifier
|
||||
*
|
||||
* @return CollectionBaseInterface|null Collection or null if not found
|
||||
*/
|
||||
public function collectionFetch(string|int $identifier): ?CollectionBaseInterface;
|
||||
|
||||
/**
|
||||
* Lists messages in a collection
|
||||
* Lists entities in a collection
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $collection Collection ID
|
||||
* @param string|int $collection Collection identifier
|
||||
* @param IFilter|null $filter Optional filter criteria
|
||||
* @param ISort|null $sort Optional sort order
|
||||
* @param IRange|null $range Optional pagination
|
||||
* @param array|null $properties Optional message properties to fetch
|
||||
* @param array|null $properties Optional entity properties to fetch
|
||||
*
|
||||
* @return array<string,EntityBaseInterface> Messages indexed by Urn
|
||||
* @return array<string,EntityBaseInterface> Entities indexed by Urn
|
||||
*/
|
||||
public function entityListBulk(string|int $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): array;
|
||||
|
||||
/**
|
||||
* Lists messages in a collection
|
||||
* Lists entities in a collection
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $collection Collection ID
|
||||
* @param string|int $collection Collection identifier
|
||||
* @param IFilter|null $filter Optional filter criteria
|
||||
* @param ISort|null $sort Optional sort order
|
||||
* @param IRange|null $range Optional pagination
|
||||
* @param array|null $properties Optional message properties to fetch
|
||||
* @param array|null $properties Optional entity properties to fetch
|
||||
*
|
||||
* @return Generator Yields messages one by one as EntityBaseInterface
|
||||
* @return Generator Yields entities one by one as EntityBaseInterface
|
||||
*/
|
||||
public function entityListStream(string|int $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): Generator;
|
||||
|
||||
/**
|
||||
* Creates a filter builder for messages
|
||||
* Creates a filter builder for entities
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
@@ -197,7 +197,7 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
public function entityListFilter(): IFilter;
|
||||
|
||||
/**
|
||||
* Creates a sort builder for messages
|
||||
* Creates a sort builder for entities
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
@@ -206,7 +206,7 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
public function entityListSort(): ISort;
|
||||
|
||||
/**
|
||||
* Creates a range builder for messages
|
||||
* Creates a range builder for entities
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
@@ -217,59 +217,57 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
public function entityListRange(RangeType $type): IRange;
|
||||
|
||||
/**
|
||||
* Gets incremental changes since last sync
|
||||
* Gets incremental changes since last signature
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $collection Collection ID
|
||||
* @param string $signature Sync token from previous sync
|
||||
* @param string $detail Detail level: 'ids', 'minimal', 'full'
|
||||
* @param string|int $collection Collection identifier
|
||||
* @param string $signature Token from previous delta
|
||||
*
|
||||
* @return array ['signature' => string, 'added' => array, 'modified' => array, 'removed' => array]
|
||||
*/
|
||||
public function entityDelta(string|int $collection, string $signature, string $detail = 'ids'): Delta;
|
||||
public function entityDelta(string|int $collection, string $signature): Delta;
|
||||
|
||||
/**
|
||||
* Checks if messages exist
|
||||
* Checks if entities exist
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $collection Collection ID
|
||||
* @param string|int ...$identifiers Message IDs to check
|
||||
* @param string|int $collection Collection identifier
|
||||
* @param string|int ...$identifiers Entity identifiers to check
|
||||
*
|
||||
* @return array<string|int,bool> Map of ID => exists
|
||||
* @return array<string|int,bool> Map of identifier => exists
|
||||
*/
|
||||
public function entityExtant(string|int $collection, string|int ...$identifiers): array;
|
||||
|
||||
/**
|
||||
* Fetches one or more entities
|
||||
* Fetches one or more entities as an array
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param EntityIdentifierInterface ...$identifiers Message identifiers to fetch
|
||||
* @param EntityIdentifierInterface ...$identifiers Entity identifiers to fetch
|
||||
*
|
||||
* @return array<string,EntityBaseInterface> Messages indexed by Urn
|
||||
* @return array<string,EntityBaseInterface> Entities indexed by Urn
|
||||
*/
|
||||
public function entityFetchBulk(EntityIdentifierInterface ...$identifiers): array;
|
||||
|
||||
/**
|
||||
* Fetches one or more entities
|
||||
* Fetches one or more entities as a stream
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param EntityIdentifierInterface ...$identifiers Message identifiers to fetch
|
||||
* @param EntityIdentifierInterface ...$identifiers Entity identifiers to fetch
|
||||
*
|
||||
* @return Generator<string,EntityBaseInterface> Yields messages one by one
|
||||
* @return Generator<string,EntityBaseInterface> Yields entities one by one
|
||||
*/
|
||||
public function entityFetchStream(EntityIdentifierInterface ...$identifiers): Generator;
|
||||
|
||||
|
||||
/**
|
||||
* Downloads a message or part of a message
|
||||
* Downloads an entity or part of an entity
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param EntityIdentifierInterface $target Message identifier
|
||||
* @param EntityIdentifierInterface $target Entity identifier
|
||||
* @param array|null $part Optional part to download
|
||||
*
|
||||
* @return BinaryResource
|
||||
|
||||
Reference in New Issue
Block a user