mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 01:00:50 -04:00
Merge pull request #51331 from nextcloud/backport/51082/stable31
[stable31] feat(dav): add webhook compatibility for calendar object events
This commit is contained in:
commit
4d75eeaffe
22 changed files with 331 additions and 27 deletions
|
|
@ -31,12 +31,6 @@ use OCA\DAV\Events\AddressBookUpdatedEvent;
|
|||
use OCA\DAV\Events\CalendarCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
||||
use OCA\DAV\Events\CalendarPublishedEvent;
|
||||
use OCA\DAV\Events\CalendarRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarShareUpdatedEvent;
|
||||
|
|
@ -76,6 +70,12 @@ use OCP\AppFramework\Bootstrap\IBootContext;
|
|||
use OCP\AppFramework\Bootstrap\IBootstrap;
|
||||
use OCP\AppFramework\Bootstrap\IRegistrationContext;
|
||||
use OCP\AppFramework\IAppContainer;
|
||||
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectDeletedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectRestoredEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
|
||||
use OCP\Calendar\IManager as ICalendarManager;
|
||||
use OCP\Config\BeforePreferenceDeletedEvent;
|
||||
use OCP\Config\BeforePreferenceSetEvent;
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ use OCA\DAV\Events\CachedCalendarObjectUpdatedEvent;
|
|||
use OCA\DAV\Events\CalendarCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent as LegacyCalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectDeletedEvent as LegacyCalendarObjectDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedEvent as LegacyCalendarObjectMovedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedToTrashEvent as LegacyCalendarObjectMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectRestoredEvent as LegacyCalendarObjectRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent as LegacyCalendarObjectUpdatedEvent;
|
||||
use OCA\DAV\Events\CalendarPublishedEvent;
|
||||
use OCA\DAV\Events\CalendarRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarShareUpdatedEvent;
|
||||
|
|
@ -34,6 +34,12 @@ use OCA\DAV\Events\SubscriptionCreatedEvent;
|
|||
use OCA\DAV\Events\SubscriptionDeletedEvent;
|
||||
use OCA\DAV\Events\SubscriptionUpdatedEvent;
|
||||
use OCP\AppFramework\Db\TTransactional;
|
||||
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectDeletedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectRestoredEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
|
||||
use OCP\Calendar\Exceptions\CalendarException;
|
||||
use OCP\DB\Exception;
|
||||
use OCP\DB\QueryBuilder\IQueryBuilder;
|
||||
|
|
@ -1318,6 +1324,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$shares = $this->getShares($calendarId);
|
||||
|
||||
$this->dispatcher->dispatchTyped(new CalendarObjectCreatedEvent($calendarId, $calendarRow, $shares, $objectRow));
|
||||
$this->dispatcher->dispatchTyped(new LegacyCalendarObjectCreatedEvent($calendarId, $calendarRow, $shares, $objectRow));
|
||||
} else {
|
||||
$subscriptionRow = $this->getSubscriptionById($calendarId);
|
||||
|
||||
|
|
@ -1378,6 +1385,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$shares = $this->getShares($calendarId);
|
||||
|
||||
$this->dispatcher->dispatchTyped(new CalendarObjectUpdatedEvent($calendarId, $calendarRow, $shares, $objectRow));
|
||||
$this->dispatcher->dispatchTyped(new LegacyCalendarObjectUpdatedEvent($calendarId, $calendarRow, $shares, $objectRow));
|
||||
} else {
|
||||
$subscriptionRow = $this->getSubscriptionById($calendarId);
|
||||
|
||||
|
|
@ -1439,6 +1447,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$targetShares = $this->getShares($targetCalendarId);
|
||||
$sourceCalendarRow = $this->getCalendarById($sourceCalendarId);
|
||||
$this->dispatcher->dispatchTyped(new CalendarObjectMovedEvent($sourceCalendarId, $sourceCalendarRow, $targetCalendarId, $targetCalendarRow, $sourceShares, $targetShares, $object));
|
||||
$this->dispatcher->dispatchTyped(new LegacyCalendarObjectMovedEvent($sourceCalendarId, $sourceCalendarRow, $targetCalendarId, $targetCalendarRow, $sourceShares, $targetShares, $object));
|
||||
}
|
||||
return true;
|
||||
}, $this->db);
|
||||
|
|
@ -1497,6 +1506,7 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$shares = $this->getShares($calendarId);
|
||||
|
||||
$this->dispatcher->dispatchTyped(new CalendarObjectDeletedEvent($calendarId, $calendarRow, $shares, $data));
|
||||
$this->dispatcher->dispatchTyped(new LegacyCalendarObjectDeletedEvent($calendarId, $calendarRow, $shares, $data));
|
||||
} else {
|
||||
$subscriptionRow = $this->getSubscriptionById($calendarId);
|
||||
|
||||
|
|
@ -1546,6 +1556,14 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$data
|
||||
)
|
||||
);
|
||||
$this->dispatcher->dispatchTyped(
|
||||
new LegacyCalendarObjectMovedToTrashEvent(
|
||||
$calendarId,
|
||||
$calendarData,
|
||||
$this->getShares($calendarId),
|
||||
$data
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1605,6 +1623,14 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$row
|
||||
)
|
||||
);
|
||||
$this->dispatcher->dispatchTyped(
|
||||
new LegacyCalendarObjectRestoredEvent(
|
||||
(int)$objectData['calendarid'],
|
||||
$calendarRow,
|
||||
$this->getShares((int)$row['calendarid']),
|
||||
$row
|
||||
)
|
||||
);
|
||||
}, $this->db);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use OCP\EventDispatcher\Event;
|
|||
*
|
||||
* @package OCA\DAV\Events
|
||||
* @since 20.0.0
|
||||
* @deprecated 31.0.2 Use {@see \OCP\Calendar\Events\CalendarObjectCreatedEvent} instead
|
||||
*/
|
||||
class CalendarObjectCreatedEvent extends Event {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use OCP\EventDispatcher\Event;
|
|||
*
|
||||
* @package OCA\DAV\Events
|
||||
* @since 20.0.0
|
||||
* @deprecated 31.0.2 Use {@see \OCP\Calendar\Events\CalendarObjectDeletedEvent} instead
|
||||
*/
|
||||
class CalendarObjectDeletedEvent extends Event {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use OCP\EventDispatcher\Event;
|
|||
*
|
||||
* @package OCA\DAV\Events
|
||||
* @since 25.0.0
|
||||
* @deprecated 31.0.2 Use {@see \OCP\Calendar\Events\CalendarObjectMovedEvent} instead
|
||||
*/
|
||||
class CalendarObjectMovedEvent extends Event {
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ use OCP\EventDispatcher\Event;
|
|||
|
||||
/**
|
||||
* @since 22.0.0
|
||||
* @deprecated 31.0.2 Use {@see \OCP\Calendar\Events\CalendarObjectMovedToTrashEvent} instead
|
||||
*/
|
||||
class CalendarObjectMovedToTrashEvent extends Event {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ use OCP\EventDispatcher\Event;
|
|||
|
||||
/**
|
||||
* @since 22.0.0
|
||||
* @deprecated 31.0.2 Use {@see \OCP\Calendar\Events\CalendarObjectRestoredEvent} instead
|
||||
*/
|
||||
class CalendarObjectRestoredEvent extends Event {
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use OCP\EventDispatcher\Event;
|
|||
*
|
||||
* @package OCA\DAV\Events
|
||||
* @since 20.0.0
|
||||
* @deprecated 31.0.2 Use {@see \OCP\Calendar\Events\CalendarObjectUpdatedEvent} instead
|
||||
*/
|
||||
class CalendarObjectUpdatedEvent extends Event {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ use OCA\DAV\DAV\Sharing\Plugin;
|
|||
use OCA\DAV\Events\CalendarCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
||||
use OCA\DAV\Events\CalendarRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarUpdatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectDeletedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectRestoredEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ declare(strict_types=1);
|
|||
namespace OCA\DAV\Listener;
|
||||
|
||||
use OCA\DAV\Connector\Sabre\Principal;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
||||
use OCA\DAV\Events\CalendarShareUpdatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
|
||||
use OCP\Contacts\Events\ContactInteractedWithEvent;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ use OCA\DAV\CalDAV\Reminder\Backend as ReminderBackend;
|
|||
use OCA\DAV\CalDAV\Reminder\ReminderService;
|
||||
use OCA\DAV\Events\CalendarDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCA\DAV\Events\CalendarObjectRestoredEvent;
|
||||
use OCA\DAV\Events\CalendarObjectUpdatedEvent;
|
||||
use OCA\DAV\Events\CalendarRestoredEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectDeletedEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectRestoredEvent;
|
||||
use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventListener;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@ use OCA\DAV\CalDAV\Activity\Backend as ActivityBackend;
|
|||
use OCA\DAV\CalDAV\Activity\Provider\Event;
|
||||
use OCA\DAV\DAV\Sharing\Plugin as SharingPlugin;
|
||||
use OCA\DAV\Events\CalendarDeletedEvent;
|
||||
use OCA\DAV\Events\CalendarObjectDeletedEvent;
|
||||
use OCA\DAV\Listener\ActivityUpdaterListener;
|
||||
use OCP\Calendar\Events\CalendarObjectDeletedEvent;
|
||||
use PHPUnit\Framework\MockObject\MockObject;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Test\TestCase;
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ declare(strict_types=1);
|
|||
namespace OCA\DAV\Tests\Unit\Listener;
|
||||
|
||||
use OCA\DAV\Connector\Sabre\Principal;
|
||||
use OCA\DAV\Events\CalendarObjectCreatedEvent;
|
||||
use OCA\DAV\Events\CalendarShareUpdatedEvent;
|
||||
use OCA\DAV\Listener\CalendarContactInteractionListener;
|
||||
use OCP\Calendar\Events\CalendarObjectCreatedEvent;
|
||||
use OCP\Contacts\Events\ContactInteractedWithEvent;
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IEventDispatcher;
|
||||
|
|
|
|||
|
|
@ -191,6 +191,13 @@ return array(
|
|||
'OCP\\Cache\\CappedMemoryCache' => $baseDir . '/lib/public/Cache/CappedMemoryCache.php',
|
||||
'OCP\\Calendar\\BackendTemporarilyUnavailableException' => $baseDir . '/lib/public/Calendar/BackendTemporarilyUnavailableException.php',
|
||||
'OCP\\Calendar\\CalendarEventStatus' => $baseDir . '/lib/public/Calendar/CalendarEventStatus.php',
|
||||
'OCP\\Calendar\\Events\\AbstractCalendarObjectEvent' => $baseDir . '/lib/public/Calendar/Events/AbstractCalendarObjectEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectCreatedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectDeletedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectMovedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectMovedEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectMovedToTrashEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectRestoredEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectUpdatedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php',
|
||||
'OCP\\Calendar\\Exceptions\\CalendarException' => $baseDir . '/lib/public/Calendar/Exceptions/CalendarException.php',
|
||||
'OCP\\Calendar\\IAvailabilityResult' => $baseDir . '/lib/public/Calendar/IAvailabilityResult.php',
|
||||
'OCP\\Calendar\\ICalendar' => $baseDir . '/lib/public/Calendar/ICalendar.php',
|
||||
|
|
|
|||
|
|
@ -240,6 +240,13 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
|
|||
'OCP\\Cache\\CappedMemoryCache' => __DIR__ . '/../../..' . '/lib/public/Cache/CappedMemoryCache.php',
|
||||
'OCP\\Calendar\\BackendTemporarilyUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Calendar/BackendTemporarilyUnavailableException.php',
|
||||
'OCP\\Calendar\\CalendarEventStatus' => __DIR__ . '/../../..' . '/lib/public/Calendar/CalendarEventStatus.php',
|
||||
'OCP\\Calendar\\Events\\AbstractCalendarObjectEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/AbstractCalendarObjectEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectMovedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectMovedEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectMovedToTrashEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectRestoredEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php',
|
||||
'OCP\\Calendar\\Events\\CalendarObjectUpdatedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php',
|
||||
'OCP\\Calendar\\Exceptions\\CalendarException' => __DIR__ . '/../../..' . '/lib/public/Calendar/Exceptions/CalendarException.php',
|
||||
'OCP\\Calendar\\IAvailabilityResult' => __DIR__ . '/../../..' . '/lib/public/Calendar/IAvailabilityResult.php',
|
||||
'OCP\\Calendar\\ICalendar' => __DIR__ . '/../../..' . '/lib/public/Calendar/ICalendar.php',
|
||||
|
|
|
|||
79
lib/public/Calendar/Events/AbstractCalendarObjectEvent.php
Normal file
79
lib/public/Calendar/Events/AbstractCalendarObjectEvent.php
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IWebhookCompatibleEvent;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
abstract class AbstractCalendarObjectEvent extends Event implements IWebhookCompatibleEvent {
|
||||
|
||||
/**
|
||||
* @param int $calendarId
|
||||
* @param array $calendarData
|
||||
* @param array $shares
|
||||
* @param array $objectData
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function __construct(
|
||||
private int $calendarId,
|
||||
private array $calendarData,
|
||||
private array $shares,
|
||||
private array $objectData,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getCalendarId(): int {
|
||||
return $this->calendarId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getCalendarData(): array {
|
||||
return $this->calendarData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getShares(): array {
|
||||
return $this->shares;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getObjectData(): array {
|
||||
return $this->objectData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getWebhookSerializable(): array {
|
||||
return [
|
||||
'calendarId' => $this->getCalendarId(),
|
||||
'calendarData' => $this->getCalendarData(),
|
||||
'shares' => $this->getShares(),
|
||||
'objectData' => $this->getObjectData(),
|
||||
];
|
||||
}
|
||||
}
|
||||
15
lib/public/Calendar/Events/CalendarObjectCreatedEvent.php
Normal file
15
lib/public/Calendar/Events/CalendarObjectCreatedEvent.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
class CalendarObjectCreatedEvent extends AbstractCalendarObjectEvent {
|
||||
}
|
||||
15
lib/public/Calendar/Events/CalendarObjectDeletedEvent.php
Normal file
15
lib/public/Calendar/Events/CalendarObjectDeletedEvent.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
class CalendarObjectDeletedEvent extends AbstractCalendarObjectEvent {
|
||||
}
|
||||
104
lib/public/Calendar/Events/CalendarObjectMovedEvent.php
Normal file
104
lib/public/Calendar/Events/CalendarObjectMovedEvent.php
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
use OCP\EventDispatcher\Event;
|
||||
use OCP\EventDispatcher\IWebhookCompatibleEvent;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
class CalendarObjectMovedEvent extends Event implements IWebhookCompatibleEvent {
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function __construct(
|
||||
private int $sourceCalendarId,
|
||||
private array $sourceCalendarData,
|
||||
private int $targetCalendarId,
|
||||
private array $targetCalendarData,
|
||||
private array $sourceShares,
|
||||
private array $targetShares,
|
||||
private array $objectData,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getSourceCalendarId(): int {
|
||||
return $this->sourceCalendarId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getSourceCalendarData(): array {
|
||||
return $this->sourceCalendarData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getTargetCalendarId(): int {
|
||||
return $this->targetCalendarId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getTargetCalendarData(): array {
|
||||
return $this->targetCalendarData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getSourceShares(): array {
|
||||
return $this->sourceShares;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getTargetShares(): array {
|
||||
return $this->targetShares;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getObjectData(): array {
|
||||
return $this->objectData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @since 32.0.0
|
||||
*/
|
||||
public function getWebhookSerializable(): array {
|
||||
return [
|
||||
'sourceCalendarId' => $this->getSourceCalendarId(),
|
||||
'sourceCalendarData' => $this->getSourceCalendarData(),
|
||||
'targetCalendarId' => $this->getTargetCalendarId(),
|
||||
'targetCalendarData' => $this->getTargetCalendarData(),
|
||||
'sourceShares' => $this->getSourceShares(),
|
||||
'targetShares' => $this->getTargetShares(),
|
||||
'objectData' => $this->getObjectData(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
class CalendarObjectMovedToTrashEvent extends AbstractCalendarObjectEvent {
|
||||
}
|
||||
15
lib/public/Calendar/Events/CalendarObjectRestoredEvent.php
Normal file
15
lib/public/Calendar/Events/CalendarObjectRestoredEvent.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
class CalendarObjectRestoredEvent extends AbstractCalendarObjectEvent {
|
||||
}
|
||||
15
lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php
Normal file
15
lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
namespace OCP\Calendar\Events;
|
||||
|
||||
/**
|
||||
* @since 32.0.0
|
||||
*/
|
||||
class CalendarObjectUpdatedEvent extends AbstractCalendarObjectEvent {
|
||||
}
|
||||
Loading…
Reference in a new issue