From 147b774e44e174575323ea8917205f3f1e8641f7 Mon Sep 17 00:00:00 2001 From: albnnc Date: Thu, 9 Jul 2026 09:35:22 +0300 Subject: [PATCH] w --- ews_client.ts | 4 +- models.ts | 102 ---------------------------------------- types/calendar_event.ts | 17 +++++++ types/email.ts | 32 +++++++++++++ types/folder.ts | 7 +++ types/free_slot.ts | 6 +++ types/login_config.ts | 6 +++ types/meeting_result.ts | 11 +++++ types/person.ts | 17 +++++++ 9 files changed, 99 insertions(+), 103 deletions(-) delete mode 100644 models.ts create mode 100644 types/calendar_event.ts create mode 100644 types/email.ts create mode 100644 types/folder.ts create mode 100644 types/free_slot.ts create mode 100644 types/login_config.ts create mode 100644 types/meeting_result.ts create mode 100644 types/person.ts diff --git a/ews_client.ts b/ews_client.ts index aff3de6..5440120 100644 --- a/ews_client.ts +++ b/ews_client.ts @@ -5,7 +5,9 @@ import { createRequire } from "node:module"; import path from "node:path"; import { fileURLToPath } from "node:url"; import { promisify } from "node:util"; -import type { Email, Folder, LoginConfig } from "./models.ts"; +import type { Email } from "./types/email.ts"; +import type { Folder } from "./types/folder.ts"; +import type { LoginConfig } from "./types/login_config.ts"; let inMemoryPassword: string | null = null; diff --git a/models.ts b/models.ts deleted file mode 100644 index 0646dc5..0000000 --- a/models.ts +++ /dev/null @@ -1,102 +0,0 @@ -export interface LoginConfig { - serverUrl: string; - email: string; - username: string; - domain?: string; -} - -export interface Email { - subject: string; - from: string; - fromName: string; - date: string; - isRead: boolean; - hasAttachments: boolean; - hasLinks: boolean; - itemId: string; - size: number; - isMeeting: boolean; - itemType: string; - to: string[]; - cc: string[]; - body: string; - bodyType: string; - attachments: Attachment[]; - preview: string; - location?: string; - start?: string; - end?: string; - requiredAttendees?: string[]; - optionalAttendees?: string[]; -} - -export interface Attachment { - name: string; - size: number; - contentType: string; - attachmentId: string; - isInline: boolean; -} - -export interface Folder { - name: string; - id: string; - totalCount: number; - unreadCount: number; - childFolderCount: number; -} - -export interface Person { - name: string; - email: string; - mailboxType: string; - firstName: string; - lastName: string; - jobTitle: string; - department: string; - company: string; - office: string; - alias: string; - manager: string; - managerEmail: string; - phones: Record; - address: string; - directReports: Array<{ name: string; email: string }>; -} - -export interface CalendarEvent { - subject: string; - start: string; - end: string; - location: string; - isAllDay: boolean; - isCancelled: boolean; - isMeeting: boolean; - isRecurring: boolean; - organizer: string; - organizerEmail: string; - myResponse: string; - itemId: string; - body: string; - requiredAttendees: string[]; - optionalAttendees: string[]; -} - -export interface FreeSlot { - date: string; - start: string; - end: string; - durationMinutes: number; -} - -export interface MeetingResult { - success: boolean; - subject: string; - date: string; - startTime: string; - endTime: string; - location: string; - requiredAttendees: string[]; - optionalAttendees: string[]; - error: string; -} diff --git a/types/calendar_event.ts b/types/calendar_event.ts new file mode 100644 index 0000000..cdae6f0 --- /dev/null +++ b/types/calendar_event.ts @@ -0,0 +1,17 @@ +export interface CalendarEvent { + subject: string; + start: string; + end: string; + location: string; + isAllDay: boolean; + isCancelled: boolean; + isMeeting: boolean; + isRecurring: boolean; + organizer: string; + organizerEmail: string; + myResponse: string; + itemId: string; + body: string; + requiredAttendees: string[]; + optionalAttendees: string[]; +} \ No newline at end of file diff --git a/types/email.ts b/types/email.ts new file mode 100644 index 0000000..c74e267 --- /dev/null +++ b/types/email.ts @@ -0,0 +1,32 @@ +export interface Email { + subject: string; + from: string; + fromName: string; + date: string; + isRead: boolean; + hasAttachments: boolean; + hasLinks: boolean; + itemId: string; + size: number; + isMeeting: boolean; + itemType: string; + to: string[]; + cc: string[]; + body: string; + bodyType: string; + attachments: Attachment[]; + preview: string; + location?: string; + start?: string; + end?: string; + requiredAttendees?: string[]; + optionalAttendees?: string[]; +} + +export interface Attachment { + name: string; + size: number; + contentType: string; + attachmentId: string; + isInline: boolean; +} \ No newline at end of file diff --git a/types/folder.ts b/types/folder.ts new file mode 100644 index 0000000..8338c68 --- /dev/null +++ b/types/folder.ts @@ -0,0 +1,7 @@ +export interface Folder { + name: string; + id: string; + totalCount: number; + unreadCount: number; + childFolderCount: number; +} \ No newline at end of file diff --git a/types/free_slot.ts b/types/free_slot.ts new file mode 100644 index 0000000..8493a0a --- /dev/null +++ b/types/free_slot.ts @@ -0,0 +1,6 @@ +export interface FreeSlot { + date: string; + start: string; + end: string; + durationMinutes: number; +} \ No newline at end of file diff --git a/types/login_config.ts b/types/login_config.ts new file mode 100644 index 0000000..d75aae1 --- /dev/null +++ b/types/login_config.ts @@ -0,0 +1,6 @@ +export interface LoginConfig { + serverUrl: string; + email: string; + username: string; + domain?: string; +} \ No newline at end of file diff --git a/types/meeting_result.ts b/types/meeting_result.ts new file mode 100644 index 0000000..f35d406 --- /dev/null +++ b/types/meeting_result.ts @@ -0,0 +1,11 @@ +export interface MeetingResult { + success: boolean; + subject: string; + date: string; + startTime: string; + endTime: string; + location: string; + requiredAttendees: string[]; + optionalAttendees: string[]; + error: string; +} \ No newline at end of file diff --git a/types/person.ts b/types/person.ts new file mode 100644 index 0000000..a117682 --- /dev/null +++ b/types/person.ts @@ -0,0 +1,17 @@ +export interface Person { + name: string; + email: string; + mailboxType: string; + firstName: string; + lastName: string; + jobTitle: string; + department: string; + company: string; + office: string; + alias: string; + manager: string; + managerEmail: string; + phones: Record; + address: string; + directReports: Array<{ name: string; email: string }>; +} \ No newline at end of file