Initial commit

This commit is contained in:
root
2026-01-04 22:05:37 -05:00
committed by Sebastian Krupinski
commit 4f979ced22
57 changed files with 11076 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
/**
* JMAP-specific ServiceObject implementation
* Extends base ServiceObject with JMAP-specific functionality
*/
import { ServiceObject } from '@KTXM/MailManager/models/service'
import type { JmapAuxiliary } from '../types/auxiliary'
/**
* JMAP Service Object
* Provides typed access to JMAP-specific auxiliary data
*/
export class JmapServiceObject extends ServiceObject {
/**
* Type-safe access to JMAP-specific auxiliary data
*/
get jmapAuxiliary(): JmapAuxiliary {
return (this._data.auxiliary ?? {}) as JmapAuxiliary
}
get hasCore(): boolean {
return this.jmapAuxiliary.capable?.core === true;
}
get hasMail(): boolean {
return this.jmapAuxiliary.capable?.mail === true;
}
get hasCalendar(): boolean {
return this.jmapAuxiliary.capable?.calendar === true;
}
get hasContacts(): boolean {
return this.jmapAuxiliary.capable?.contacts === true;
}
get hasDocuments(): boolean {
return this.jmapAuxiliary.capable?.documents === true;
}
/**
* Get JMAP session URL
*/
get sessionUrl(): string | undefined {
return this.jmapAuxiliary.sessionUrl
}
/**
* Get JMAP account ID
*/
get accountId(): string | undefined {
return this.jmapAuxiliary.accountId
}
}