@headless-lms/core 0.4.0 → 0.6.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/dist/assets/events.d.ts +15 -9
- package/dist/assets/file-urls.d.ts +14 -7
- package/dist/assets/file-urls.js +15 -4
- package/dist/assets/file-urls.js.map +1 -1
- package/dist/assets/index.d.ts +4 -4
- package/dist/assets/index.js +3 -3
- package/dist/assets/ports.d.ts +34 -15
- package/dist/assets/service.d.ts +30 -14
- package/dist/assets/service.js +233 -54
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.js +68 -3
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/community-derivations.js +16 -16
- package/dist/automations/community-derivations.js.map +1 -1
- package/dist/automations/community-mail.d.ts +34 -4
- package/dist/automations/community-mail.js +32 -4
- package/dist/automations/community-mail.js.map +1 -1
- package/dist/automations/event-permissions.d.ts +12 -0
- package/dist/automations/event-permissions.js +38 -0
- package/dist/automations/event-permissions.js.map +1 -0
- package/dist/automations/index.d.ts +2 -1
- package/dist/automations/index.js +2 -1
- package/dist/automations/notifications/applicable.d.ts +8 -0
- package/dist/automations/notifications/applicable.js +12 -0
- package/dist/automations/notifications/applicable.js.map +1 -0
- package/dist/automations/notifications/debounce.js +1 -1
- package/dist/automations/notifications/debounce.js.map +1 -1
- package/dist/automations/notifications/defaults.js +33 -3
- package/dist/automations/notifications/defaults.js.map +1 -1
- package/dist/automations/notifications/processor.js +1 -1
- package/dist/automations/notifications/processor.js.map +1 -1
- package/dist/automations/notifications/rules/content.js +60 -3
- package/dist/automations/notifications/rules/content.js.map +1 -1
- package/dist/automations/notifications/rules/discussion.js +29 -29
- package/dist/automations/notifications/rules/discussion.js.map +1 -1
- package/dist/automations/notifications/rules/entitlements.js +36 -9
- package/dist/automations/notifications/rules/entitlements.js.map +1 -1
- package/dist/automations/notifications/rules/events.d.ts +9 -0
- package/dist/automations/notifications/rules/events.js +27 -0
- package/dist/automations/notifications/rules/events.js.map +1 -0
- package/dist/automations/notifications/rules/organizations.js +17 -10
- package/dist/automations/notifications/rules/organizations.js.map +1 -1
- package/dist/automations/notifications/rules/recipients.js +0 -1
- package/dist/automations/notifications/rules/recipients.js.map +1 -1
- package/dist/automations/notifications/service.d.ts +8 -6
- package/dist/automations/notifications/service.js +12 -12
- package/dist/automations/notifications/service.js.map +1 -1
- package/dist/automations/notifications/types.js +94 -7
- package/dist/automations/notifications/types.js.map +1 -1
- package/dist/automations/ports.d.ts +30 -31
- package/dist/automations/service.d.ts +20 -17
- package/dist/automations/service.js +90 -61
- package/dist/automations/service.js.map +1 -1
- package/dist/content/event-sight.d.ts +11 -0
- package/dist/content/event-sight.js +11 -0
- package/dist/content/event-sight.js.map +1 -0
- package/dist/content/events.d.ts +465 -88
- package/dist/content/events.js +34 -1
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +6 -4
- package/dist/content/index.js +3 -1
- package/dist/content/jobs.d.ts +16 -0
- package/dist/content/jobs.js +37 -0
- package/dist/content/jobs.js.map +1 -0
- package/dist/content/model.d.ts +2 -2
- package/dist/content/notification-categories.d.ts +5 -4
- package/dist/content/notification-categories.js +15 -6
- package/dist/content/notification-categories.js.map +1 -1
- package/dist/content/ports.d.ts +113 -68
- package/dist/content/service.d.ts +103 -67
- package/dist/content/service.js +739 -152
- package/dist/content/service.js.map +1 -1
- package/dist/content/titles.d.ts +6 -3
- package/dist/content/titles.js +37 -24
- package/dist/content/titles.js.map +1 -1
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/authors.d.ts +4 -2
- package/dist/discussion/authors.js +9 -5
- package/dist/discussion/authors.js.map +1 -1
- package/dist/discussion/chats.d.ts +56 -37
- package/dist/discussion/chats.js +392 -160
- package/dist/discussion/chats.js.map +1 -1
- package/dist/discussion/events.d.ts +85 -47
- package/dist/discussion/events.js +41 -3
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/index.d.ts +8 -5
- package/dist/discussion/index.js +5 -3
- package/dist/discussion/live.d.ts +106 -0
- package/dist/discussion/live.js +642 -0
- package/dist/discussion/live.js.map +1 -0
- package/dist/discussion/mentions.js +2 -2
- package/dist/discussion/mentions.js.map +1 -1
- package/dist/discussion/ports.d.ts +182 -100
- package/dist/discussion/ports.js.map +1 -1
- package/dist/discussion/posts.d.ts +45 -39
- package/dist/discussion/posts.js +266 -152
- package/dist/discussion/posts.js.map +1 -1
- package/dist/discussion/rules.d.ts +18 -0
- package/dist/discussion/rules.js +22 -0
- package/dist/discussion/rules.js.map +1 -0
- package/dist/discussion/service.d.ts +37 -31
- package/dist/discussion/service.js +250 -186
- package/dist/discussion/service.js.map +1 -1
- package/dist/discussion/subscriptions.d.ts +8 -8
- package/dist/discussion/subscriptions.js +28 -12
- package/dist/discussion/subscriptions.js.map +1 -1
- package/dist/discussion/titles.d.ts +4 -2
- package/dist/discussion/titles.js +27 -13
- package/dist/discussion/titles.js.map +1 -1
- package/dist/entitlements/events.d.ts +58 -58
- package/dist/entitlements/index.d.ts +4 -4
- package/dist/entitlements/index.js +2 -2
- package/dist/entitlements/model.d.ts +2 -2
- package/dist/entitlements/ports.d.ts +65 -39
- package/dist/entitlements/rules.d.ts +3 -6
- package/dist/entitlements/rules.js +5 -10
- package/dist/entitlements/rules.js.map +1 -1
- package/dist/entitlements/service.d.ts +40 -28
- package/dist/entitlements/service.js +369 -162
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/devices.d.ts +3 -3
- package/dist/identity/devices.js +6 -4
- package/dist/identity/devices.js.map +1 -1
- package/dist/identity/index.d.ts +2 -2
- package/dist/identity/index.js +2 -2
- package/dist/identity/notification-settings.d.ts +1 -1
- package/dist/identity/notification-settings.js +2 -1
- package/dist/identity/notification-settings.js.map +1 -1
- package/dist/identity/ports.d.ts +7 -7
- package/dist/identity/service.d.ts +8 -7
- package/dist/identity/service.js +16 -12
- package/dist/identity/service.js.map +1 -1
- package/dist/integrations/events.d.ts +3 -3
- package/dist/integrations/ports.d.ts +9 -8
- package/dist/integrations/service.d.ts +9 -8
- package/dist/integrations/service.js +31 -14
- package/dist/integrations/service.js.map +1 -1
- package/dist/organizations/default-roles.d.ts +22 -0
- package/dist/organizations/default-roles.js +89 -0
- package/dist/organizations/default-roles.js.map +1 -0
- package/dist/organizations/effective-permissions.d.ts +47 -0
- package/dist/organizations/effective-permissions.js +118 -0
- package/dist/organizations/effective-permissions.js.map +1 -0
- package/dist/organizations/events.d.ts +326 -181
- package/dist/organizations/events.js +90 -18
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +14 -10
- package/dist/organizations/index.js +7 -3
- package/dist/organizations/members.d.ts +66 -8
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/model.d.ts +2 -2
- package/dist/organizations/notification-catalog.d.ts +31 -0
- package/dist/organizations/notification-catalog.js +32 -0
- package/dist/organizations/notification-catalog.js.map +1 -0
- package/dist/organizations/notification-categories.d.ts +6 -4
- package/dist/organizations/notification-categories.js +25 -10
- package/dist/organizations/notification-categories.js.map +1 -1
- package/dist/organizations/org-roles.d.ts +33 -0
- package/dist/organizations/org-roles.js +49 -0
- package/dist/organizations/org-roles.js.map +1 -0
- package/dist/organizations/permissions.d.ts +311 -0
- package/dist/organizations/permissions.js +327 -0
- package/dist/organizations/permissions.js.map +1 -0
- package/dist/organizations/ports.d.ts +187 -65
- package/dist/organizations/service.d.ts +102 -35
- package/dist/organizations/service.js +1254 -327
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/testing.d.ts +18 -0
- package/dist/organizations/testing.js +37 -0
- package/dist/organizations/testing.js.map +1 -0
- package/dist/organizations/types.d.ts +5 -16
- package/dist/progress/events.d.ts +14 -14
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/ports.d.ts +11 -3
- package/dist/progress/service.d.ts +6 -5
- package/dist/progress/service.js +21 -6
- package/dist/progress/service.js.map +1 -1
- package/dist/reporting/admin/index.d.ts +6 -4
- package/dist/reporting/admin/model.d.ts +36 -3
- package/dist/reporting/admin/ports.d.ts +39 -14
- package/dist/reporting/admin/service.d.ts +32 -11
- package/dist/reporting/admin/service.js +102 -18
- package/dist/reporting/admin/service.js.map +1 -1
- package/dist/reporting/events/index.d.ts +27 -0
- package/dist/reporting/events/index.js +20 -0
- package/dist/reporting/events/index.js.map +1 -0
- package/dist/reporting/member/calendar.d.ts +11 -0
- package/dist/reporting/member/calendar.js +75 -0
- package/dist/reporting/member/calendar.js.map +1 -0
- package/dist/reporting/member/index.d.ts +3 -2
- package/dist/reporting/member/model.d.ts +29 -5
- package/dist/reporting/member/ports.d.ts +49 -29
- package/dist/reporting/member/service.d.ts +57 -29
- package/dist/reporting/member/service.js +345 -114
- package/dist/reporting/member/service.js.map +1 -1
- package/dist/shared/actor.d.ts +23 -3
- package/dist/shared/errors.d.ts +2 -1
- package/dist/shared/errors.js +3 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/id.d.ts +4 -0
- package/dist/shared/id.js +4 -0
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/logger.d.ts +2 -1
- package/dist/shared/logger.js +10 -1
- package/dist/shared/logger.js.map +1 -1
- package/dist/shared/ports.d.ts +25 -5
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +4 -5
- package/dist/types/email-templates.d.ts +22 -3
- package/dist/types/entitlements.d.ts +2 -2
- package/dist/types/identity.d.ts +13 -16
- package/dist/types/index.d.ts +9 -9
- package/dist/types/index.js +2 -1
- package/dist/types/notifications.d.ts +4 -4
- package/dist/types/organizations.d.ts +3 -2
- package/dist/types/ports.d.ts +8 -1
- package/dist/types/ports.js +7 -1
- package/dist/types/ports.js.map +1 -0
- package/dist/types/schemas/assets.d.ts +5 -5
- package/dist/types/schemas/assets.js +4 -3
- package/dist/types/schemas/assets.js.map +1 -1
- package/dist/types/schemas/content.d.ts +599 -13
- package/dist/types/schemas/content.js +219 -8
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +280 -57
- package/dist/types/schemas/discussion.js +77 -3
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/entitlements.d.ts +21 -8
- package/dist/types/schemas/entitlements.js +11 -4
- package/dist/types/schemas/entitlements.js.map +1 -1
- package/dist/types/schemas/index.d.ts +5 -5
- package/dist/types/schemas/index.js +5 -5
- package/dist/types/schemas/notifications.d.ts +11 -10
- package/dist/types/schemas/notifications.js +3 -2
- package/dist/types/schemas/notifications.js.map +1 -1
- package/dist/types/schemas/organizations.d.ts +99 -60
- package/dist/types/schemas/organizations.js +80 -27
- package/dist/types/schemas/organizations.js.map +1 -1
- package/dist/types/schemas/progress.d.ts +3 -4
- package/dist/types/schemas/progress.js +0 -1
- package/dist/types/schemas/progress.js.map +1 -1
- package/package.json +1 -1
- package/dist/organizations/access-scopes.d.ts +0 -19
- package/dist/organizations/access-scopes.js +0 -89
- package/dist/organizations/access-scopes.js.map +0 -1
- package/dist/organizations/roles.d.ts +0 -19
- package/dist/organizations/roles.js +0 -82
- package/dist/organizations/roles.js.map +0 -1
package/dist/content/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Page } from "../types/shared.js";
|
|
2
|
-
import { AddDownloadAssetInput, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SetSpaceTopicsInput, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "../types/schemas/content.js";
|
|
2
|
+
import { AddDownloadAssetInput, AddEventAssetInput, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, ReorderEventAssetsInput, SetSpaceTopicsInput, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput } from "../types/schemas/content.js";
|
|
3
3
|
import "../types/index.js";
|
|
4
|
-
export type { AddDownloadAssetInput, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Page, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SetSpaceTopicsInput, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput };
|
|
4
|
+
export type { AddDownloadAssetInput, AddEventAssetInput, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateEventInput, CreateSpaceInput, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, ListEventsQuery, Page, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, ReorderEventAssetsInput, SetSpaceTopicsInput, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateEventInput, UpdateSpaceInput };
|
|
@@ -3,8 +3,10 @@ import { FileUrls } from "../assets/file-urls.js";
|
|
|
3
3
|
import "../assets/index.js";
|
|
4
4
|
import "./model.js";
|
|
5
5
|
import { AuthorRecord } from "./ports.js";
|
|
6
|
+
import { TeamBadge } from "./rules.js";
|
|
6
7
|
//#region src/discussion/authors.d.ts
|
|
7
|
-
declare function
|
|
8
|
+
declare function authorName(record: AuthorRecord): string | null;
|
|
9
|
+
declare function authorView(orgId: string, record: AuthorRecord, fileUrls: FileUrls, badge: TeamBadge): CommentAuthor;
|
|
8
10
|
//#endregion
|
|
9
|
-
export { authorView };
|
|
11
|
+
export { authorName, authorView };
|
|
10
12
|
//# sourceMappingURL=authors.d.ts.map
|
|
@@ -2,22 +2,26 @@
|
|
|
2
2
|
function imageOf(orgId, record) {
|
|
3
3
|
return record.imageAssetOrgId === orgId ? record.imageAssetId : null;
|
|
4
4
|
}
|
|
5
|
-
function
|
|
5
|
+
function authorName(record) {
|
|
6
6
|
const fullName = [record.firstName, record.lastName].filter(Boolean).join(" ");
|
|
7
|
+
return record.displayName?.trim() || fullName || null;
|
|
8
|
+
}
|
|
9
|
+
function authorView(orgId, record, fileUrls, badge) {
|
|
7
10
|
const imageAssetId = imageOf(orgId, record);
|
|
8
11
|
return {
|
|
9
12
|
id: record.id,
|
|
10
13
|
firstName: record.firstName,
|
|
11
14
|
lastName: record.lastName,
|
|
12
|
-
displayName: record
|
|
15
|
+
displayName: authorName(record),
|
|
13
16
|
headline: record.headline,
|
|
14
17
|
image: record.image,
|
|
15
18
|
imageAssetId,
|
|
16
|
-
imageUrl: imageAssetId
|
|
17
|
-
|
|
19
|
+
imageUrl: imageAssetId ? fileUrls.publicImage(orgId, record.id, imageAssetId) : null,
|
|
20
|
+
team: badge.team,
|
|
21
|
+
roleName: badge.roleName
|
|
18
22
|
};
|
|
19
23
|
}
|
|
20
24
|
//#endregion
|
|
21
|
-
export { authorView };
|
|
25
|
+
export { authorName, authorView };
|
|
22
26
|
|
|
23
27
|
//# sourceMappingURL=authors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authors.js","names":[],"sources":["../../src/discussion/authors.ts"],"sourcesContent":["import type { FileUrls } from '../assets/index.js';\nimport type { CommentAuthor } from './model.js';\nimport type { AuthorRecord } from './ports.js';\n\nfunction imageOf(orgId: string, record: AuthorRecord): string | null {\n return record.imageAssetOrgId === orgId ? record.imageAssetId : null;\n}\n\nexport function
|
|
1
|
+
{"version":3,"file":"authors.js","names":[],"sources":["../../src/discussion/authors.ts"],"sourcesContent":["import type { FileUrls } from '../assets/index.js';\nimport type { CommentAuthor } from './model.js';\nimport type { AuthorRecord } from './ports.js';\nimport type { TeamBadge } from './rules.js';\n\nfunction imageOf(orgId: string, record: AuthorRecord): string | null {\n return record.imageAssetOrgId === orgId ? record.imageAssetId : null;\n}\n\nexport function authorName(record: AuthorRecord): string | null {\n const fullName = [record.firstName, record.lastName].filter(Boolean).join(' ');\n return record.displayName?.trim() || fullName || null;\n}\n\nexport function authorView(\n orgId: string,\n record: AuthorRecord,\n fileUrls: FileUrls,\n badge: TeamBadge,\n): CommentAuthor {\n const imageAssetId = imageOf(orgId, record);\n return {\n id: record.id,\n firstName: record.firstName,\n lastName: record.lastName,\n displayName: authorName(record),\n headline: record.headline,\n image: record.image,\n imageAssetId,\n imageUrl: imageAssetId ? fileUrls.publicImage(orgId, record.id, imageAssetId) : null,\n team: badge.team,\n roleName: badge.roleName,\n };\n}\n"],"mappings":";AAKA,SAAS,QAAQ,OAAe,QAAqC;CACnE,OAAO,OAAO,oBAAoB,QAAQ,OAAO,eAAe;AAClE;AAEA,SAAgB,WAAW,QAAqC;CAC9D,MAAM,WAAW,CAAC,OAAO,WAAW,OAAO,QAAQ,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;CAC7E,OAAO,OAAO,aAAa,KAAK,KAAK,YAAY;AACnD;AAEA,SAAgB,WACd,OACA,QACA,UACA,OACe;CACf,MAAM,eAAe,QAAQ,OAAO,MAAM;CAC1C,OAAO;EACL,IAAI,OAAO;EACX,WAAW,OAAO;EAClB,UAAU,OAAO;EACjB,aAAa,WAAW,MAAM;EAC9B,UAAU,OAAO;EACjB,OAAO,OAAO;EACd;EACA,UAAU,eAAe,SAAS,YAAY,OAAO,OAAO,IAAI,YAAY,IAAI;EAChF,MAAM,MAAM;EACZ,UAAU,MAAM;CAClB;AACF"}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { Page } from "../types/shared.js";
|
|
2
2
|
import { Logger } from "../types/ports.js";
|
|
3
|
-
import { Chat, ChatUser, Message, MessageFlag, MessageFlagResolution, MessageView, ReactionEmoji } from "../types/schemas/discussion.js";
|
|
3
|
+
import { Chat, ChatLiveEvent, ChatUnreadSummary, ChatUser, LiveMessage, Message, MessageFlag, MessageFlagResolution, MessageView, ReactionCounts, ReactionEmoji } from "../types/schemas/discussion.js";
|
|
4
4
|
import "../types/index.js";
|
|
5
|
-
import "../shared/
|
|
5
|
+
import { Actor } from "../shared/actor.js";
|
|
6
|
+
import { PubSub } from "../shared/ports.js";
|
|
6
7
|
import { FileUrls } from "../assets/file-urls.js";
|
|
7
8
|
import { AssetFiles, MemberImageReader } from "../assets/ports.js";
|
|
8
9
|
import "../assets/index.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import "../content/index.js";
|
|
12
|
-
import { CommunityAccessReader } from "../entitlements/ports.js";
|
|
13
|
-
import "../entitlements/index.js";
|
|
14
|
-
import { AuthorProfileReader, AuthorRoleReader, ChatListItem, ChatRepository, ChatService, ChatUnitOfWork, ChatUnread, MentionsRepository, MessageQueue, MessageReactions, PageQuery, SendMessageInput, StartDirectInput, StartGroupInput, SubscriptionsRepository } from "./ports.js";
|
|
10
|
+
import { AuthorPermissionReader, AuthorProfileReader, ChatListItem, ChatListQuery, ChatLiveReads, ChatMemberStates, ChatRepository, ChatService, ChatUnitOfWork, ChatUnread, CommunityAccess, LiveChat, MentionsRepository, MessageQueue, MessageReactions, SendMessageInput, SpaceReader, StartDirectInput, StartGroupInput, SubscriptionsRepository } from "./ports.js";
|
|
11
|
+
import { ChatHub, ChatHubOptions } from "./live.js";
|
|
15
12
|
//#region src/discussion/chats.d.ts
|
|
16
13
|
type ChatServiceParams = {
|
|
17
14
|
repo: ChatRepository;
|
|
18
|
-
access:
|
|
19
|
-
content:
|
|
20
|
-
authors:
|
|
15
|
+
access: CommunityAccess;
|
|
16
|
+
content: Pick<SpaceReader, 'getDmSettings'>;
|
|
17
|
+
authors: AuthorPermissionReader;
|
|
21
18
|
profiles: AuthorProfileReader;
|
|
22
19
|
subscriptions: SubscriptionsRepository;
|
|
23
20
|
mentions: MentionsRepository;
|
|
24
21
|
images: MemberImageReader & Pick<AssetFiles, 'signFile'>;
|
|
25
22
|
fileUrls: FileUrls;
|
|
26
23
|
uow: ChatUnitOfWork;
|
|
24
|
+
pubsub?: PubSub;
|
|
25
|
+
live?: ChatHubOptions;
|
|
27
26
|
logger?: Logger;
|
|
28
27
|
};
|
|
29
|
-
declare class ChatServiceImpl implements ChatService {
|
|
28
|
+
declare class ChatServiceImpl implements ChatService, ChatLiveReads {
|
|
29
|
+
/** This process's live chat hub; null without a PubSub. */
|
|
30
|
+
readonly hub: ChatHub | null;
|
|
30
31
|
private readonly repo;
|
|
31
32
|
private readonly access;
|
|
32
33
|
private readonly content;
|
|
@@ -37,46 +38,63 @@ declare class ChatServiceImpl implements ChatService {
|
|
|
37
38
|
private readonly images;
|
|
38
39
|
private readonly fileUrls;
|
|
39
40
|
private readonly uow;
|
|
41
|
+
private readonly pubsub;
|
|
40
42
|
private readonly logger;
|
|
43
|
+
private readonly typed;
|
|
41
44
|
constructor(params: ChatServiceParams);
|
|
42
|
-
startDirect(
|
|
43
|
-
startGroup(
|
|
44
|
-
addParticipant(
|
|
45
|
-
leave(
|
|
46
|
-
accept(
|
|
47
|
-
send(
|
|
48
|
-
editMessage(
|
|
49
|
-
deleteMessage(
|
|
50
|
-
setReaction(
|
|
51
|
-
markRead(
|
|
52
|
-
block(
|
|
53
|
-
unblock(
|
|
54
|
-
flagMessage(
|
|
55
|
-
resolveMessageFlags(
|
|
56
|
-
lock(
|
|
57
|
-
unlock(
|
|
58
|
-
listChats(
|
|
59
|
-
|
|
45
|
+
startDirect(input: StartDirectInput, actor: Actor): Promise<Chat>;
|
|
46
|
+
startGroup(input: StartGroupInput, actor: Actor): Promise<Chat>;
|
|
47
|
+
addParticipant(chatId: string, orgUserId: string, actor: Actor): Promise<Chat>;
|
|
48
|
+
leave(chatId: string, actor: Actor): Promise<Chat>;
|
|
49
|
+
accept(chatId: string, actor: Actor): Promise<Chat>;
|
|
50
|
+
send(chatId: string, input: SendMessageInput, actor: Actor): Promise<MessageView>;
|
|
51
|
+
editMessage(messageId: string, body: string, actor: Actor): Promise<MessageView>;
|
|
52
|
+
deleteMessage(messageId: string, actor: Actor): Promise<MessageView>;
|
|
53
|
+
setReaction(messageId: string, emoji: ReactionEmoji | null, actor: Actor): Promise<MessageReactions>;
|
|
54
|
+
markRead(chatId: string, messageId: string, actor: Actor): Promise<void>;
|
|
55
|
+
block(communityId: string, orgUserId: string, actor: Actor): Promise<void>;
|
|
56
|
+
unblock(communityId: string, orgUserId: string, actor: Actor): Promise<void>;
|
|
57
|
+
flagMessage(messageId: string, reason: string, actor: Actor): Promise<MessageFlag>;
|
|
58
|
+
resolveMessageFlags(messageId: string, resolution: Extract<MessageFlagResolution, 'dismissed'>, communityId: string | null, actor: Actor): Promise<void>;
|
|
59
|
+
lock(chatId: string, communityId: string | null, actor: Actor): Promise<Chat>;
|
|
60
|
+
unlock(chatId: string, communityId: string | null, actor: Actor): Promise<Chat>;
|
|
61
|
+
listChats(communityId: string, query: ChatListQuery, actor: Actor): Promise<Page<ChatListItem>>;
|
|
62
|
+
chat(chatId: string, actor: Actor): Promise<ChatListItem>;
|
|
63
|
+
directChat(communityId: string, orgUserId: string, actor: Actor): Promise<ChatListItem>;
|
|
64
|
+
unreadSummary(communityId: string, actor: Actor): Promise<ChatUnreadSummary>;
|
|
65
|
+
typing(chatId: string, actor: Actor): Promise<void>;
|
|
66
|
+
watch(communityId: string, actor: Actor): Promise<AsyncIterable<ChatLiveEvent>>;
|
|
67
|
+
messageViews(orgId: string, messageIds: string[]): Promise<LiveMessage[]>;
|
|
68
|
+
activeParticipants(orgId: string, chatId: string): Promise<string[]>;
|
|
69
|
+
messageReactions(orgId: string, messageId: string): Promise<ReactionCounts>;
|
|
70
|
+
liveChat(orgId: string, chatId: string): Promise<LiveChat | null>;
|
|
71
|
+
memberStates(orgId: string, communityId: string, orgUserIds: string[]): Promise<ChatMemberStates[]>;
|
|
72
|
+
messages(chatId: string, query: {
|
|
60
73
|
page: number;
|
|
61
74
|
pageSize: number;
|
|
62
|
-
}): Promise<Page<MessageView>>;
|
|
63
|
-
attachmentFile(
|
|
64
|
-
messageQueue(
|
|
75
|
+
}, actor: Actor): Promise<Page<MessageView>>;
|
|
76
|
+
attachmentFile(chatId: string, messageId: string, assetId: string, actor: Actor): Promise<string>;
|
|
77
|
+
messageQueue(communityId: string, actor: Actor): Promise<MessageQueue>;
|
|
65
78
|
chatSummary(orgId: string, chatId: string): Promise<{
|
|
66
79
|
chat: Chat;
|
|
67
80
|
participants: ChatUser[];
|
|
68
81
|
} | null>;
|
|
69
|
-
titlesFor(
|
|
82
|
+
titlesFor(chatIds: string[], actor: Actor): Promise<Record<string, string>>;
|
|
70
83
|
unreadInChat(orgId: string, chatId: string, orgUserId: string): Promise<ChatUnread>;
|
|
71
84
|
findMessage(orgId: string, messageId: string): Promise<Message | null>;
|
|
72
85
|
latestMessageBody(orgId: string, chatId: string): Promise<string | null>;
|
|
73
86
|
isBlocked(orgId: string, communityId: string, a: string, b: string): Promise<boolean>;
|
|
74
87
|
private setLock;
|
|
88
|
+
private requireModerator;
|
|
75
89
|
private requireSettings;
|
|
76
90
|
private requireActor;
|
|
91
|
+
/** Whether the person is team in the community; throws when they are not a
|
|
92
|
+
* member of it. */
|
|
77
93
|
private requirePerson;
|
|
78
|
-
|
|
79
|
-
|
|
94
|
+
/** Each member of the community among the given people, with whether they
|
|
95
|
+
* are team there. People who are not members are left out. */
|
|
96
|
+
private membersTeam;
|
|
97
|
+
private teamsOf;
|
|
80
98
|
private assertMaySend;
|
|
81
99
|
private mentionable;
|
|
82
100
|
private writeMessage;
|
|
@@ -102,7 +120,8 @@ declare class ChatServiceImpl implements ChatService {
|
|
|
102
120
|
private sentEvent;
|
|
103
121
|
private viewOf;
|
|
104
122
|
private withSenders;
|
|
105
|
-
private
|
|
123
|
+
private listItems;
|
|
124
|
+
private participantsOf;
|
|
106
125
|
}
|
|
107
126
|
//#endregion
|
|
108
127
|
export { ChatServiceImpl, ChatServiceParams };
|