resource provider and service improvements
This commit is contained in:
@@ -26,8 +26,6 @@ namespace KTXF\Mail\Provider;
|
||||
*/
|
||||
interface ProviderServiceDiscoverInterface extends ProviderBaseInterface {
|
||||
|
||||
public const CAPABILITY_SERVICE_DISCOVER = 'ServiceDiscover';
|
||||
|
||||
/**
|
||||
* Discover service configuration
|
||||
*
|
||||
|
||||
@@ -27,6 +27,8 @@ use KTXF\Resource\Provider\ResourceProviderServiceMutateInterface;
|
||||
*/
|
||||
interface ProviderServiceMutateInterface extends ProviderBaseInterface, ResourceProviderServiceMutateInterface {
|
||||
|
||||
public const JSON_TYPE = ProviderBaseInterface::JSON_TYPE;
|
||||
|
||||
// Methods inherited from ResourceProviderServiceMutateInterface
|
||||
// Implementations should return/accept ServiceMutableInterface instances
|
||||
|
||||
|
||||
@@ -27,8 +27,6 @@ use KTXF\Mail\Service\ServiceBaseInterface;
|
||||
*/
|
||||
interface ProviderServiceTestInterface extends ProviderBaseInterface {
|
||||
|
||||
public const CAPABILITY_SERVICE_TEST = 'ServiceTest';
|
||||
|
||||
/**
|
||||
* Test a service connection
|
||||
*
|
||||
|
||||
@@ -34,31 +34,28 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
public const CAPABILITY_COLLECTION_LIST_SORT = 'CollectionListSort';
|
||||
public const CAPABILITY_COLLECTION_EXTANT = 'CollectionExtant';
|
||||
public const CAPABILITY_COLLECTION_FETCH = 'CollectionFetch';
|
||||
|
||||
// Message capabilities
|
||||
public const CAPABILITY_MESSAGE_LIST = 'MessageList';
|
||||
public const CAPABILITY_MESSAGE_LIST_FILTER = 'MessageListFilter';
|
||||
public const CAPABILITY_MESSAGE_LIST_SORT = 'MessageListSort';
|
||||
public const CAPABILITY_MESSAGE_LIST_RANGE = 'MessageListRange';
|
||||
public const CAPABILITY_MESSAGE_DELTA = 'MessageDelta';
|
||||
public const CAPABILITY_MESSAGE_EXTANT = 'MessageExtant';
|
||||
public const CAPABILITY_MESSAGE_FETCH = 'MessageFetch';
|
||||
|
||||
public const CAPABILITY_ENTITY_LIST = 'EntityList';
|
||||
public const CAPABILITY_ENTITY_LIST_FILTER = 'EntityListFilter';
|
||||
public const CAPABILITY_ENTITY_LIST_SORT = 'EntityListSort';
|
||||
public const CAPABILITY_ENTITY_LIST_RANGE = 'EntityListRange';
|
||||
public const CAPABILITY_ENTITY_DELTA = 'EntityDelta';
|
||||
public const CAPABILITY_ENTITY_EXTANT = 'EntityExtant';
|
||||
public const CAPABILITY_ENTITY_FETCH = 'EntityFetch';
|
||||
// Filter capabilities
|
||||
public const CAPABILITY_FILTER_ID = 'FilterId';
|
||||
public const CAPABILITY_FILTER_SUBJECT = 'FilterSubject';
|
||||
public const CAPABILITY_FILTER_FROM = 'FilterFrom';
|
||||
public const CAPABILITY_FILTER_TO = 'FilterTo';
|
||||
public const CAPABILITY_FILTER_DATE = 'FilterDate';
|
||||
public const CAPABILITY_FILTER_FLAG = 'FilterFlag';
|
||||
public const CAPABILITY_FILTER_SIZE = 'FilterSize';
|
||||
public const CAPABILITY_FILTER_BODY = 'FilterBody';
|
||||
|
||||
public const CAPABILITY_FILTER_ID = 'id';
|
||||
public const CAPABILITY_FILTER_SUBJECT = 'subject';
|
||||
public const CAPABILITY_FILTER_FROM = 'from';
|
||||
public const CAPABILITY_FILTER_TO = 'to';
|
||||
public const CAPABILITY_FILTER_DATE = 'date';
|
||||
public const CAPABILITY_FILTER_FLAG = 'flag';
|
||||
public const CAPABILITY_FILTER_SIZE = 'size';
|
||||
public const CAPABILITY_FILTER_BODY = 'body';
|
||||
// Sort capabilities
|
||||
public const CAPABILITY_SORT_DATE = 'SortDate';
|
||||
public const CAPABILITY_SORT_SUBJECT = 'SortSubject';
|
||||
public const CAPABILITY_SORT_FROM = 'SortFrom';
|
||||
public const CAPABILITY_SORT_SIZE = 'SortSize';
|
||||
public const CAPABILITY_SORT_DATE = 'date';
|
||||
public const CAPABILITY_SORT_SUBJECT = 'subject';
|
||||
public const CAPABILITY_SORT_FROM = 'from';
|
||||
public const CAPABILITY_SORT_SIZE = 'size';
|
||||
|
||||
public const JSON_TYPE = 'mail.service';
|
||||
public const JSON_PROPERTY_PRIMARY_ADDRESS = 'primaryAddress';
|
||||
|
||||
@@ -22,12 +22,12 @@ use KTXF\Mail\Entity\IMessageMutable;
|
||||
*/
|
||||
interface ServiceMessageMutableInterface extends ServiceBaseInterface {
|
||||
|
||||
public const CAPABILITY_MESSAGE_CREATE = 'MessageCreate';
|
||||
public const CAPABILITY_MESSAGE_MODIFY = 'MessageModify';
|
||||
public const CAPABILITY_MESSAGE_DESTROY = 'MessageDestroy';
|
||||
public const CAPABILITY_MESSAGE_COPY = 'MessageCopy';
|
||||
public const CAPABILITY_MESSAGE_MOVE = 'MessageMove';
|
||||
public const CAPABILITY_MESSAGE_FLAG = 'MessageFlag';
|
||||
public const CAPABILITY_ENTITY_CREATE = 'EntityCreate';
|
||||
public const CAPABILITY_ENTITY_MODIFY = 'EntityModify';
|
||||
public const CAPABILITY_ENTITY_DESTROY = 'EntityDestroy';
|
||||
public const CAPABILITY_ENTITY_COPY = 'EntityCopy';
|
||||
public const CAPABILITY_ENTITY_MOVE = 'EntityMove';
|
||||
public const CAPABILITY_ENTITY_FLAG = 'EntityFlag';
|
||||
|
||||
/**
|
||||
* Creates a fresh message instance for composition
|
||||
|
||||
@@ -11,9 +11,14 @@ use KTXF\Json\JsonSerializable;
|
||||
*/
|
||||
interface ResourceProviderBaseInterface extends ProviderInterface, JsonSerializable
|
||||
{
|
||||
public const CAPABILITY_SERVICE_LIST = 'ServiceList';
|
||||
public const CAPABILITY_SERVICE_LIST = 'ServiceList';
|
||||
public const CAPABILITY_SERVICE_FETCH = 'ServiceFetch';
|
||||
public const CAPABILITY_SERVICE_EXTANT = 'ServiceExtant';
|
||||
public const CAPABILITY_SERVICE_CREATE = 'ServiceCreate';
|
||||
public const CAPABILITY_SERVICE_MODIFY = 'ServiceModify';
|
||||
public const CAPABILITY_SERVICE_DESTROY = 'ServiceDestroy';
|
||||
public const CAPABILITY_SERVICE_DISCOVER = 'ServiceDiscover';
|
||||
public const CAPABILITY_SERVICE_TEST = 'ServiceTest';
|
||||
|
||||
public const JSON_TYPE = 'resource.provider';
|
||||
public const JSON_PROPERTY_TYPE = '@type';
|
||||
|
||||
@@ -13,37 +13,32 @@ use KTXF\Json\JsonDeserializable;
|
||||
|
||||
interface ResourceProviderServiceMutateInterface extends ResourceProviderBaseInterface, JsonDeserializable {
|
||||
|
||||
public const CAPABILITY_SERVICE_FRESH = 'ServiceFresh';
|
||||
public const CAPABILITY_SERVICE_CREATE = 'ServiceCreate';
|
||||
public const CAPABILITY_SERVICE_UPDATE = 'ServiceUpdate';
|
||||
public const CAPABILITY_SERVICE_DESTROY = 'ServiceDestroy';
|
||||
|
||||
/**
|
||||
* construct and new blank service instance
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
public function serviceFresh(string $tenantId, ?string $userId): ResourceServiceMutateInterface;
|
||||
public function serviceFresh(): ResourceServiceMutateInterface;
|
||||
|
||||
/**
|
||||
* create a service configuration for a specific user
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
public function serviceCreate(string $tenantId, ?string $userId, ResourceServiceMutateInterface $service): string;
|
||||
public function serviceCreate(string $tenantId, string $userId, ResourceServiceMutateInterface $service): string;
|
||||
|
||||
/**
|
||||
* modify a service configuration for a specific user
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
public function serviceModify(string $tenantId, ?string $userId, ResourceServiceMutateInterface $service): string;
|
||||
public function serviceModify(string $tenantId, string $userId, ResourceServiceMutateInterface $service): string;
|
||||
|
||||
/**
|
||||
* delete a service configuration for a specific user
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
public function serviceDestroy(string $tenantId, ?string $userId, ResourceServiceMutateInterface $service): bool;
|
||||
public function serviceDestroy(string $tenantId, string $userId, ResourceServiceMutateInterface $service): bool;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ interface ResourceServiceBaseInterface extends JsonSerializable {
|
||||
// JSON Constants
|
||||
public const JSON_TYPE = 'resource.service';
|
||||
public const JSON_PROPERTY_TYPE = '@type';
|
||||
public const JSON_PROPERTY_PROVIDER = 'provider';
|
||||
public const JSON_PROPERTY_ID = 'id';
|
||||
public const JSON_PROPERTY_LABEL = 'label';
|
||||
public const JSON_PROPERTY_ENABLED = 'enabled';
|
||||
|
||||
Reference in New Issue
Block a user