@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
|
@@ -2,17 +2,17 @@ import { Page } from "../types/shared.js";
|
|
|
2
2
|
import { Logger } from "../types/ports.js";
|
|
3
3
|
import { ContentType, Space } from "../types/schemas/content.js";
|
|
4
4
|
import { Entitlement, EntitlementsQuery, GrantEntitlementInput, SpaceMember } from "../types/schemas/entitlements.js";
|
|
5
|
-
import "../shared/ports.js";
|
|
6
5
|
import { Actor } from "../shared/actor.js";
|
|
7
|
-
import
|
|
6
|
+
import "../shared/ports.js";
|
|
8
7
|
import "../content/index.js";
|
|
9
8
|
import "./model.js";
|
|
10
|
-
import { EntitlementsRepository, EntitlementsService, EntitlementsUnitOfWork, GrantTarget, OpenableSpace } from "./ports.js";
|
|
9
|
+
import { ContentReader, EntitlementsRepository, EntitlementsService, EntitlementsUnitOfWork, GrantTarget, OpenableSpace, PermissionHolders, RevokeGrantInput } from "./ports.js";
|
|
11
10
|
//#region src/entitlements/service.d.ts
|
|
12
11
|
type EntitlementsServiceParams = {
|
|
13
12
|
/** Read-only access (list) — runs outside any transaction. */
|
|
14
13
|
repo: EntitlementsRepository;
|
|
15
|
-
content:
|
|
14
|
+
content: ContentReader;
|
|
15
|
+
permissions: PermissionHolders;
|
|
16
16
|
/** Atomic write scope: tx-bound repo + outbox appender. */
|
|
17
17
|
uow: EntitlementsUnitOfWork;
|
|
18
18
|
logger?: Logger;
|
|
@@ -20,52 +20,64 @@ type EntitlementsServiceParams = {
|
|
|
20
20
|
declare class EntitlementsServiceImpl implements EntitlementsService {
|
|
21
21
|
private readonly repo;
|
|
22
22
|
private readonly content;
|
|
23
|
+
private readonly permissions;
|
|
23
24
|
private readonly uow;
|
|
24
25
|
private readonly logger;
|
|
25
26
|
constructor(params: EntitlementsServiceParams);
|
|
26
|
-
list(
|
|
27
|
-
grant(
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
list(query: EntitlementsQuery, actor: Actor): Promise<Page<Entitlement>>;
|
|
28
|
+
grant(input: GrantEntitlementInput, actor: Actor): Promise<Entitlement>;
|
|
29
|
+
revoke(input: RevokeGrantInput, actor: Actor): Promise<Entitlement>;
|
|
30
|
+
private grantEvent;
|
|
31
|
+
private assertCanRegister;
|
|
32
|
+
private requireAttendeeManager;
|
|
33
|
+
private assertPlace;
|
|
34
|
+
private sourceOf;
|
|
35
|
+
private actorMetadata;
|
|
30
36
|
hasAccess(orgId: string, orgUserId: string, contentId: string): Promise<boolean>;
|
|
31
37
|
listAccessibleContent(orgId: string, orgUserId: string, type?: ContentType): Promise<string[]>;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
holdsAnyGrant(orgId: string, orgUserId: string): Promise<boolean>;
|
|
39
|
+
opensEverySpace(actor: Actor, communityId: string): Promise<boolean>;
|
|
40
|
+
isCommunityMember(communityId: string, actor: Actor): Promise<boolean>;
|
|
41
|
+
canOpenSpace(spaceId: string, actor: Actor): Promise<boolean>;
|
|
42
|
+
canOpen(space: OpenableSpace, actor: Actor): Promise<boolean>;
|
|
43
|
+
spaceStandings(communityId: string, actor: Actor): Promise<Record<string, SpaceMember['status']>>;
|
|
44
|
+
openSpacesFor(communityId: string, actor: Actor): Promise<Space[]>;
|
|
45
|
+
openSpaceIds(communityId: string, actor: Actor): Promise<string[]>;
|
|
38
46
|
communityMembersAmong(orgId: string, communityId: string, orgUserIds: string[]): Promise<string[]>;
|
|
39
47
|
spaceOpenersAmong(orgId: string, spaceId: string, orgUserIds: string[]): Promise<string[]>;
|
|
40
48
|
spaceOpeners(orgId: string, spaceId: string): Promise<string[]>;
|
|
41
49
|
communitiesOpenedBy(orgId: string, grant: GrantTarget): Promise<string[]>;
|
|
42
50
|
communityModeratorIds(orgId: string, communityId: string): Promise<string[]>;
|
|
43
51
|
communityIdsOpenedFor(orgId: string, orgUserId: string): Promise<string[]>;
|
|
44
|
-
openCommunityIds(
|
|
52
|
+
openCommunityIds(actor: Actor): Promise<string[]>;
|
|
45
53
|
communityMemberIds(orgId: string, communityId: string): Promise<string[]>;
|
|
46
|
-
|
|
54
|
+
grantedOrgUserIds(orgId: string, contentId: string): Promise<string[]>;
|
|
47
55
|
countActiveSpaceMembers(orgId: string, spaceId: string): Promise<number>;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
everySpaceOpeners(orgId: string, communityId: string): Promise<string[]>;
|
|
57
|
+
requestJoin(communityId: string, spaceId: string, actor: Actor): Promise<SpaceMember>;
|
|
58
|
+
invite(communityId: string, spaceId: string, orgUserId: string, actor: Actor): Promise<SpaceMember>;
|
|
59
|
+
addSpaceMember(communityId: string, spaceId: string, orgUserId: string, actor: Actor): Promise<SpaceMember>;
|
|
60
|
+
accept(communityId: string, spaceId: string, actor: Actor): Promise<SpaceMember>;
|
|
61
|
+
approve(communityId: string, spaceId: string, orgUserId: string, actor: Actor): Promise<SpaceMember>;
|
|
62
|
+
decline(communityId: string, spaceId: string, orgUserId: string, actor: Actor): Promise<SpaceMember>;
|
|
63
|
+
refuse(communityId: string, spaceId: string, actor: Actor): Promise<SpaceMember>;
|
|
64
|
+
leave(communityId: string, spaceId: string, actor: Actor): Promise<SpaceMember>;
|
|
65
|
+
remove(communityId: string, spaceId: string, orgUserId: string, actor: Actor): Promise<SpaceMember>;
|
|
66
|
+
listSpaceMembers(communityId: string, spaceId: string, query: {
|
|
58
67
|
page: number;
|
|
59
68
|
pageSize: number;
|
|
60
|
-
}): Promise<Page<SpaceMember>>;
|
|
69
|
+
}, actor: Actor): Promise<Page<SpaceMember>>;
|
|
61
70
|
expireDueGrants(now: Date): Promise<void>;
|
|
62
71
|
private expireDueIn;
|
|
72
|
+
private system;
|
|
73
|
+
private teamOf;
|
|
74
|
+
private standingOf;
|
|
63
75
|
private requireSpaceIn;
|
|
64
76
|
private requireVisibleSpaceIn;
|
|
65
77
|
private assertHasMembers;
|
|
66
78
|
private assertRule;
|
|
67
79
|
private assertHolder;
|
|
68
|
-
private
|
|
80
|
+
private assertMember;
|
|
69
81
|
private assertHolds;
|
|
70
82
|
private assertCanManage;
|
|
71
83
|
private accessOf;
|