chore: bunch of improvements
All checks were successful
JS Unit Tests / test (pull_request) Successful in 33s
Build Test / test (pull_request) Successful in 36s
PHP Unit Tests / test (pull_request) Successful in 1m12s

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-04-23 22:00:50 -04:00
parent b617234b40
commit 3362afb7ec
28 changed files with 1717 additions and 1297 deletions

View File

@@ -4,16 +4,18 @@
import type {
ProviderInterface,
ProviderCapabilitiesInterface
ProviderCapabilitiesInterface,
ProviderModelInterface
} from "@/types/provider";
export class ProviderObject implements ProviderInterface {
export class ProviderObject implements ProviderModelInterface {
_data!: ProviderInterface;
constructor() {
this._data = {
'@type': 'mail:provider',
version: 1,
identifier: '',
label: '',
capabilities: {},
@@ -29,6 +31,12 @@ export class ProviderObject implements ProviderInterface {
return this._data;
}
clone(): ProviderObject {
const cloned = new ProviderObject();
cloned._data = { ...this._data };
return cloned;
}
capable(capability: keyof ProviderCapabilitiesInterface): boolean {
const value = this._data.capabilities?.[capability];
return value !== undefined && value !== false;
@@ -43,10 +51,6 @@ export class ProviderObject implements ProviderInterface {
/** Immutable Properties */
get '@type'(): string {
return this._data['@type'];
}
get identifier(): string {
return this._data.identifier;
}