@headless-lms/core 0.3.0 → 0.4.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 +9 -9
- package/dist/assets/index.d.ts +3 -2
- package/dist/assets/index.js +2 -1
- package/dist/assets/jobs.d.ts +15 -0
- package/dist/assets/jobs.js +30 -0
- package/dist/assets/jobs.js.map +1 -0
- package/dist/assets/ports.d.ts +4 -3
- package/dist/assets/service.d.ts +0 -1
- package/dist/assets/service.js +0 -4
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.js +2 -63
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.d.ts +1 -2
- package/dist/automations/catalog.js +69 -62
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/community-derivations.js +4 -4
- package/dist/automations/community-derivations.js.map +1 -1
- package/dist/automations/community-mail.d.ts +3 -17
- package/dist/automations/community-mail.js +1 -21
- package/dist/automations/community-mail.js.map +1 -1
- package/dist/automations/events.d.ts +0 -10
- package/dist/automations/index.d.ts +11 -4
- package/dist/automations/index.js +8 -1
- package/dist/automations/notifications/debounce.d.ts +25 -0
- package/dist/automations/notifications/debounce.js +93 -0
- package/dist/automations/notifications/debounce.js.map +1 -0
- package/dist/automations/notifications/defaults.d.ts +8 -0
- package/dist/automations/notifications/defaults.js +316 -0
- package/dist/automations/notifications/defaults.js.map +1 -0
- package/dist/automations/notifications/delivery.d.ts +28 -0
- package/dist/automations/notifications/delivery.js +88 -0
- package/dist/automations/notifications/delivery.js.map +1 -0
- package/dist/automations/notifications/processor.d.ts +64 -0
- package/dist/automations/notifications/processor.js +270 -0
- package/dist/automations/notifications/processor.js.map +1 -0
- package/dist/automations/notifications/rules/content.d.ts +6 -0
- package/dist/automations/notifications/rules/content.js +39 -0
- package/dist/automations/notifications/rules/content.js.map +1 -0
- package/dist/automations/notifications/rules/discussion.d.ts +7 -0
- package/dist/automations/notifications/rules/discussion.js +678 -0
- package/dist/automations/notifications/rules/discussion.js.map +1 -0
- package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
- package/dist/automations/notifications/rules/entitlements.js +249 -0
- package/dist/automations/notifications/rules/entitlements.js.map +1 -0
- package/dist/automations/notifications/rules/index.d.ts +6 -0
- package/dist/automations/notifications/rules/index.js +15 -0
- package/dist/automations/notifications/rules/index.js.map +1 -0
- package/dist/automations/notifications/rules/organizations.d.ts +6 -0
- package/dist/automations/notifications/rules/organizations.js +28 -0
- package/dist/automations/notifications/rules/organizations.js.map +1 -0
- package/dist/automations/notifications/rules/recipients.d.ts +32 -0
- package/dist/automations/notifications/rules/recipients.js +99 -0
- package/dist/automations/notifications/rules/recipients.js.map +1 -0
- package/dist/automations/notifications/service.d.ts +27 -0
- package/dist/automations/notifications/service.js +45 -0
- package/dist/automations/notifications/service.js.map +1 -0
- package/dist/automations/notifications/types.d.ts +7 -0
- package/dist/automations/notifications/types.js +473 -0
- package/dist/automations/notifications/types.js.map +1 -0
- package/dist/automations/ports.d.ts +119 -5
- package/dist/automations/service.d.ts +10 -13
- package/dist/automations/service.js +21 -83
- package/dist/automations/service.js.map +1 -1
- package/dist/content/events.d.ts +130 -80
- package/dist/content/events.js +11 -0
- 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/model.d.ts +2 -2
- package/dist/content/notification-categories.d.ts +36 -0
- package/dist/content/notification-categories.js +64 -0
- package/dist/content/notification-categories.js.map +1 -0
- package/dist/content/ports.d.ts +25 -6
- package/dist/content/service.d.ts +4 -4
- package/dist/content/service.js +24 -8
- package/dist/content/service.js.map +1 -1
- package/dist/content/titles.d.ts +22 -0
- package/dist/content/titles.js +69 -0
- package/dist/content/titles.js.map +1 -0
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/chats.d.ts +9 -4
- package/dist/discussion/chats.js +80 -47
- package/dist/discussion/chats.js.map +1 -1
- package/dist/discussion/digests.d.ts +24 -0
- package/dist/discussion/digests.js +104 -0
- package/dist/discussion/digests.js.map +1 -0
- package/dist/discussion/events.d.ts +194 -28
- package/dist/discussion/events.js +74 -17
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/index.d.ts +7 -2
- package/dist/discussion/index.js +6 -1
- package/dist/discussion/jobs.d.ts +16 -0
- package/dist/discussion/jobs.js +40 -0
- package/dist/discussion/jobs.js.map +1 -0
- package/dist/discussion/mentions.d.ts +11 -0
- package/dist/discussion/mentions.js +35 -0
- package/dist/discussion/mentions.js.map +1 -0
- package/dist/discussion/ports.d.ts +107 -24
- package/dist/discussion/ports.js.map +1 -1
- package/dist/discussion/posts.d.ts +18 -8
- package/dist/discussion/posts.js +207 -155
- package/dist/discussion/posts.js.map +1 -1
- package/dist/discussion/service.d.ts +17 -8
- package/dist/discussion/service.js +105 -41
- package/dist/discussion/service.js.map +1 -1
- package/dist/discussion/subscriptions.d.ts +37 -0
- package/dist/discussion/subscriptions.js +99 -0
- package/dist/discussion/subscriptions.js.map +1 -0
- package/dist/discussion/titles.d.ts +26 -0
- package/dist/discussion/titles.js +84 -0
- package/dist/discussion/titles.js.map +1 -0
- package/dist/entitlements/events.d.ts +20 -20
- package/dist/entitlements/index.d.ts +2 -1
- package/dist/entitlements/index.js +2 -1
- package/dist/entitlements/jobs.d.ts +12 -0
- package/dist/entitlements/jobs.js +18 -0
- package/dist/entitlements/jobs.js.map +1 -0
- package/dist/entitlements/ports.d.ts +7 -3
- package/dist/entitlements/service.d.ts +5 -2
- package/dist/entitlements/service.js +23 -3
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/devices.d.ts +30 -0
- package/dist/identity/devices.js +107 -0
- package/dist/identity/devices.js.map +1 -0
- package/dist/identity/events.d.ts +2 -2
- package/dist/identity/index.d.ts +5 -4
- package/dist/identity/index.js +3 -2
- package/dist/identity/model.d.ts +2 -2
- package/dist/identity/notification-settings.d.ts +28 -0
- package/dist/identity/notification-settings.js +113 -0
- package/dist/identity/notification-settings.js.map +1 -0
- package/dist/identity/ports.d.ts +78 -54
- package/dist/integrations/events.d.ts +3 -3
- package/dist/organizations/events.d.ts +32 -32
- package/dist/organizations/index.d.ts +2 -1
- package/dist/organizations/index.js +2 -1
- package/dist/organizations/notification-categories.d.ts +32 -0
- package/dist/organizations/notification-categories.js +51 -0
- package/dist/organizations/notification-categories.js.map +1 -0
- package/dist/organizations/ports.d.ts +3 -0
- package/dist/organizations/service.d.ts +2 -0
- package/dist/organizations/service.js +7 -0
- package/dist/organizations/service.js.map +1 -1
- package/dist/progress/events.d.ts +14 -14
- package/dist/reporting/member/index.d.ts +2 -2
- package/dist/reporting/member/model.d.ts +56 -23
- package/dist/reporting/member/ports.d.ts +9 -6
- package/dist/reporting/member/service.d.ts +33 -14
- package/dist/reporting/member/service.js +138 -60
- package/dist/reporting/member/service.js.map +1 -1
- package/dist/shared/errors.d.ts +13 -1
- package/dist/shared/errors.js +18 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/id.d.ts +3 -0
- package/dist/shared/id.js +4 -1
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/mailer.d.ts +11 -1
- package/dist/shared/mailer.js +32 -5
- package/dist/shared/mailer.js.map +1 -1
- package/dist/shared/notification-categories.d.ts +16 -0
- package/dist/shared/notification-categories.js +94 -0
- package/dist/shared/notification-categories.js.map +1 -0
- package/dist/shared/notification-settings.d.ts +14 -0
- package/dist/shared/notification-settings.js +61 -0
- package/dist/shared/notification-settings.js.map +1 -0
- package/dist/shared/ports.d.ts +48 -2
- package/dist/shared/settings.d.ts +2 -1
- package/dist/shared/settings.js +1 -0
- package/dist/shared/settings.js.map +1 -1
- package/dist/types/automations.d.ts +8 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +2 -2
- package/dist/types/email-templates.d.ts +97 -3
- package/dist/types/identity.d.ts +2 -2
- package/dist/types/index.d.ts +7 -6
- package/dist/types/notifications.d.ts +157 -0
- package/dist/types/notifications.js +1 -0
- package/dist/types/schemas/automations.d.ts +1 -10
- package/dist/types/schemas/automations.js +1 -3
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +62 -1
- package/dist/types/schemas/content.js +25 -3
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +85 -12
- package/dist/types/schemas/discussion.js +47 -13
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/identity.d.ts +1 -85
- package/dist/types/schemas/identity.js +1 -42
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +6 -5
- package/dist/types/schemas/index.js +6 -5
- package/dist/types/schemas/notifications.d.ts +95 -0
- package/dist/types/schemas/notifications.js +56 -0
- package/dist/types/schemas/notifications.js.map +1 -0
- package/dist/types/schemas/progress.d.ts +3 -3
- package/package.json +1 -1
- package/dist/automations/community-notifications.d.ts +0 -16
- package/dist/automations/community-notifications.js +0 -84
- package/dist/automations/community-notifications.js.map +0 -1
- package/dist/automations/seeds.d.ts +0 -17
- package/dist/automations/seeds.js +0 -235
- package/dist/automations/seeds.js.map +0 -1
- package/dist/identity/notifications.d.ts +0 -27
- package/dist/identity/notifications.js +0 -101
- package/dist/identity/notifications.js.map +0 -1
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { boundedJsonSchema, domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema } from "./shared.js";
|
|
2
|
-
import { createUserInputSchema,
|
|
2
|
+
import { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userProfileSchema, userProfileViewSchema, userSchema } from "./identity.js";
|
|
3
3
|
import { acceptInviteInputSchema, addOrgUserInputSchema, createInviteInputSchema, createOrgUserInputSchema, inviteRoleSchema, inviteSchema, newOrganizationInputSchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, roleSchema, updateOrgUserInputSchema } from "./organizations.js";
|
|
4
|
-
import { activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatSchema, chatStatusSchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, flaggedCommentSchema, listCommentsQuerySchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema,
|
|
4
|
+
import { activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatSchema, chatStatusSchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, digestRunSchema, flaggedCommentSchema, listCommentsQuerySchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema } from "./discussion.js";
|
|
5
5
|
import { assetKindSchema, assetSchema, assetSourceSchema, assetStatusSchema, assetUrlsSchema, assetViewSchema, assetsQuerySchema, requestUploadInputSchema, uploadTicketSchema } from "./assets.js";
|
|
6
|
-
import { activityAssetSchema, activitySchema, activitySettingsSchema, activityViewSchema, addDownloadAssetInputSchema, addSpaceLinkInputSchema, bundleItemSchema, bundleSchema, communitySchema, communitySettingsDefaults, communitySettingsSchema, communityStatusSchema, communityViewSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, courseViewSchema, createBundleInputSchema, createCommunityInputSchema, createCourseInputSchema, createDownloadInputSchema, createSpaceInputSchema, dmSettingsDefaults, dmSettingsSchema, downloadAssetSchema, downloadFileSchema, downloadSchema, downloadStatusSchema, downloadViewSchema, listBundlesQuerySchema, listCommunitiesQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, patchDmSettingsInputSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, setSpaceTopicsInputSchema, spaceAccessRuleSchema, spaceDetailSchema, spaceLinkSchema, spaceSchema, spaceSettingsDefaults, spaceSettingsSchema, spaceTopicSchema, updateBundleInputSchema, updateCommunityInputSchema, updateCourseInputSchema, updateDownloadInputSchema, updateSpaceInputSchema } from "./content.js";
|
|
6
|
+
import { activityAssetSchema, activitySchema, activitySettingsSchema, activityViewSchema, addDownloadAssetInputSchema, addSpaceLinkInputSchema, bundleItemSchema, bundleSchema, communitySchema, communitySettingsDefaults, communitySettingsSchema, communityStatusSchema, communityViewSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, courseViewSchema, createBundleInputSchema, createCommunityInputSchema, createCourseInputSchema, createDownloadInputSchema, createSpaceInputSchema, digestCadenceSchema, digestScheduleSchema, dmSettingsDefaults, dmSettingsSchema, downloadAssetSchema, downloadFileSchema, downloadSchema, downloadStatusSchema, downloadViewSchema, listBundlesQuerySchema, listCommunitiesQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, patchCommunitySettingsInputSchema, patchDmSettingsInputSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, setSpaceTopicsInputSchema, spaceAccessRuleSchema, spaceDetailSchema, spaceLinkSchema, spaceSchema, spaceSettingsDefaults, spaceSettingsSchema, spaceTopicSchema, updateBundleInputSchema, updateCommunityInputSchema, updateCourseInputSchema, updateDownloadInputSchema, updateSpaceInputSchema } from "./content.js";
|
|
7
7
|
import { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema } from "./entitlements.js";
|
|
8
8
|
import { progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, reportProgressInputSchema } from "./progress.js";
|
|
9
9
|
import { configureInputSchema, connectInputSchema, connectionSchema, validationSchema } from "./integrations.js";
|
|
10
|
-
import { MAX_AUTOMATION_ACTIONS, MAX_AUTOMATION_TRIGGERS, MAX_WEBHOOK_EVENTS, automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema,
|
|
10
|
+
import { MAX_AUTOMATION_ACTIONS, MAX_AUTOMATION_TRIGGERS, MAX_WEBHOOK_EVENTS, automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, automationTriggersSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, createWebhookInputSchema, createdWebhookSchema, deliverWebhookInputSchema, updateAutomationInputSchema, updateWebhookInputSchema, webhookSchema, webhookSecretSchema, webhookUrlSchema } from "./automations.js";
|
|
11
11
|
import { credentialSchema } from "./credentials.js";
|
|
12
12
|
import { eventOutboxSchema } from "./outbox.js";
|
|
13
13
|
import { settingSchema } from "./settings.js";
|
|
14
|
-
|
|
14
|
+
import { notificationCategoryKeySchema, notificationCategoryListSchema, notificationCategorySchema, notificationChannelKeySchema, notificationScopeSchema, notificationTypeKeySchema, reasonSchema, subjectTypeSchema } from "./notifications.js";
|
|
15
|
+
export { MAX_AUTOMATION_ACTIONS, MAX_AUTOMATION_TRIGGERS, MAX_WEBHOOK_EVENTS, acceptInviteInputSchema, activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, activityViewSchema, addDownloadAssetInputSchema, addOrgUserInputSchema, addSpaceLinkInputSchema, assetKindSchema, assetSchema, assetSourceSchema, assetStatusSchema, assetUrlsSchema, assetViewSchema, assetsQuerySchema, automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, automationTriggersSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, blockedUserSchema, boundedJsonSchema, bundleItemSchema, bundleSchema, chatKindSchema, chatLastMessageSchema, chatSchema, chatStatusSchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, communitySchema, communitySettingsDefaults, communitySettingsSchema, communityStatusSchema, communityViewSchema, configureInputSchema, connectInputSchema, connectionSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, courseViewSchema, createAutomationInputSchema, createBundleInputSchema, createCommunityInputSchema, createCourseInputSchema, createDownloadInputSchema, createInviteInputSchema, createOrgUserInputSchema, createSpaceInputSchema, createUserInputSchema, createWebhookInputSchema, createdWebhookSchema, credentialSchema, deliverWebhookInputSchema, digestCadenceSchema, digestRunSchema, digestScheduleSchema, dmSettingsDefaults, dmSettingsSchema, domainEventSchema, downloadAssetSchema, downloadFileSchema, downloadSchema, downloadStatusSchema, downloadViewSchema, emailSchema, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, eventMetadataSchema, eventOutboxSchema, flaggedCommentSchema, grantEntitlementInputSchema, idSchema, inviteRoleSchema, inviteSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, listBundlesQuerySchema, listCommentsQuerySchema, listCommunitiesQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, moduleSchema, newOrganizationInputSchema, notificationCategoryKeySchema, notificationCategoryListSchema, notificationCategorySchema, notificationChannelKeySchema, notificationScopeSchema, notificationTypeKeySchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, patchCommunitySettingsInputSchema, patchDmSettingsInputSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, provisionUserInputSchema, reactionCountsSchema, reactionEmojiSchema, reasonSchema, reorderDownloadAssetsInputSchema, reportProgressInputSchema, requestUploadInputSchema, roleSchema, saveActivityInputSchema, serializableDateSchema, setSpaceTopicsInputSchema, settingSchema, spaceAccessRuleSchema, spaceDetailSchema, spaceLinkSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema, spaceSchema, spaceSettingsDefaults, spaceSettingsSchema, spaceTopicSchema, subjectTypeSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema, updateAutomationInputSchema, updateBundleInputSchema, updateCommunityInputSchema, updateCourseInputSchema, updateDownloadInputSchema, updateOrgUserInputSchema, updateSpaceInputSchema, updateUserInputSchema, updateWebhookInputSchema, uploadTicketSchema, userProfileSchema, userProfileViewSchema, userSchema, validationSchema, webhookSchema, webhookSecretSchema, webhookUrlSchema };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/types/schemas/notifications.d.ts
|
|
3
|
+
declare const reasonSchema: z.ZodEnum<{
|
|
4
|
+
moderator: "moderator";
|
|
5
|
+
subject: "subject";
|
|
6
|
+
post_author: "post_author";
|
|
7
|
+
comment_author: "comment_author";
|
|
8
|
+
message_author: "message_author";
|
|
9
|
+
follower: "follower";
|
|
10
|
+
thread_participant: "thread_participant";
|
|
11
|
+
mentioned: "mentioned";
|
|
12
|
+
participant: "participant";
|
|
13
|
+
space_member: "space_member";
|
|
14
|
+
community_member: "community_member";
|
|
15
|
+
course_member: "course_member";
|
|
16
|
+
staff: "staff";
|
|
17
|
+
}>;
|
|
18
|
+
declare const notificationScopeSchema: z.ZodEnum<{
|
|
19
|
+
org: "org";
|
|
20
|
+
community: "community";
|
|
21
|
+
space: "space";
|
|
22
|
+
chat: "chat";
|
|
23
|
+
}>;
|
|
24
|
+
declare const subjectTypeSchema: z.ZodEnum<{
|
|
25
|
+
activity: "activity";
|
|
26
|
+
course: "course";
|
|
27
|
+
message: "message";
|
|
28
|
+
download: "download";
|
|
29
|
+
community: "community";
|
|
30
|
+
post: "post";
|
|
31
|
+
comment: "comment";
|
|
32
|
+
space: "space";
|
|
33
|
+
chat: "chat";
|
|
34
|
+
bundle: "bundle";
|
|
35
|
+
}>;
|
|
36
|
+
declare const notificationCategoryKeySchema: z.ZodString;
|
|
37
|
+
declare const notificationTypeKeySchema: z.ZodString;
|
|
38
|
+
declare const notificationChannelKeySchema: z.ZodString;
|
|
39
|
+
declare const notificationCategorySchema: z.ZodObject<{
|
|
40
|
+
key: z.ZodString;
|
|
41
|
+
covers: z.ZodArray<z.ZodObject<{
|
|
42
|
+
type: z.ZodString;
|
|
43
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
44
|
+
moderator: "moderator";
|
|
45
|
+
subject: "subject";
|
|
46
|
+
post_author: "post_author";
|
|
47
|
+
comment_author: "comment_author";
|
|
48
|
+
message_author: "message_author";
|
|
49
|
+
follower: "follower";
|
|
50
|
+
thread_participant: "thread_participant";
|
|
51
|
+
mentioned: "mentioned";
|
|
52
|
+
participant: "participant";
|
|
53
|
+
space_member: "space_member";
|
|
54
|
+
community_member: "community_member";
|
|
55
|
+
course_member: "course_member";
|
|
56
|
+
staff: "staff";
|
|
57
|
+
}>>;
|
|
58
|
+
}, z.core.$strict>>;
|
|
59
|
+
channels: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
60
|
+
default: z.ZodBoolean;
|
|
61
|
+
locked: z.ZodBoolean;
|
|
62
|
+
}, z.core.$strict>>;
|
|
63
|
+
perSpace: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
+
spaceDefaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
declare const notificationCategoryListSchema: z.ZodArray<z.ZodObject<{
|
|
67
|
+
key: z.ZodString;
|
|
68
|
+
covers: z.ZodArray<z.ZodObject<{
|
|
69
|
+
type: z.ZodString;
|
|
70
|
+
reasons: z.ZodArray<z.ZodEnum<{
|
|
71
|
+
moderator: "moderator";
|
|
72
|
+
subject: "subject";
|
|
73
|
+
post_author: "post_author";
|
|
74
|
+
comment_author: "comment_author";
|
|
75
|
+
message_author: "message_author";
|
|
76
|
+
follower: "follower";
|
|
77
|
+
thread_participant: "thread_participant";
|
|
78
|
+
mentioned: "mentioned";
|
|
79
|
+
participant: "participant";
|
|
80
|
+
space_member: "space_member";
|
|
81
|
+
community_member: "community_member";
|
|
82
|
+
course_member: "course_member";
|
|
83
|
+
staff: "staff";
|
|
84
|
+
}>>;
|
|
85
|
+
}, z.core.$strict>>;
|
|
86
|
+
channels: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
87
|
+
default: z.ZodBoolean;
|
|
88
|
+
locked: z.ZodBoolean;
|
|
89
|
+
}, z.core.$strict>>;
|
|
90
|
+
perSpace: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
spaceDefaults: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodBoolean>>>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { notificationCategoryKeySchema, notificationCategoryListSchema, notificationCategorySchema, notificationChannelKeySchema, notificationScopeSchema, notificationTypeKeySchema, reasonSchema, subjectTypeSchema };
|
|
95
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
//#region src/types/schemas/notifications.ts
|
|
3
|
+
const reasonSchema = z.enum([
|
|
4
|
+
"subject",
|
|
5
|
+
"post_author",
|
|
6
|
+
"comment_author",
|
|
7
|
+
"message_author",
|
|
8
|
+
"follower",
|
|
9
|
+
"thread_participant",
|
|
10
|
+
"mentioned",
|
|
11
|
+
"participant",
|
|
12
|
+
"space_member",
|
|
13
|
+
"community_member",
|
|
14
|
+
"course_member",
|
|
15
|
+
"moderator",
|
|
16
|
+
"staff"
|
|
17
|
+
]);
|
|
18
|
+
const notificationScopeSchema = z.enum([
|
|
19
|
+
"org",
|
|
20
|
+
"community",
|
|
21
|
+
"space",
|
|
22
|
+
"chat"
|
|
23
|
+
]);
|
|
24
|
+
const subjectTypeSchema = z.enum([
|
|
25
|
+
"post",
|
|
26
|
+
"comment",
|
|
27
|
+
"chat",
|
|
28
|
+
"message",
|
|
29
|
+
"space",
|
|
30
|
+
"community",
|
|
31
|
+
"course",
|
|
32
|
+
"download",
|
|
33
|
+
"bundle",
|
|
34
|
+
"activity"
|
|
35
|
+
]);
|
|
36
|
+
const notificationCategoryKeySchema = z.string().regex(/^[a-z][a-z0-9_]{0,63}$/, "must be lower case letters, digits and underscores");
|
|
37
|
+
const notificationTypeKeySchema = z.string().regex(/^[a-z][a-z0-9_.]{0,63}$/, "must be a notification type key");
|
|
38
|
+
const notificationChannelKeySchema = z.string().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,63}$/, "must be a channel key");
|
|
39
|
+
const notificationCategorySchema = z.object({
|
|
40
|
+
key: notificationCategoryKeySchema,
|
|
41
|
+
covers: z.array(z.object({
|
|
42
|
+
type: notificationTypeKeySchema,
|
|
43
|
+
reasons: z.array(reasonSchema).min(1).max(13)
|
|
44
|
+
}).strict()).min(1).max(50),
|
|
45
|
+
channels: z.record(notificationChannelKeySchema, z.object({
|
|
46
|
+
default: z.boolean(),
|
|
47
|
+
locked: z.boolean()
|
|
48
|
+
}).strict()),
|
|
49
|
+
perSpace: z.boolean().optional(),
|
|
50
|
+
spaceDefaults: z.record(z.string().min(1).max(64), z.record(notificationChannelKeySchema, z.boolean())).optional()
|
|
51
|
+
}).strict();
|
|
52
|
+
const notificationCategoryListSchema = z.array(notificationCategorySchema).max(100);
|
|
53
|
+
//#endregion
|
|
54
|
+
export { notificationCategoryKeySchema, notificationCategoryListSchema, notificationCategorySchema, notificationChannelKeySchema, notificationScopeSchema, notificationTypeKeySchema, reasonSchema, subjectTypeSchema };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.js","names":[],"sources":["../../../src/types/schemas/notifications.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { NotificationCategory, Reason, SubjectRef } from '../notifications.js';\n\nexport const reasonSchema = z.enum([\n 'subject',\n 'post_author',\n 'comment_author',\n 'message_author',\n 'follower',\n 'thread_participant',\n 'mentioned',\n 'participant',\n 'space_member',\n 'community_member',\n 'course_member',\n 'moderator',\n 'staff',\n]) satisfies z.ZodType<Reason>;\n\nexport const notificationScopeSchema = z.enum(['org', 'community', 'space', 'chat']);\n\nexport const subjectTypeSchema = z.enum([\n 'post',\n 'comment',\n 'chat',\n 'message',\n 'space',\n 'community',\n 'course',\n 'download',\n 'bundle',\n 'activity',\n]) satisfies z.ZodType<SubjectRef['type']>;\n\nexport const notificationCategoryKeySchema = z\n .string()\n .regex(/^[a-z][a-z0-9_]{0,63}$/, 'must be lower case letters, digits and underscores');\n\nexport const notificationTypeKeySchema = z\n .string()\n .regex(/^[a-z][a-z0-9_.]{0,63}$/, 'must be a notification type key');\n\nexport const notificationChannelKeySchema = z\n .string()\n .regex(/^[a-zA-Z][a-zA-Z0-9_]{0,63}$/, 'must be a channel key');\n\nexport const notificationCategorySchema = z\n .object({\n key: notificationCategoryKeySchema,\n covers: z\n .array(\n z\n .object({\n type: notificationTypeKeySchema,\n reasons: z.array(reasonSchema).min(1).max(13),\n })\n .strict(),\n )\n .min(1)\n .max(50),\n channels: z.record(\n notificationChannelKeySchema,\n z.object({ default: z.boolean(), locked: z.boolean() }).strict(),\n ),\n perSpace: z.boolean().optional(),\n spaceDefaults: z\n .record(z.string().min(1).max(64), z.record(notificationChannelKeySchema, z.boolean()))\n .optional(),\n })\n .strict() satisfies z.ZodType<NotificationCategory>;\n\nexport const notificationCategoryListSchema = z.array(notificationCategorySchema).max(100);\n"],"mappings":";;AAGA,MAAa,eAAe,EAAE,KAAK;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,0BAA0B,EAAE,KAAK;CAAC;CAAO;CAAa;CAAS;AAAM,CAAC;AAEnF,MAAa,oBAAoB,EAAE,KAAK;CACtC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,gCAAgC,EAC1C,OAAO,CAAC,CACR,MAAM,0BAA0B,oDAAoD;AAEvF,MAAa,4BAA4B,EACtC,OAAO,CAAC,CACR,MAAM,2BAA2B,iCAAiC;AAErE,MAAa,+BAA+B,EACzC,OAAO,CAAC,CACR,MAAM,gCAAgC,uBAAuB;AAEhE,MAAa,6BAA6B,EACvC,OAAO;CACN,KAAK;CACL,QAAQ,EACL,MACC,EACG,OAAO;EACN,MAAM;EACN,SAAS,EAAE,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE;CAC9C,CAAC,CAAC,CACD,OAAO,CACZ,CAAC,CACA,IAAI,CAAC,CAAC,CACN,IAAI,EAAE;CACT,UAAU,EAAE,OACV,8BACA,EAAE,OAAO;EAAE,SAAS,EAAE,QAAQ;EAAG,QAAQ,EAAE,QAAQ;CAAE,CAAC,CAAC,CAAC,OAAO,CACjE;CACA,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,eAAe,EACZ,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,8BAA8B,EAAE,QAAQ,CAAC,CAAC,CAAC,CACtF,SAAS;AACd,CAAC,CAAC,CACD,OAAO;AAEV,MAAa,iCAAiC,EAAE,MAAM,0BAA0B,CAAC,CAAC,IAAI,GAAG"}
|
|
@@ -2,9 +2,9 @@ import { JsonValue } from "../shared.js";
|
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/types/schemas/progress.d.ts
|
|
4
4
|
declare const progressTargetTypeSchema: z.ZodEnum<{
|
|
5
|
-
course: "course";
|
|
6
5
|
activity: "activity";
|
|
7
6
|
module: "module";
|
|
7
|
+
course: "course";
|
|
8
8
|
}>;
|
|
9
9
|
type ProgressTargetType = z.infer<typeof progressTargetTypeSchema>;
|
|
10
10
|
declare const progressRecordSchema: z.ZodObject<{
|
|
@@ -12,9 +12,9 @@ declare const progressRecordSchema: z.ZodObject<{
|
|
|
12
12
|
orgId: z.ZodString;
|
|
13
13
|
orgUserId: z.ZodString;
|
|
14
14
|
targetType: z.ZodEnum<{
|
|
15
|
-
course: "course";
|
|
16
15
|
activity: "activity";
|
|
17
16
|
module: "module";
|
|
17
|
+
course: "course";
|
|
18
18
|
}>;
|
|
19
19
|
targetId: z.ZodString;
|
|
20
20
|
startedAt: z.ZodCoercedDate<unknown>;
|
|
@@ -28,9 +28,9 @@ type ProgressRecordInput = z.input<typeof progressRecordSchema>;
|
|
|
28
28
|
declare const progressTargetSchema: z.ZodObject<{
|
|
29
29
|
orgUserId: z.ZodString;
|
|
30
30
|
targetType: z.ZodEnum<{
|
|
31
|
-
course: "course";
|
|
32
31
|
activity: "activity";
|
|
33
32
|
module: "module";
|
|
33
|
+
course: "course";
|
|
34
34
|
}>;
|
|
35
35
|
targetId: z.ZodString;
|
|
36
36
|
}, z.core.$strict>;
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { DomainEvent } from "../types/shared.js";
|
|
2
|
-
import { NotificationKind } from "../types/schemas/identity.js";
|
|
3
|
-
import "../types/index.js";
|
|
4
|
-
import "../shared/ports.js";
|
|
5
|
-
import { NewNotification } from "../identity/ports.js";
|
|
6
|
-
import "../identity/index.js";
|
|
7
|
-
import { ActionDeps, EmailRecipient } from "./community-mail.js";
|
|
8
|
-
//#region src/automations/community-notifications.d.ts
|
|
9
|
-
type Placement = Omit<NewNotification, 'userId' | 'kind'>;
|
|
10
|
-
interface NotificationPlacement<K extends NotificationKind> {
|
|
11
|
-
place(event: DomainEvent, recipient: EmailRecipient<K>, deps: ActionDeps): Promise<Placement[]>;
|
|
12
|
-
}
|
|
13
|
-
declare const NOTIFICATION_PLACEMENTS: { [K in NotificationKind]: NotificationPlacement<K>; };
|
|
14
|
-
//#endregion
|
|
15
|
-
export { NOTIFICATION_PLACEMENTS, NotificationPlacement };
|
|
16
|
-
//# sourceMappingURL=community-notifications.d.ts.map
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { actorOf } from "./community-mail.js";
|
|
2
|
-
//#region src/automations/community-notifications.ts
|
|
3
|
-
function text(event, key) {
|
|
4
|
-
if (typeof event.data !== "object" || event.data === null) return null;
|
|
5
|
-
const value = event.data[key];
|
|
6
|
-
return typeof value === "string" ? value : null;
|
|
7
|
-
}
|
|
8
|
-
function at(communityId, actorOrgUserId, about) {
|
|
9
|
-
return [{
|
|
10
|
-
communityId,
|
|
11
|
-
actorOrgUserId,
|
|
12
|
-
spaceId: about.spaceId ?? null,
|
|
13
|
-
postId: about.postId ?? null,
|
|
14
|
-
commentId: about.commentId ?? null,
|
|
15
|
-
chatId: about.chatId ?? null,
|
|
16
|
-
messageId: about.messageId ?? null
|
|
17
|
-
}];
|
|
18
|
-
}
|
|
19
|
-
function actor(event) {
|
|
20
|
-
return actorOf(event) ?? null;
|
|
21
|
-
}
|
|
22
|
-
async function spaceOfPost(deps, event, postId) {
|
|
23
|
-
return postId ? (await deps.mail.post(event.orgId, postId))?.spaceId ?? null : null;
|
|
24
|
-
}
|
|
25
|
-
const NOTIFICATION_PLACEMENTS = {
|
|
26
|
-
newPostInSpace: { place: async (event, { params }) => at(params.communityId, text(event, "orgUserId"), {
|
|
27
|
-
postId: params.postId,
|
|
28
|
-
spaceId: text(event, "spaceId")
|
|
29
|
-
}) },
|
|
30
|
-
newCommentOnPost: { place: async (event, { params }, deps) => at(params.communityId, text(event, "orgUserId"), {
|
|
31
|
-
postId: params.postId,
|
|
32
|
-
commentId: params.commentId,
|
|
33
|
-
spaceId: await spaceOfPost(deps, event, params.postId)
|
|
34
|
-
}) },
|
|
35
|
-
replyToYourComment: { place: async (event, { params }, deps) => at(params.communityId, text(event, "orgUserId"), {
|
|
36
|
-
postId: params.postId,
|
|
37
|
-
commentId: params.commentId,
|
|
38
|
-
spaceId: await spaceOfPost(deps, event, params.postId)
|
|
39
|
-
}) },
|
|
40
|
-
yourPostWasPublished: { place: async (event, { params }) => at(params.communityId, actor(event), {
|
|
41
|
-
postId: params.postId,
|
|
42
|
-
spaceId: text(event, "spaceId")
|
|
43
|
-
}) },
|
|
44
|
-
yourPostWasRemoved: { place: async (event, { params }) => at(params.communityId, text(event, "removedBy"), {
|
|
45
|
-
postId: text(event, "id"),
|
|
46
|
-
spaceId: params.spaceId
|
|
47
|
-
}) },
|
|
48
|
-
yourCommentWasRemoved: { place: async (event, { params }, deps) => at(params.communityId, text(event, "removedBy"), {
|
|
49
|
-
postId: params.postId,
|
|
50
|
-
commentId: text(event, "id"),
|
|
51
|
-
spaceId: await spaceOfPost(deps, event, params.postId)
|
|
52
|
-
}) },
|
|
53
|
-
requestApproved: { place: async (event, { params }) => at(params.communityId, actor(event), { spaceId: params.spaceId }) },
|
|
54
|
-
requestDeclined: { place: async (event, { params }) => at(params.communityId, actor(event), { spaceId: text(event, "spaceId") }) },
|
|
55
|
-
invitedToSpace: { place: async (event, { params }) => at(params.communityId, actor(event), { spaceId: params.spaceId }) },
|
|
56
|
-
newMessage: { place: async (event, { params }) => at(params.communityId, text(event, "orgUserId"), {
|
|
57
|
-
chatId: params.chatId,
|
|
58
|
-
messageId: text(event, "id")
|
|
59
|
-
}) },
|
|
60
|
-
messageRequest: { place: async (event, { params }) => at(params.communityId, text(event, "createdBy"), { chatId: params.chatId }) },
|
|
61
|
-
addedToGroupChat: { place: async (event, { params }) => at(params.communityId, text(event, "addedBy"), { chatId: params.chatId }) },
|
|
62
|
-
youAreNowAModerator: { place: async (event) => at(null, actor(event), {}) },
|
|
63
|
-
membershipEndingSoon: { place: async (_event, { params }) => at(params.communityId, null, {}) },
|
|
64
|
-
welcomeToCommunity: { place: async (event, { params }) => at(params.communityId, actor(event), {}) },
|
|
65
|
-
postAwaitingReview: { place: async (event, { params }) => at(params.communityId, text(event, "orgUserId"), {
|
|
66
|
-
postId: text(event, "id"),
|
|
67
|
-
spaceId: params.spaceId
|
|
68
|
-
}) },
|
|
69
|
-
joinRequest: { place: async (event, { params }) => at(params.communityId, text(event, "orgUserId"), { spaceId: params.spaceId }) },
|
|
70
|
-
somethingWasFlagged: { place: async (event, { params }, deps) => {
|
|
71
|
-
const commentId = text(event, "commentId");
|
|
72
|
-
const postId = commentId ? (await deps.mail.comment(event.orgId, commentId))?.postId ?? null : text(event, "postId");
|
|
73
|
-
return at(params.communityId, text(event, "orgUserId"), {
|
|
74
|
-
spaceId: params.spaceId,
|
|
75
|
-
postId,
|
|
76
|
-
commentId
|
|
77
|
-
});
|
|
78
|
-
} },
|
|
79
|
-
messageWasFlagged: { place: async (event, { params }) => at(params.communityId, text(event, "orgUserId"), { messageId: text(event, "messageId") }) }
|
|
80
|
-
};
|
|
81
|
-
//#endregion
|
|
82
|
-
export { NOTIFICATION_PLACEMENTS };
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=community-notifications.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"community-notifications.js","names":[],"sources":["../../src/automations/community-notifications.ts"],"sourcesContent":["import type { NewNotification } from '../identity/index.js';\nimport type { NotificationKind } from '../types/index.js';\nimport type { DomainEvent } from '../shared/ports.js';\nimport { actorOf, type ActionDeps, type EmailRecipient } from './community-mail.js';\n\ntype Placement = Omit<NewNotification, 'userId' | 'kind'>;\n\nexport interface NotificationPlacement<K extends NotificationKind> {\n place(event: DomainEvent, recipient: EmailRecipient<K>, deps: ActionDeps): Promise<Placement[]>;\n}\n\ntype About = Partial<Pick<Placement, 'spaceId' | 'postId' | 'commentId' | 'chatId' | 'messageId'>>;\n\nfunction text(event: DomainEvent, key: string): string | null {\n if (typeof event.data !== 'object' || event.data === null) {\n return null;\n }\n const value = (event.data as Record<string, unknown>)[key];\n return typeof value === 'string' ? value : null;\n}\n\nfunction at(communityId: string | null, actorOrgUserId: string | null, about: About): Placement[] {\n return [\n {\n communityId,\n actorOrgUserId,\n spaceId: about.spaceId ?? null,\n postId: about.postId ?? null,\n commentId: about.commentId ?? null,\n chatId: about.chatId ?? null,\n messageId: about.messageId ?? null,\n },\n ];\n}\n\nfunction actor(event: DomainEvent): string | null {\n return actorOf(event) ?? null;\n}\n\nasync function spaceOfPost(\n deps: ActionDeps,\n event: DomainEvent,\n postId: string | null,\n): Promise<string | null> {\n return postId ? ((await deps.mail.post(event.orgId, postId))?.spaceId ?? null) : null;\n}\n\nexport const NOTIFICATION_PLACEMENTS: {\n [K in NotificationKind]: NotificationPlacement<K>;\n} = {\n newPostInSpace: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'orgUserId'), {\n postId: params.postId,\n spaceId: text(event, 'spaceId'),\n }),\n },\n newCommentOnPost: {\n place: async (event, { params }, deps) =>\n at(params.communityId, text(event, 'orgUserId'), {\n postId: params.postId,\n commentId: params.commentId,\n spaceId: await spaceOfPost(deps, event, params.postId),\n }),\n },\n replyToYourComment: {\n place: async (event, { params }, deps) =>\n at(params.communityId, text(event, 'orgUserId'), {\n postId: params.postId,\n commentId: params.commentId,\n spaceId: await spaceOfPost(deps, event, params.postId),\n }),\n },\n yourPostWasPublished: {\n place: async (event, { params }) =>\n at(params.communityId, actor(event), {\n postId: params.postId,\n spaceId: text(event, 'spaceId'),\n }),\n },\n yourPostWasRemoved: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'removedBy'), {\n postId: text(event, 'id'),\n spaceId: params.spaceId,\n }),\n },\n yourCommentWasRemoved: {\n place: async (event, { params }, deps) =>\n at(params.communityId, text(event, 'removedBy'), {\n postId: params.postId,\n commentId: text(event, 'id'),\n spaceId: await spaceOfPost(deps, event, params.postId),\n }),\n },\n requestApproved: {\n place: async (event, { params }) =>\n at(params.communityId, actor(event), { spaceId: params.spaceId }),\n },\n requestDeclined: {\n place: async (event, { params }) =>\n at(params.communityId, actor(event), { spaceId: text(event, 'spaceId') }),\n },\n invitedToSpace: {\n place: async (event, { params }) =>\n at(params.communityId, actor(event), { spaceId: params.spaceId }),\n },\n newMessage: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'orgUserId'), {\n chatId: params.chatId,\n messageId: text(event, 'id'),\n }),\n },\n messageRequest: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'createdBy'), { chatId: params.chatId }),\n },\n addedToGroupChat: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'addedBy'), { chatId: params.chatId }),\n },\n youAreNowAModerator: {\n place: async (event) => at(null, actor(event), {}),\n },\n membershipEndingSoon: {\n place: async (_event, { params }) => at(params.communityId, null, {}),\n },\n welcomeToCommunity: {\n place: async (event, { params }) => at(params.communityId, actor(event), {}),\n },\n postAwaitingReview: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'orgUserId'), {\n postId: text(event, 'id'),\n spaceId: params.spaceId,\n }),\n },\n joinRequest: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'orgUserId'), { spaceId: params.spaceId }),\n },\n somethingWasFlagged: {\n place: async (event, { params }, deps) => {\n const commentId = text(event, 'commentId');\n const postId = commentId\n ? ((await deps.mail.comment(event.orgId, commentId))?.postId ?? null)\n : text(event, 'postId');\n return at(params.communityId, text(event, 'orgUserId'), {\n spaceId: params.spaceId,\n postId,\n commentId,\n });\n },\n },\n messageWasFlagged: {\n place: async (event, { params }) =>\n at(params.communityId, text(event, 'orgUserId'), { messageId: text(event, 'messageId') }),\n },\n};\n"],"mappings":";;AAaA,SAAS,KAAK,OAAoB,KAA4B;CAC5D,IAAI,OAA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,GAAG,CAAC,CAAC,EACnD;CACA,sBAAsB,EACpB,OAAO,OAAO,QAAQ,EAAE,aAAa,GAAG,OAAO,aAAa,MAAM,CAAC,CAAC,EACtE;CACA,oBAAoB,EAClB,OAAO,OAAO,OAAO,EAAE,aAAa,GAAG,OAAO,aAAa,MAAM,KAAK,GAAG,CAAC,CAAC,EAC7E;CACA,oBAAoB,EAClB,OAAO,OAAO,OAAO,EAAE,aACrB,GAAG,OAAO,aAAa,KAAK,OAAO,WAAW,GAAG;EAC/C,QAAQ,KAAK,OAAO,IAAI;EACxB,SAAS,OAAO;CAClB,CAAC,EACL;CACA,aAAa,EACX,OAAO,OAAO,OAAO,EAAE,aACrB,GAAG,OAAO,aAAa,KAAK,OAAO,WAAW,GAAG,EAAE,SAAS,OAAO,QAAQ,CAAC,EAChF;CACA,qBAAqB,EACnB,OAAO,OAAO,OAAO,EAAE,UAAU,SAAS;EACxC,MAAM,YAAY,KAAK,OAAO,WAAW;EACzC,MAAM,SAAS,aACT,MAAM,KAAK,KAAK,QAAQ,MAAM,OAAO,SAAS,EAAA,EAAI,UAAU,OAC9D,KAAK,OAAO,QAAQ;EACxB,OAAO,GAAG,OAAO,aAAa,KAAK,OAAO,WAAW,GAAG;GACtD,SAAS,OAAO;GAChB;GACA;EACF,CAAC;CACH,EACF;CACA,mBAAmB,EACjB,OAAO,OAAO,OAAO,EAAE,aACrB,GAAG,OAAO,aAAa,KAAK,OAAO,WAAW,GAAG,EAAE,WAAW,KAAK,OAAO,WAAW,EAAE,CAAC,EAC5F;AACF"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { JsonValue } from "../types/shared.js";
|
|
2
|
-
import { AutomationAction } from "../types/schemas/automations.js";
|
|
3
|
-
import "../types/index.js";
|
|
4
|
-
import "./model.js";
|
|
5
|
-
//#region src/automations/seeds.d.ts
|
|
6
|
-
interface SeedAutomation {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
triggers: string[];
|
|
10
|
-
actions: AutomationAction[];
|
|
11
|
-
filter: Record<string, JsonValue> | null;
|
|
12
|
-
}
|
|
13
|
-
declare function orgSeeds(): SeedAutomation[];
|
|
14
|
-
declare function communitySeeds(communityId: string): SeedAutomation[];
|
|
15
|
-
//#endregion
|
|
16
|
-
export { SeedAutomation, communitySeeds, orgSeeds };
|
|
17
|
-
//# sourceMappingURL=seeds.d.ts.map
|
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
//#region src/automations/seeds.ts
|
|
2
|
-
function email(template, communityId) {
|
|
3
|
-
return {
|
|
4
|
-
type: "sendEmail",
|
|
5
|
-
input: communityId === void 0 ? { template } : {
|
|
6
|
-
template,
|
|
7
|
-
communityId
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
function notify(kind, communityId) {
|
|
12
|
-
return {
|
|
13
|
-
type: "notify",
|
|
14
|
-
input: communityId === void 0 ? { kind } : {
|
|
15
|
-
kind,
|
|
16
|
-
communityId
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function orgSeeds() {
|
|
21
|
-
return [
|
|
22
|
-
{
|
|
23
|
-
name: "Access granted",
|
|
24
|
-
description: "Email the person when they are granted a content item.",
|
|
25
|
-
triggers: ["entitlement.created"],
|
|
26
|
-
actions: [email("accessGranted")],
|
|
27
|
-
filter: null
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: "Access revoked",
|
|
31
|
-
description: "Email the person when a content grant is deleted.",
|
|
32
|
-
triggers: ["entitlement.deleted"],
|
|
33
|
-
actions: [email("accessRevoked")],
|
|
34
|
-
filter: null
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "You are now a moderator",
|
|
38
|
-
description: "Notify the person when they are given the moderator role.",
|
|
39
|
-
triggers: ["organization.user.updated"],
|
|
40
|
-
actions: [notify("youAreNowAModerator")],
|
|
41
|
-
filter: null
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "Publish due posts",
|
|
45
|
-
description: "Submit scheduled posts whose time has passed.",
|
|
46
|
-
triggers: ["schedule:* * * * *"],
|
|
47
|
-
actions: [{
|
|
48
|
-
type: "publishDuePosts",
|
|
49
|
-
input: {}
|
|
50
|
-
}],
|
|
51
|
-
filter: null
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: "Expire due grants",
|
|
55
|
-
description: "Expire grants whose time has passed and remind those ending within a week.",
|
|
56
|
-
triggers: ["schedule:0 * * * *"],
|
|
57
|
-
actions: [{
|
|
58
|
-
type: "expireDueGrants",
|
|
59
|
-
input: {}
|
|
60
|
-
}],
|
|
61
|
-
filter: null
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: "Send digest",
|
|
65
|
-
description: "Open the daily digest for every community.",
|
|
66
|
-
triggers: ["schedule:0 7 * * *"],
|
|
67
|
-
actions: [{
|
|
68
|
-
type: "sendDigest",
|
|
69
|
-
input: {}
|
|
70
|
-
}],
|
|
71
|
-
filter: null
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
name: "Remove unattached uploads",
|
|
75
|
-
description: "Remove member uploads older than an hour that nothing references.",
|
|
76
|
-
triggers: ["schedule:0 * * * *"],
|
|
77
|
-
actions: [{
|
|
78
|
-
type: "removeUnattachedUploads",
|
|
79
|
-
input: {}
|
|
80
|
-
}],
|
|
81
|
-
filter: null
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: "Welcome to the community",
|
|
85
|
-
description: "Notify a person when a grant opens a community.",
|
|
86
|
-
triggers: ["entitlement.created"],
|
|
87
|
-
actions: [notify("welcomeToCommunity")],
|
|
88
|
-
filter: null
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: "Membership ended",
|
|
92
|
-
description: "Email a person when a grant that opened a community ends.",
|
|
93
|
-
triggers: ["entitlement.expired", "entitlement.deleted"],
|
|
94
|
-
actions: [email("membershipEnded")],
|
|
95
|
-
filter: null
|
|
96
|
-
}
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
function communitySeeds(communityId) {
|
|
100
|
-
const filter = { communityId };
|
|
101
|
-
const scoped = (template) => email(template, communityId);
|
|
102
|
-
const told = (kind) => notify(kind, communityId);
|
|
103
|
-
return [
|
|
104
|
-
{
|
|
105
|
-
name: "Membership ending soon",
|
|
106
|
-
description: "Notify a member a week before this community grant ends.",
|
|
107
|
-
triggers: ["entitlement.ending_soon"],
|
|
108
|
-
actions: [told("membershipEndingSoon")],
|
|
109
|
-
filter: { communityId }
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
name: "New post in a space",
|
|
113
|
-
description: "Notify members who can open the space.",
|
|
114
|
-
triggers: ["discussion.post.published"],
|
|
115
|
-
actions: [told("newPostInSpace")],
|
|
116
|
-
filter
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: "Your post was published",
|
|
120
|
-
description: "Notify the author when a pending post is published.",
|
|
121
|
-
triggers: ["discussion.post.published"],
|
|
122
|
-
actions: [told("yourPostWasPublished")],
|
|
123
|
-
filter
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
name: "Your post was removed",
|
|
127
|
-
description: "Notify the author when someone else removes their post.",
|
|
128
|
-
triggers: ["discussion.post.removed"],
|
|
129
|
-
actions: [told("yourPostWasRemoved")],
|
|
130
|
-
filter
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
name: "New comment on a post you follow",
|
|
134
|
-
description: "Notify the author and followers when a comment is published.",
|
|
135
|
-
triggers: ["discussion.comment.created"],
|
|
136
|
-
actions: [told("newCommentOnPost")],
|
|
137
|
-
filter
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
name: "Reply to your comment",
|
|
141
|
-
description: "Notify the parent author when a reply is published.",
|
|
142
|
-
triggers: ["discussion.comment.created"],
|
|
143
|
-
actions: [told("replyToYourComment")],
|
|
144
|
-
filter
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "Your comment was removed",
|
|
148
|
-
description: "Notify the author when someone else removes their comment.",
|
|
149
|
-
triggers: ["discussion.comment.removed"],
|
|
150
|
-
actions: [told("yourCommentWasRemoved")],
|
|
151
|
-
filter
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "Post awaiting review",
|
|
155
|
-
description: "Notify staff and moderators when a post enters review.",
|
|
156
|
-
triggers: ["discussion.post.created", "discussion.post.updated"],
|
|
157
|
-
actions: [told("postAwaitingReview")],
|
|
158
|
-
filter
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
name: "Join request",
|
|
162
|
-
description: "Notify staff and moderators when someone requests a space.",
|
|
163
|
-
triggers: ["entitlement.space_member.created"],
|
|
164
|
-
actions: [told("joinRequest")],
|
|
165
|
-
filter
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
name: "Request approved",
|
|
169
|
-
description: "Notify the member when their request is approved.",
|
|
170
|
-
triggers: ["entitlement.space_member.updated"],
|
|
171
|
-
actions: [told("requestApproved")],
|
|
172
|
-
filter
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
name: "Request declined",
|
|
176
|
-
description: "Notify the person when their request is declined.",
|
|
177
|
-
triggers: ["entitlement.space_member.deleted"],
|
|
178
|
-
actions: [told("requestDeclined")],
|
|
179
|
-
filter
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
name: "Invited to a space",
|
|
183
|
-
description: "Notify the person when they are invited to a space.",
|
|
184
|
-
triggers: ["entitlement.space_member.created"],
|
|
185
|
-
actions: [told("invitedToSpace")],
|
|
186
|
-
filter
|
|
187
|
-
},
|
|
188
|
-
{
|
|
189
|
-
name: "New message",
|
|
190
|
-
description: "Notify participants who are not muted, at most once per chat per 15 minutes.",
|
|
191
|
-
triggers: ["discussion.message.sent"],
|
|
192
|
-
actions: [told("newMessage")],
|
|
193
|
-
filter
|
|
194
|
-
},
|
|
195
|
-
{
|
|
196
|
-
name: "Message request",
|
|
197
|
-
description: "Notify the recipient when a direct chat starts as a request.",
|
|
198
|
-
triggers: ["discussion.chat.created"],
|
|
199
|
-
actions: [told("messageRequest")],
|
|
200
|
-
filter
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
name: "Added to a group chat",
|
|
204
|
-
description: "Notify the person added to a group chat.",
|
|
205
|
-
triggers: ["discussion.chat.participant.added"],
|
|
206
|
-
actions: [told("addedToGroupChat")],
|
|
207
|
-
filter
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: "Something was flagged",
|
|
211
|
-
description: "Notify staff and moderators when a post or comment is flagged.",
|
|
212
|
-
triggers: ["discussion.post.reported", "discussion.comment.reported"],
|
|
213
|
-
actions: [told("somethingWasFlagged")],
|
|
214
|
-
filter
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
name: "A message was flagged",
|
|
218
|
-
description: "Notify staff when a message is flagged.",
|
|
219
|
-
triggers: ["discussion.message.reported"],
|
|
220
|
-
actions: [told("messageWasFlagged")],
|
|
221
|
-
filter
|
|
222
|
-
},
|
|
223
|
-
{
|
|
224
|
-
name: "Digest",
|
|
225
|
-
description: "Email members their unread activity. Not sent until email preferences exist.",
|
|
226
|
-
triggers: ["discussion.digest.due"],
|
|
227
|
-
actions: [scoped("digest")],
|
|
228
|
-
filter
|
|
229
|
-
}
|
|
230
|
-
];
|
|
231
|
-
}
|
|
232
|
-
//#endregion
|
|
233
|
-
export { communitySeeds, orgSeeds };
|
|
234
|
-
|
|
235
|
-
//# sourceMappingURL=seeds.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seeds.js","names":[],"sources":["../../src/automations/seeds.ts"],"sourcesContent":["import type { JsonValue } from '../types/index.js';\nimport type { AutomationAction } from './model.js';\n\nexport interface SeedAutomation {\n name: string;\n description: string;\n triggers: string[];\n actions: AutomationAction[];\n filter: Record<string, JsonValue> | null;\n}\n\nfunction email(template: string, communityId?: string): AutomationAction {\n return {\n type: 'sendEmail',\n input: communityId === undefined ? { template } : { template, communityId },\n };\n}\n\nfunction notify(kind: string, communityId?: string): AutomationAction {\n return {\n type: 'notify',\n input: communityId === undefined ? { kind } : { kind, communityId },\n };\n}\n\nexport function orgSeeds(): SeedAutomation[] {\n return [\n {\n name: 'Access granted',\n description: 'Email the person when they are granted a content item.',\n triggers: ['entitlement.created'],\n actions: [email('accessGranted')],\n filter: null,\n },\n {\n name: 'Access revoked',\n description: 'Email the person when a content grant is deleted.',\n triggers: ['entitlement.deleted'],\n actions: [email('accessRevoked')],\n filter: null,\n },\n {\n name: 'You are now a moderator',\n description: 'Notify the person when they are given the moderator role.',\n triggers: ['organization.user.updated'],\n actions: [notify('youAreNowAModerator')],\n filter: null,\n },\n {\n name: 'Publish due posts',\n description: 'Submit scheduled posts whose time has passed.',\n triggers: ['schedule:* * * * *'],\n actions: [{ type: 'publishDuePosts', input: {} }],\n filter: null,\n },\n {\n name: 'Expire due grants',\n description: 'Expire grants whose time has passed and remind those ending within a week.',\n triggers: ['schedule:0 * * * *'],\n actions: [{ type: 'expireDueGrants', input: {} }],\n filter: null,\n },\n {\n name: 'Send digest',\n description: 'Open the daily digest for every community.',\n triggers: ['schedule:0 7 * * *'],\n actions: [{ type: 'sendDigest', input: {} }],\n filter: null,\n },\n {\n name: 'Remove unattached uploads',\n description: 'Remove member uploads older than an hour that nothing references.',\n triggers: ['schedule:0 * * * *'],\n actions: [{ type: 'removeUnattachedUploads', input: {} }],\n filter: null,\n },\n {\n name: 'Welcome to the community',\n description: 'Notify a person when a grant opens a community.',\n triggers: ['entitlement.created'],\n actions: [notify('welcomeToCommunity')],\n filter: null,\n },\n {\n name: 'Membership ended',\n description: 'Email a person when a grant that opened a community ends.',\n triggers: ['entitlement.expired', 'entitlement.deleted'],\n actions: [email('membershipEnded')],\n filter: null,\n },\n ];\n}\n\nexport function communitySeeds(communityId: string): SeedAutomation[] {\n const filter = { communityId };\n const scoped = (template: string): AutomationAction => email(template, communityId);\n const told = (kind: string): AutomationAction => notify(kind, communityId);\n return [\n {\n name: 'Membership ending soon',\n description: 'Notify a member a week before this community grant ends.',\n triggers: ['entitlement.ending_soon'],\n actions: [told('membershipEndingSoon')],\n filter: { communityId },\n },\n {\n name: 'New post in a space',\n description: 'Notify members who can open the space.',\n triggers: ['discussion.post.published'],\n actions: [told('newPostInSpace')],\n filter,\n },\n {\n name: 'Your post was published',\n description: 'Notify the author when a pending post is published.',\n triggers: ['discussion.post.published'],\n actions: [told('yourPostWasPublished')],\n filter,\n },\n {\n name: 'Your post was removed',\n description: 'Notify the author when someone else removes their post.',\n triggers: ['discussion.post.removed'],\n actions: [told('yourPostWasRemoved')],\n filter,\n },\n {\n name: 'New comment on a post you follow',\n description: 'Notify the author and followers when a comment is published.',\n triggers: ['discussion.comment.created'],\n actions: [told('newCommentOnPost')],\n filter,\n },\n {\n name: 'Reply to your comment',\n description: 'Notify the parent author when a reply is published.',\n triggers: ['discussion.comment.created'],\n actions: [told('replyToYourComment')],\n filter,\n },\n {\n name: 'Your comment was removed',\n description: 'Notify the author when someone else removes their comment.',\n triggers: ['discussion.comment.removed'],\n actions: [told('yourCommentWasRemoved')],\n filter,\n },\n {\n name: 'Post awaiting review',\n description: 'Notify staff and moderators when a post enters review.',\n triggers: ['discussion.post.created', 'discussion.post.updated'],\n actions: [told('postAwaitingReview')],\n filter,\n },\n {\n name: 'Join request',\n description: 'Notify staff and moderators when someone requests a space.',\n triggers: ['entitlement.space_member.created'],\n actions: [told('joinRequest')],\n filter,\n },\n {\n name: 'Request approved',\n description: 'Notify the member when their request is approved.',\n triggers: ['entitlement.space_member.updated'],\n actions: [told('requestApproved')],\n filter,\n },\n {\n name: 'Request declined',\n description: 'Notify the person when their request is declined.',\n triggers: ['entitlement.space_member.deleted'],\n actions: [told('requestDeclined')],\n filter,\n },\n {\n name: 'Invited to a space',\n description: 'Notify the person when they are invited to a space.',\n triggers: ['entitlement.space_member.created'],\n actions: [told('invitedToSpace')],\n filter,\n },\n {\n name: 'New message',\n description: 'Notify participants who are not muted, at most once per chat per 15 minutes.',\n triggers: ['discussion.message.sent'],\n actions: [told('newMessage')],\n filter,\n },\n {\n name: 'Message request',\n description: 'Notify the recipient when a direct chat starts as a request.',\n triggers: ['discussion.chat.created'],\n actions: [told('messageRequest')],\n filter,\n },\n {\n name: 'Added to a group chat',\n description: 'Notify the person added to a group chat.',\n triggers: ['discussion.chat.participant.added'],\n actions: [told('addedToGroupChat')],\n filter,\n },\n {\n name: 'Something was flagged',\n description: 'Notify staff and moderators when a post or comment is flagged.',\n triggers: ['discussion.post.reported', 'discussion.comment.reported'],\n actions: [told('somethingWasFlagged')],\n filter,\n },\n {\n name: 'A message was flagged',\n description: 'Notify staff when a message is flagged.',\n triggers: ['discussion.message.reported'],\n actions: [told('messageWasFlagged')],\n filter,\n },\n {\n name: 'Digest',\n description: 'Email members their unread activity. Not sent until email preferences exist.',\n triggers: ['discussion.digest.due'],\n actions: [scoped('digest')],\n filter,\n },\n ];\n}\n"],"mappings":";AAWA,SAAS,MAAM,UAAkB,aAAwC;CACvE,OAAO;EACL,MAAM;EACN,OAAO,gBAAgB,KAAA,IAAY,EAAE,SAAS,IAAI;GAAE;GAAU;EAAY;CAC5E;AACF;AAEA,SAAS,OAAO,MAAc,aAAwC;CACpE,OAAO;EACL,MAAM;EACN,OAAO,gBAAgB,KAAA,IAAY,EAAE,KAAK,IAAI;GAAE;GAAM;EAAY;CACpE;AACF;AAEA,SAAgB,WAA6B;CAC3C,OAAO;EACL;GACE,MAAM;GACN,aAAa;GACb,UAAU,CAAC,qBAAqB;GAChC,SAAS,CAAC,MAAM,eAAe,CAAC;GAChC,QAAQ;EACV;EACA;GACE,MAAM;GACN,aAAa;GACb,UAAU,CAAC,qBAAqB;GAChC,SAAS,CAAC,MAAM,eAAe,CAAC;GAChC,QAAQ;EACV;EACA;GACE,MAAM;GACN,aAAa;GACb,UAAU,CAAC,2BAA2B;GACtC,SAAS,CAAC,OAAO,qBAAqB,CAAC;GACvC,QAAQ;EACV;EACA;GACE,MAAM;GACN,aAAa;GAC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