87 lines
2.4 KiB
PHP
87 lines
2.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
*/
|
|
|
|
namespace KTXM\ProviderJmapc;
|
|
|
|
use KTXC\Resource\ProviderManager;
|
|
use KTXF\Module\ModuleBrowserInterface;
|
|
use KTXF\Module\ModuleInstanceAbstract;
|
|
use KTXF\Resource\Provider\ProviderInterface;
|
|
use KTXM\ProviderJmapc\Providers\Mail\Provider as MailProvider;
|
|
use KTXM\ProviderJmapc\Providers\Chrono\Provider as ChronoProvider;
|
|
use KTXM\ProviderJmapc\Providers\People\Provider as PeopleProvider;
|
|
|
|
/**
|
|
* JMAP Client Provider Module
|
|
*
|
|
* Provides mail, calendar, and contacts services via JMAP protocol.
|
|
*/
|
|
class Module extends ModuleInstanceAbstract implements ModuleBrowserInterface
|
|
{
|
|
public function __construct(
|
|
private readonly ProviderManager $providerManager,
|
|
) {}
|
|
|
|
public function handle(): string
|
|
{
|
|
return 'provider_jmapc';
|
|
}
|
|
|
|
public function label(): string
|
|
{
|
|
return 'JMAP Provider';
|
|
}
|
|
|
|
public function author(): string
|
|
{
|
|
return 'Ktrix';
|
|
}
|
|
|
|
public function description(): string
|
|
{
|
|
return 'JMAP provider module for Ktrix - provides mail, calendar, and contacts via JMAP protocol';
|
|
}
|
|
|
|
public function version(): string
|
|
{
|
|
return '0.0.1';
|
|
}
|
|
|
|
public function permissions(): array
|
|
{
|
|
return [
|
|
'provider_jmapc' => [
|
|
'label' => 'Access JMAP Provider',
|
|
'description' => 'View and access the JMAP provider module',
|
|
'group' => 'Providers'
|
|
],
|
|
];
|
|
}
|
|
|
|
public function boot(): void
|
|
{
|
|
// Register JMAP providers - all three share the same service store
|
|
$this->providerManager->register(ProviderInterface::TYPE_MAIL, 'jmap', MailProvider::class);
|
|
$this->providerManager->register(ProviderInterface::TYPE_CHRONO, 'jmap', ChronoProvider::class);
|
|
$this->providerManager->register(ProviderInterface::TYPE_PEOPLE, 'jmap', PeopleProvider::class);
|
|
}
|
|
|
|
public function registerBI(): array {
|
|
return [
|
|
'handle' => $this->handle(),
|
|
'namespace' => 'ProviderJmapc',
|
|
'version' => $this->version(),
|
|
'label' => $this->label(),
|
|
'author' => $this->author(),
|
|
'description' => $this->description(),
|
|
'boot' => 'static/module.mjs',
|
|
];
|
|
}
|
|
}
|