@social-mail/social-mail-client 1.2.85 → 1.2.87
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/dist/admin/AdminAppIndex.pack.js +388 -197
- package/dist/admin/AdminAppIndex.pack.js.map +1 -1
- package/dist/admin/AdminAppIndex.pack.min.js +42 -42
- package/dist/admin/AdminAppIndex.pack.min.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.js +118 -33
- package/dist/public/channel/ChannelView.pack.js.map +1 -1
- package/dist/public/channel/ChannelView.pack.min.js +2 -2
- package/dist/public/channel/ChannelView.pack.min.js.map +1 -1
- package/dist/services/email/EmailContentDownloader.d.ts +0 -2
- package/dist/services/email/EmailContentDownloader.d.ts.map +1 -1
- package/dist/services/email/EmailContentDownloader.js +2 -30
- package/dist/services/email/EmailContentDownloader.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/web/AppIndex.pack.js +388 -197
- package/dist/web/AppIndex.pack.js.map +1 -1
- package/dist/web/AppIndex.pack.min.js +42 -42
- package/dist/web/AppIndex.pack.min.js.map +1 -1
- package/dist/web/page/mails/ConversationPage.d.ts +1 -0
- package/dist/web/page/mails/ConversationPage.d.ts.map +1 -1
- package/dist/web/page/mails/ConversationPage.js +16 -3
- package/dist/web/page/mails/ConversationPage.js.map +1 -1
- package/dist/web/page/mails/engagements/EngagementDetails.d.ts +10 -0
- package/dist/web/page/mails/engagements/EngagementDetails.d.ts.map +1 -0
- package/dist/web/page/mails/engagements/EngagementDetails.js +82 -0
- package/dist/web/page/mails/engagements/EngagementDetails.js.map +1 -0
- package/dist/web/page/mails/mini-compose/Atttach.d.ts +4 -0
- package/dist/web/page/mails/mini-compose/Atttach.d.ts.map +1 -0
- package/dist/web/page/mails/mini-compose/Atttach.js +64 -0
- package/dist/web/page/mails/mini-compose/Atttach.js.map +1 -0
- package/dist/web/page/mails/mini-compose/Insert.d.ts.map +1 -1
- package/dist/web/page/mails/mini-compose/Insert.js +13 -13
- package/dist/web/page/mails/mini-compose/Insert.js.map +1 -1
- package/dist/web/page/mails/mini-compose/MiniComposeBox.d.ts.map +1 -1
- package/dist/web/page/mails/mini-compose/MiniComposeBox.js +7 -7
- package/dist/web/page/mails/mini-compose/MiniComposeBox.js.map +1 -1
- package/dist/web/page/mails/service/ConversationService.d.ts +1 -0
- package/dist/web/page/mails/service/ConversationService.d.ts.map +1 -1
- package/dist/web/page/mails/service/ConversationService.js +6 -2
- package/dist/web/page/mails/service/ConversationService.js.map +1 -1
- package/dist/web/page/mails/service/EngagementService.d.ts +18 -0
- package/dist/web/page/mails/service/EngagementService.d.ts.map +1 -0
- package/dist/web/page/mails/service/EngagementService.js +85 -0
- package/dist/web/page/mails/service/EngagementService.js.map +1 -0
- package/package.json +1 -1
- package/src/services/email/EmailContentDownloader.ts +0 -50
- package/src/web/page/mails/ConversationPage.tsx +15 -2
- package/src/web/page/mails/engagements/EngagementDetails.tsx +70 -0
- package/src/web/page/mails/mini-compose/Atttach.tsx +68 -0
- package/src/web/page/mails/mini-compose/Insert.tsx +13 -15
- package/src/web/page/mails/mini-compose/MiniComposeBox.tsx +6 -3
- package/src/web/page/mails/service/ConversationService.tsx +5 -0
- package/src/web/page/mails/service/EngagementService.tsx +69 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import DITransient from "@web-atoms/core/dist/di/DITransient";
|
|
2
|
+
import { Inject } from "@web-atoms/core/dist/di/Inject";
|
|
3
|
+
import EntityService from "../../../../services/EntityService";
|
|
4
|
+
import { Email, EmailEngagement, IEmail, MailboxContactEmail } from "../../../../model/model";
|
|
5
|
+
import { CacheTTL } from "../../../../common/cache/CacheTTL";
|
|
6
|
+
import DateTime from "@web-atoms/date-time/dist/DateTime";
|
|
7
|
+
import EmailContentDownloader from "../../../../services/email/EmailContentDownloader";
|
|
8
|
+
import DISingleton from "@web-atoms/core/dist/di/DISingleton";
|
|
9
|
+
|
|
10
|
+
const cacheSeconds = CacheTTL.seconds.oneMonth;
|
|
11
|
+
|
|
12
|
+
@DISingleton()
|
|
13
|
+
export default class EngagementService {
|
|
14
|
+
|
|
15
|
+
@Inject
|
|
16
|
+
entityService: EntityService;
|
|
17
|
+
|
|
18
|
+
@Inject
|
|
19
|
+
emailContentDownloder: EmailContentDownloader;
|
|
20
|
+
|
|
21
|
+
async downloadEngagements(email: IEmail) {
|
|
22
|
+
|
|
23
|
+
try {
|
|
24
|
+
const { emailID } = email;
|
|
25
|
+
|
|
26
|
+
let now = DateTime.now;
|
|
27
|
+
const minute = Math.floor(now.minute / 5);
|
|
28
|
+
now = now.addMinutes(-minute);
|
|
29
|
+
|
|
30
|
+
const cacheVersion = email.dateUpdated ? DateTime.from(email.dateUpdated).msSinceEpoch.toString(36) : "-";
|
|
31
|
+
|
|
32
|
+
email.engagements = await this.entityService.query(EmailEngagement)
|
|
33
|
+
.where({ emailID }, (p) => (x) => x.emailID === p.emailID)
|
|
34
|
+
.toArray({
|
|
35
|
+
cacheVersion,
|
|
36
|
+
cacheSeconds: 300
|
|
37
|
+
});
|
|
38
|
+
} catch (error) {
|
|
39
|
+
console.error(error);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async list({
|
|
44
|
+
start = 0,
|
|
45
|
+
size = 50,
|
|
46
|
+
engagement = "",
|
|
47
|
+
emailID = 0,
|
|
48
|
+
mailboxID = 0,
|
|
49
|
+
emailAddressID = 0,
|
|
50
|
+
dateUpdated = null
|
|
51
|
+
}) {
|
|
52
|
+
const q = this.entityService.query(Email)
|
|
53
|
+
.where({ mailboxID, emailAddressID, engagement, emailID}, (p) =>
|
|
54
|
+
(x) => x.engagement === p.engagement
|
|
55
|
+
&& x.parentID === p.emailID
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
const cacheVersion = dateUpdated ? DateTime.from(dateUpdated).msSinceEpoch.toString(36) : "-";
|
|
59
|
+
|
|
60
|
+
const list = await q.toPagedList(
|
|
61
|
+
{ start, size, cacheVersion , cacheSeconds }
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
await Promise.all(list.items.map((x) => this.emailContentDownloder.download(x)));
|
|
65
|
+
|
|
66
|
+
return list;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
}
|