@postalsys/ee-client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/index.cjs +871 -0
- package/index.d.ts +89 -0
- package/index.js +865 -0
- package/package.json +61 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export interface EmailAddress {
|
|
2
|
+
name?: string;
|
|
3
|
+
address: string;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface MessageFlags {
|
|
7
|
+
add?: string[];
|
|
8
|
+
delete?: string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface MessageText {
|
|
12
|
+
html?: string;
|
|
13
|
+
plain?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface MessageStatus {
|
|
17
|
+
messages: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface Folder {
|
|
21
|
+
name: string;
|
|
22
|
+
path: string;
|
|
23
|
+
parentPath?: string;
|
|
24
|
+
delimiter?: string;
|
|
25
|
+
specialUse?: string;
|
|
26
|
+
status?: MessageStatus;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface Message {
|
|
30
|
+
id: string;
|
|
31
|
+
subject?: string;
|
|
32
|
+
from?: EmailAddress;
|
|
33
|
+
to?: EmailAddress[];
|
|
34
|
+
cc?: EmailAddress[];
|
|
35
|
+
date: string;
|
|
36
|
+
unseen: boolean;
|
|
37
|
+
intro?: string;
|
|
38
|
+
text?: MessageText;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface MessageListResponse {
|
|
42
|
+
messages: Message[];
|
|
43
|
+
nextPageCursor?: string;
|
|
44
|
+
prevPageCursor?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface EmailEngineClientOptions {
|
|
48
|
+
apiUrl?: string;
|
|
49
|
+
account: string;
|
|
50
|
+
accessToken?: string;
|
|
51
|
+
container?: HTMLElement;
|
|
52
|
+
containerId?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export declare class EmailEngineClient {
|
|
56
|
+
apiUrl: string;
|
|
57
|
+
account: string;
|
|
58
|
+
accessToken?: string;
|
|
59
|
+
container?: HTMLElement;
|
|
60
|
+
currentFolder: string | null;
|
|
61
|
+
currentMessage: Message | null;
|
|
62
|
+
folders: Folder[];
|
|
63
|
+
messages: Message[];
|
|
64
|
+
nextPageCursor: string | null;
|
|
65
|
+
prevPageCursor: string | null;
|
|
66
|
+
|
|
67
|
+
constructor(options?: EmailEngineClientOptions);
|
|
68
|
+
|
|
69
|
+
apiRequest(method: string, endpoint: string, data?: any): Promise<any>;
|
|
70
|
+
loadFolders(): Promise<Folder[]>;
|
|
71
|
+
loadMessages(path: string, cursor?: string | null): Promise<MessageListResponse>;
|
|
72
|
+
loadMessage(messageId: string): Promise<Message>;
|
|
73
|
+
markAsRead(messageId: string, seen?: boolean): Promise<boolean>;
|
|
74
|
+
deleteMessage(messageId: string): Promise<boolean>;
|
|
75
|
+
moveMessage(messageId: string, targetPath: string): Promise<boolean>;
|
|
76
|
+
formatDate(dateStr: string): string;
|
|
77
|
+
createStyles(): void;
|
|
78
|
+
calculateFolderDepth(folder: Folder): number;
|
|
79
|
+
buildFolderTree(): Folder[];
|
|
80
|
+
renderFolderList(): void;
|
|
81
|
+
renderMessageList(): void;
|
|
82
|
+
renderMessage(): void;
|
|
83
|
+
createLayout(): void;
|
|
84
|
+
init(): void;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export declare function createEmailEngineClient(options: EmailEngineClientOptions | string | HTMLElement): EmailEngineClient;
|
|
88
|
+
|
|
89
|
+
export default EmailEngineClient;
|