api = $api;
$this->coreIntegration = $coreIntegration;
$this->wordPressIntegration = $wordPressIntegration;
$this->registry = $registry;
$this->stepHandler = $stepHandler;
$this->triggerHandler = $triggerHandler;
$this->wordPress = $wordPress;
$this->automationStorage = $automationStorage;
}
public function initialize(): void {
$this->registerApiRoutes();
$this->api->initialize();
$this->stepHandler->initialize();
$this->triggerHandler->initialize();
$this->coreIntegration->register($this->registry);
$this->wordPressIntegration->register($this->registry);
$this->wordPress->doAction(Hooks::INITIALIZE, [$this->registry]);
$this->registerActiveTriggerHooks();
}
private function registerApiRoutes(): void {
$this->wordPress->addAction(Hooks::API_INITIALIZE, function (API $api) {
$api->registerGetRoute('automations', AutomationsGetEndpoint::class);
$api->registerPutRoute('automations/(?P