diff --git a/lib/Providers/Service.php b/lib/Providers/Service.php index 94e2043..8ec2415 100644 --- a/lib/Providers/Service.php +++ b/lib/Providers/Service.php @@ -23,6 +23,8 @@ use KTXF\Resource\Provider\ResourceServiceLocationInterface; use KTXF\Resource\Delta\Delta; use KTXF\Resource\Filter\Filter; use KTXF\Resource\Filter\IFilter; +use KTXF\Resource\Identifier\CollectionIdentifier; +use KTXF\Resource\Identifier\EntityIdentifier; use KTXF\Resource\Range\IRange; use KTXF\Resource\Range\Range; use KTXF\Resource\Range\RangeTally; @@ -283,6 +285,7 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC } return false; + } // ── ServiceConfigurableInterface ────────────────────────────────────────── @@ -521,4 +524,50 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC $uids = array_map('intval', $identifiers); return $this->mailService->entityFetch((string) $collection, ...$uids); } + + public function entityDelete(EntityIdentifier ...$identifiers): array + { + // validate identifiers and group by collection + $collections = []; + foreach ($identifiers as $identifier) { + if ($identifier->provider() !== $this->provider() || $identifier->service() !== (string)$this->identifier()) { + throw new \InvalidArgumentException('Entity identifier does not belong to this service: ' . (string)$identifier); + } + $collections[$identifier->collection()][] = (int) $identifier->entity(); + } + + $this->initialize(); + + // delete entities per collection and build result map + $result = []; + foreach ($collections as $collection => $uids) { + $this->mailService->entityDestroy($collection, ...$uids); + foreach ($uids as $uid) { + $result[(string) $uid] = true; + } + } + + return $result; + } + + public function entityMove(CollectionIdentifier $target, EntityIdentifier ...$identifiers): array + { + // validate target belongs to this service + if ($target->provider() !== $this->provider() || $target->service() !== (string)$this->identifier()) { + throw new \InvalidArgumentException('Target collection does not belong to this service'); + } + + // validate identifiers and construct ID list + $ids = []; + foreach ($identifiers as $identifier) { + if ($identifier->provider() !== $this->provider() || $identifier->service() !== (string)$this->identifier()) { + throw new \InvalidArgumentException('Entity identifier does not belong to this service: ' . (string)$identifier); + } + $ids[] = $identifier->entity(); + } + + $this->initialize(); + + return $this->mailService->entityMove($target->collection(), ...$ids); + } } diff --git a/src/components/ImapAuthPanel.vue b/src/components/ImapAuthPanel.vue index f1a4c7a..1429ead 100644 --- a/src/components/ImapAuthPanel.vue +++ b/src/components/ImapAuthPanel.vue @@ -1,22 +1,22 @@ diff --git a/src/components/ImapConfigPanel.vue b/src/components/ImapProtocolPanel.vue similarity index 52% rename from src/components/ImapConfigPanel.vue rename to src/components/ImapProtocolPanel.vue index 7388844..8c0da5b 100644 --- a/src/components/ImapConfigPanel.vue +++ b/src/components/ImapProtocolPanel.vue @@ -1,66 +1,26 @@ - + IMAP Connection Settings Configure the server address, transport security, and certificate verification for your IMAP mailbox. @@ -232,14 +197,6 @@ watch(encryption, (next, previous) => { persistent-hint class="mb-4" /> - - @@ -256,7 +213,7 @@ watch(encryption, (next, previous) => {
Configure the server address, transport security, and certificate verification for your IMAP mailbox.