/* * SPDX-FileCopyrightText: 2020 Stalwart Labs LLC * * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ export interface JmapRequest { using: string[]; methodCalls: JmapMethodCall[]; } export type JmapMethodCall = [string, Record, string]; export interface JmapResponse { methodResponses: JmapMethodResponse[]; sessionState?: string; } export type JmapMethodResponse = [string, Record, string]; export interface JmapGetResponse { accountId: string; state: string; list: Record[]; notFound: string[]; } export interface JmapQueryResponse { accountId: string; queryState: string; canCalculateChanges: boolean; position: number; ids: string[]; total?: number; limit?: number; } export interface JmapSetResponse { accountId: string; oldState: string; newState: string; created: Record> | null; notCreated: Record | null; updated: Record> | null; notUpdated: Record | null; destroyed: string[] | null; notDestroyed: Record | null; } export interface JmapSetError { type: string; description?: string; properties?: string[]; existingId?: string; objectId?: string; linkedObjects?: string[]; validationErrors?: ValidationError[]; } export interface ValidationError { type: 'Invalid' | 'Required' | 'MaxLength' | 'MinLength' | 'MaxValue' | 'MinValue'; property: string; value?: string; required?: number; }