fix: RFC 9553 compliance for contacts (birthday, addresses)

This commit is contained in:
Linus Rath
2026-03-19 13:33:53 +01:00
parent 2edf2fab89
commit 77514bd054
5 changed files with 178 additions and 36 deletions
+32 -1
View File
@@ -252,7 +252,20 @@ export interface ContactTitle {
organizationId?: string;
}
// RFC 9553 AddressComponent
export interface AddressComponent {
kind: 'room' | 'apartment' | 'floor' | 'building' | 'number' | 'name' | 'block' | 'subDistrict' | 'district' | 'locality' | 'region' | 'postcode' | 'country' | 'direction' | 'landmark' | 'postOfficeBox' | 'separator' | string;
value: string;
phonetic?: string;
}
export interface ContactAddress {
// RFC 9553 format
components?: AddressComponent[];
full?: string;
isOrdered?: boolean;
defaultSeparator?: string;
// Legacy flat fields (from vCard import)
street?: string;
locality?: string;
region?: string;
@@ -284,9 +297,27 @@ export interface ContactMedia {
mediaType?: string;
}
// RFC 9553 PartialDate
export interface PartialDate {
'@type'?: 'PartialDate';
year?: number;
month?: number;
day?: number;
calendarScale?: string;
}
// RFC 9553 Timestamp
export interface Timestamp {
'@type': 'Timestamp';
utc: string;
}
export type AnniversaryDate = string | PartialDate | Timestamp;
export interface ContactAnniversary {
'@type'?: 'Anniversary';
kind: 'birth' | 'death' | 'wedding' | 'other';
date: string;
date: AnniversaryDate;
place?: ContactAddress;
}