@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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { notificationCategoryListSchema } from "../types/schemas/notifications.js";
|
|
2
|
+
import { ValidationError } from "./errors.js";
|
|
3
|
+
//#region src/shared/notification-categories.ts
|
|
4
|
+
const LIST_SCOPES = {
|
|
5
|
+
org: ["org"],
|
|
6
|
+
community: [
|
|
7
|
+
"community",
|
|
8
|
+
"space",
|
|
9
|
+
"chat"
|
|
10
|
+
]
|
|
11
|
+
};
|
|
12
|
+
function coversListScope(declaration, listScope) {
|
|
13
|
+
return declaration.scopes.some((scope) => LIST_SCOPES[listScope].includes(scope));
|
|
14
|
+
}
|
|
15
|
+
function typesForList(types, listScope) {
|
|
16
|
+
return types.list().filter((declaration) => coversListScope(declaration, listScope));
|
|
17
|
+
}
|
|
18
|
+
function categoryListProblems(categories, listScope, types, configured) {
|
|
19
|
+
const problems = [];
|
|
20
|
+
const problem = (path, message) => problems.push({
|
|
21
|
+
path,
|
|
22
|
+
message
|
|
23
|
+
});
|
|
24
|
+
const keys = /* @__PURE__ */ new Set();
|
|
25
|
+
const covered = /* @__PURE__ */ new Set();
|
|
26
|
+
categories.forEach((category, index) => {
|
|
27
|
+
const at = `categories[${index}]`;
|
|
28
|
+
if (keys.has(category.key)) problem(`${at}.key`, `the key ${category.key} is used by an earlier category`);
|
|
29
|
+
keys.add(category.key);
|
|
30
|
+
const pairs = [];
|
|
31
|
+
category.covers.forEach((cover, coverIndex) => {
|
|
32
|
+
const coverAt = `${at}.covers[${coverIndex}]`;
|
|
33
|
+
const declaration = types.get(cover.type);
|
|
34
|
+
if (!declaration) {
|
|
35
|
+
problem(`${coverAt}.type`, `${cover.type} is not a notification type`);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
if (!coversListScope(declaration, listScope)) problem(`${coverAt}.type`, `${cover.type} cannot be in the ${listScope} list`);
|
|
39
|
+
cover.reasons.forEach((reason, reasonIndex) => {
|
|
40
|
+
if (!declaration.reasons.includes(reason)) problem(`${coverAt}.reasons[${reasonIndex}]`, `${cover.type} does not allow the reason ${reason}`);
|
|
41
|
+
pairs.push(`${cover.type}:${reason}`);
|
|
42
|
+
});
|
|
43
|
+
if (category.perSpace === true && !declaration.scopes.includes("space")) problem(`${coverAt}.type`, `${cover.type} cannot occur in a space, so it cannot be per space`);
|
|
44
|
+
});
|
|
45
|
+
if (Object.keys(category.channels).length === 0) problem(`${at}.channels`, "the category offers no channel");
|
|
46
|
+
for (const channel of Object.keys(category.channels)) if (!configured.includes(channel)) problem(`${at}.channels.${channel}`, `the channel ${channel} is not configured`);
|
|
47
|
+
if (category.perSpace === true && listScope === "org") problem(`${at}.perSpace`, "only a community list can have a per-space category");
|
|
48
|
+
if (category.spaceDefaults !== void 0) {
|
|
49
|
+
if (category.perSpace !== true) problem(`${at}.spaceDefaults`, "spaceDefaults needs perSpace");
|
|
50
|
+
for (const [spaceId, channels] of Object.entries(category.spaceDefaults)) for (const channel of Object.keys(channels)) if (!(channel in category.channels)) problem(`${at}.spaceDefaults.${spaceId}.${channel}`, `spaceDefaults for ${spaceId} names the channel ${channel}, which the category does not offer`);
|
|
51
|
+
}
|
|
52
|
+
if (pairs.length > 0 && pairs.every((pair) => covered.has(pair))) problem(`${at}.covers`, "earlier categories already cover everything it covers");
|
|
53
|
+
for (const pair of pairs) covered.add(pair);
|
|
54
|
+
});
|
|
55
|
+
return problems;
|
|
56
|
+
}
|
|
57
|
+
function assertValidCategoryList(categories, listScope, types, configured) {
|
|
58
|
+
const problems = categoryListProblems(categories, listScope, types, configured);
|
|
59
|
+
if (problems.length > 0) throw new ValidationError(problems);
|
|
60
|
+
}
|
|
61
|
+
const LEADING_CHANNELS = [
|
|
62
|
+
"inApp",
|
|
63
|
+
"email",
|
|
64
|
+
"push"
|
|
65
|
+
];
|
|
66
|
+
function channelOrder(configured) {
|
|
67
|
+
return [...LEADING_CHANNELS.filter((channel) => configured.includes(channel)), ...configured.filter((channel) => !LEADING_CHANNELS.includes(channel))];
|
|
68
|
+
}
|
|
69
|
+
function inOrder(values, order) {
|
|
70
|
+
return Object.fromEntries(order.filter((channel) => channel in values).map((channel) => [channel, values[channel]]));
|
|
71
|
+
}
|
|
72
|
+
function offeringConfigured(categories, configured) {
|
|
73
|
+
const order = channelOrder(configured);
|
|
74
|
+
return categories.flatMap((category) => {
|
|
75
|
+
const channels = inOrder(category.channels, order);
|
|
76
|
+
if (Object.keys(channels).length === 0) return [];
|
|
77
|
+
const { spaceDefaults, ...rest } = category;
|
|
78
|
+
return [{
|
|
79
|
+
...rest,
|
|
80
|
+
channels,
|
|
81
|
+
...spaceDefaults !== void 0 && { spaceDefaults: Object.fromEntries(Object.entries(spaceDefaults).map(([spaceId, values]) => [spaceId, inOrder(values, Object.keys(channels))])) }
|
|
82
|
+
}];
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
function storedCategoryList(value) {
|
|
86
|
+
if (value === null || value === void 0) return null;
|
|
87
|
+
const parsed = notificationCategoryListSchema.safeParse(value);
|
|
88
|
+
if (!parsed.success) throw new Error(`stored notification categories are invalid: ${parsed.error.message}`);
|
|
89
|
+
return parsed.data;
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { assertValidCategoryList, categoryListProblems, channelOrder, coversListScope, offeringConfigured, storedCategoryList, typesForList };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=notification-categories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-categories.js","names":[],"sources":["../../src/shared/notification-categories.ts"],"sourcesContent":["import type { NotificationCategory, NotificationTypeDeclaration, Scope } from '../types/index.js';\nimport { notificationCategoryListSchema } from '../types/schemas/notifications.js';\nimport { ValidationError, type ValidationProblem } from './errors.js';\nimport type { NotificationTypeRegistry } from './ports.js';\n\nexport type CategoryListScope = 'org' | 'community';\n\nconst LIST_SCOPES: Record<CategoryListScope, Scope[]> = {\n org: ['org'],\n community: ['community', 'space', 'chat'],\n};\n\nexport function coversListScope(\n declaration: Pick<NotificationTypeDeclaration, 'scopes'>,\n listScope: CategoryListScope,\n): boolean {\n return declaration.scopes.some((scope) => LIST_SCOPES[listScope].includes(scope));\n}\n\nexport function typesForList(\n types: Pick<NotificationTypeRegistry, 'list'>,\n listScope: CategoryListScope,\n): Pick<NotificationTypeDeclaration, 'type' | 'scopes' | 'reasons'>[] {\n return types.list().filter((declaration) => coversListScope(declaration, listScope));\n}\n\nexport function categoryListProblems(\n categories: NotificationCategory[],\n listScope: CategoryListScope,\n types: Pick<NotificationTypeRegistry, 'get'>,\n configured: string[],\n): ValidationProblem[] {\n const problems: ValidationProblem[] = [];\n const problem = (path: string, message: string) => problems.push({ path, message });\n const keys = new Set<string>();\n const covered = new Set<string>();\n categories.forEach((category, index) => {\n const at = `categories[${index}]`;\n if (keys.has(category.key)) {\n problem(`${at}.key`, `the key ${category.key} is used by an earlier category`);\n }\n keys.add(category.key);\n const pairs: string[] = [];\n category.covers.forEach((cover, coverIndex) => {\n const coverAt = `${at}.covers[${coverIndex}]`;\n const declaration = types.get(cover.type);\n if (!declaration) {\n problem(`${coverAt}.type`, `${cover.type} is not a notification type`);\n return;\n }\n if (!coversListScope(declaration, listScope)) {\n problem(`${coverAt}.type`, `${cover.type} cannot be in the ${listScope} list`);\n }\n cover.reasons.forEach((reason, reasonIndex) => {\n if (!declaration.reasons.includes(reason)) {\n problem(\n `${coverAt}.reasons[${reasonIndex}]`,\n `${cover.type} does not allow the reason ${reason}`,\n );\n }\n pairs.push(`${cover.type}:${reason}`);\n });\n if (category.perSpace === true && !declaration.scopes.includes('space')) {\n problem(\n `${coverAt}.type`,\n `${cover.type} cannot occur in a space, so it cannot be per space`,\n );\n }\n });\n if (Object.keys(category.channels).length === 0) {\n problem(`${at}.channels`, 'the category offers no channel');\n }\n for (const channel of Object.keys(category.channels)) {\n if (!configured.includes(channel)) {\n problem(`${at}.channels.${channel}`, `the channel ${channel} is not configured`);\n }\n }\n if (category.perSpace === true && listScope === 'org') {\n problem(`${at}.perSpace`, 'only a community list can have a per-space category');\n }\n if (category.spaceDefaults !== undefined) {\n if (category.perSpace !== true) {\n problem(`${at}.spaceDefaults`, 'spaceDefaults needs perSpace');\n }\n for (const [spaceId, channels] of Object.entries(category.spaceDefaults)) {\n for (const channel of Object.keys(channels)) {\n if (!(channel in category.channels)) {\n problem(\n `${at}.spaceDefaults.${spaceId}.${channel}`,\n `spaceDefaults for ${spaceId} names the channel ${channel}, which the category does not offer`,\n );\n }\n }\n }\n }\n if (pairs.length > 0 && pairs.every((pair) => covered.has(pair))) {\n problem(`${at}.covers`, 'earlier categories already cover everything it covers');\n }\n for (const pair of pairs) {\n covered.add(pair);\n }\n });\n return problems;\n}\n\nexport function assertValidCategoryList(\n categories: NotificationCategory[],\n listScope: CategoryListScope,\n types: Pick<NotificationTypeRegistry, 'get'>,\n configured: string[],\n): void {\n const problems = categoryListProblems(categories, listScope, types, configured);\n if (problems.length > 0) {\n throw new ValidationError(problems);\n }\n}\n\nconst LEADING_CHANNELS = ['inApp', 'email', 'push'];\n\nexport function channelOrder(configured: string[]): string[] {\n return [\n ...LEADING_CHANNELS.filter((channel) => configured.includes(channel)),\n ...configured.filter((channel) => !LEADING_CHANNELS.includes(channel)),\n ];\n}\n\nfunction inOrder<T>(values: Record<string, T>, order: string[]): Record<string, T> {\n return Object.fromEntries(\n order.filter((channel) => channel in values).map((channel) => [channel, values[channel]!]),\n );\n}\n\nexport function offeringConfigured(\n categories: NotificationCategory[],\n configured: string[],\n): NotificationCategory[] {\n const order = channelOrder(configured);\n return categories.flatMap((category) => {\n const channels = inOrder(category.channels, order);\n if (Object.keys(channels).length === 0) {\n return [];\n }\n const { spaceDefaults, ...rest } = category;\n return [\n {\n ...rest,\n channels,\n ...(spaceDefaults !== undefined && {\n spaceDefaults: Object.fromEntries(\n Object.entries(spaceDefaults).map(([spaceId, values]) => [\n spaceId,\n inOrder(values, Object.keys(channels)),\n ]),\n ),\n }),\n },\n ];\n });\n}\n\nexport function storedCategoryList(value: unknown): NotificationCategory[] | null {\n if (value === null || value === undefined) {\n return null;\n }\n const parsed = notificationCategoryListSchema.safeParse(value);\n if (!parsed.success) {\n throw new Error(`stored notification categories are invalid: ${parsed.error.message}`);\n }\n return parsed.data;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NotificationCategory, StoredSetting } from "../types/notifications.js";
|
|
2
|
+
import "../types/index.js";
|
|
3
|
+
//#region src/shared/notification-settings.d.ts
|
|
4
|
+
type ChannelSource = 'locked' | 'space' | 'community' | 'spaceDefault' | 'default';
|
|
5
|
+
interface ResolvedChannel {
|
|
6
|
+
channel: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
source: ChannelSource;
|
|
9
|
+
locked: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare function resolveChannels(category: NotificationCategory, settings: StoredSetting[], spaceId: string | null, configured: string[]): ResolvedChannel[];
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ChannelSource, ResolvedChannel, resolveChannels };
|
|
14
|
+
//# sourceMappingURL=notification-settings.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//#region src/shared/notification-settings.ts
|
|
2
|
+
function resolveChannels(category, settings, spaceId, configured) {
|
|
3
|
+
const perSpace = category.perSpace === true;
|
|
4
|
+
const ownSettings = settings.filter((s) => s.category === category.key);
|
|
5
|
+
const resolved = [];
|
|
6
|
+
for (const channel of configured) {
|
|
7
|
+
const offered = category.channels[channel];
|
|
8
|
+
if (!offered) continue;
|
|
9
|
+
if (offered.locked) {
|
|
10
|
+
resolved.push({
|
|
11
|
+
channel,
|
|
12
|
+
enabled: offered.default,
|
|
13
|
+
source: "locked",
|
|
14
|
+
locked: true
|
|
15
|
+
});
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const forChannel = ownSettings.filter((s) => s.channel === channel);
|
|
19
|
+
const spaceSetting = perSpace && spaceId !== null ? forChannel.find((s) => s.spaceId === spaceId) : void 0;
|
|
20
|
+
if (spaceSetting) {
|
|
21
|
+
resolved.push({
|
|
22
|
+
channel,
|
|
23
|
+
enabled: spaceSetting.enabled,
|
|
24
|
+
source: "space",
|
|
25
|
+
locked: false
|
|
26
|
+
});
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const communitySetting = forChannel.find((s) => s.spaceId === null);
|
|
30
|
+
if (communitySetting) {
|
|
31
|
+
resolved.push({
|
|
32
|
+
channel,
|
|
33
|
+
enabled: communitySetting.enabled,
|
|
34
|
+
source: "community",
|
|
35
|
+
locked: false
|
|
36
|
+
});
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
const spaceDefault = perSpace && spaceId !== null ? category.spaceDefaults?.[spaceId]?.[channel] : void 0;
|
|
40
|
+
if (spaceDefault !== void 0) {
|
|
41
|
+
resolved.push({
|
|
42
|
+
channel,
|
|
43
|
+
enabled: spaceDefault,
|
|
44
|
+
source: "spaceDefault",
|
|
45
|
+
locked: false
|
|
46
|
+
});
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
resolved.push({
|
|
50
|
+
channel,
|
|
51
|
+
enabled: offered.default,
|
|
52
|
+
source: "default",
|
|
53
|
+
locked: false
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return resolved;
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { resolveChannels };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=notification-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notification-settings.js","names":[],"sources":["../../src/shared/notification-settings.ts"],"sourcesContent":["import type { NotificationCategory, StoredSetting } from '../types/index.js';\n\nexport type ChannelSource = 'locked' | 'space' | 'community' | 'spaceDefault' | 'default';\n\nexport interface ResolvedChannel {\n channel: string;\n enabled: boolean;\n source: ChannelSource;\n locked: boolean;\n}\n\nexport function resolveChannels(\n category: NotificationCategory,\n settings: StoredSetting[],\n spaceId: string | null,\n configured: string[],\n): ResolvedChannel[] {\n const perSpace = category.perSpace === true;\n const ownSettings = settings.filter((s) => s.category === category.key);\n const resolved: ResolvedChannel[] = [];\n for (const channel of configured) {\n const offered = category.channels[channel];\n if (!offered) {\n continue;\n }\n if (offered.locked) {\n resolved.push({ channel, enabled: offered.default, source: 'locked', locked: true });\n continue;\n }\n const forChannel = ownSettings.filter((s) => s.channel === channel);\n const spaceSetting =\n perSpace && spaceId !== null ? forChannel.find((s) => s.spaceId === spaceId) : undefined;\n if (spaceSetting) {\n resolved.push({ channel, enabled: spaceSetting.enabled, source: 'space', locked: false });\n continue;\n }\n const communitySetting = forChannel.find((s) => s.spaceId === null);\n if (communitySetting) {\n resolved.push({\n channel,\n enabled: communitySetting.enabled,\n source: 'community',\n locked: false,\n });\n continue;\n }\n const spaceDefault =\n perSpace && spaceId !== null ? category.spaceDefaults?.[spaceId]?.[channel] : undefined;\n if (spaceDefault !== undefined) {\n resolved.push({ channel, enabled: spaceDefault, source: 'spaceDefault', locked: false });\n continue;\n }\n resolved.push({ channel, enabled: offered.default, source: 'default', locked: false });\n }\n return resolved;\n}\n"],"mappings":";AAWA,SAAgB,gBACd,UACA,UACA,SACA,YACmB;CACnB,MAAM,WAAW,SAAS,aAAa;CACvC,MAAM,cAAc,SAAS,QAAQ,MAAM,EAAE,aAAa,SAAS,GAAG;CACtE,MAAM,WAA8B,CAAC;CACrC,KAAK,MAAM,WAAW,YAAY;EAChC,MAAM,UAAU,SAAS,SAAS;EAClC,IAAI,CAAC,SACH;EAEF,IAAI,QAAQ,QAAQ;GAClB,SAAS,KAAK;IAAE;IAAS,SAAS,QAAQ;IAAS,QAAQ;IAAU,QAAQ;GAAK,CAAC;GACnF;EACF;EACA,MAAM,aAAa,YAAY,QAAQ,MAAM,EAAE,YAAY,OAAO;EAClE,MAAM,eACJ,YAAY,YAAY,OAAO,WAAW,MAAM,MAAM,EAAE,YAAY,OAAO,IAAI,KAAA;EACjF,IAAI,cAAc;GAChB,SAAS,KAAK;IAAE;IAAS,SAAS,aAAa;IAAS,QAAQ;IAAS,QAAQ;GAAM,CAAC;GACxF;EACF;EACA,MAAM,mBAAmB,WAAW,MAAM,MAAM,EAAE,YAAY,IAAI;EAClE,IAAI,kBAAkB;GACpB,SAAS,KAAK;IACZ;IACA,SAAS,iBAAiB;IAC1B,QAAQ;IACR,QAAQ;GACV,CAAC;GACD;EACF;EACA,MAAM,eACJ,YAAY,YAAY,OAAO,SAAS,gBAAgB,QAAQ,GAAG,WAAW,KAAA;EAChF,IAAI,iBAAiB,KAAA,GAAW;GAC9B,SAAS,KAAK;IAAE;IAAS,SAAS;IAAc,QAAQ;IAAgB,QAAQ;GAAM,CAAC;GACvF;EACF;EACA,SAAS,KAAK;GAAE;GAAS,SAAS,QAAQ;GAAS,QAAQ;GAAW,QAAQ;EAAM,CAAC;CACvF;CACA,OAAO;AACT"}
|
package/dist/shared/ports.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { DomainEvent, NewDomainEvent } from "../types/shared.js";
|
|
1
|
+
import { DomainEvent, JsonValue, NewDomainEvent } from "../types/shared.js";
|
|
2
2
|
import { EventDefinition } from "../types/events.js";
|
|
3
3
|
import { EmailMessage, EmailSender, Logger, ObjectStorage, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "../types/ports.js";
|
|
4
4
|
import { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "../types/email-templates.js";
|
|
5
|
+
import { ChannelRecipient, DeliveryResult, NotificationCategory, NotificationTypeDeclaration, PushDevice, PushMessage, StoredNotification } from "../types/notifications.js";
|
|
5
6
|
import "../types/index.js";
|
|
6
7
|
import { EventOf, EventOfValues, InvalidDomainEventError, RuntimeEventDefinition, defineEvent, eventIdSchema, eventJsonValueSchema, eventMetadataSchema } from "./events.js";
|
|
7
8
|
//#region src/shared/ports.d.ts
|
|
@@ -57,6 +58,51 @@ interface CredentialStore {
|
|
|
57
58
|
/** Permanently delete stored secrets (e.g. disconnect). */
|
|
58
59
|
destroy(orgId: string, ref: string): Promise<void>;
|
|
59
60
|
}
|
|
61
|
+
interface NotificationTypeRegistry {
|
|
62
|
+
list(): Pick<NotificationTypeDeclaration, 'type' | 'scopes' | 'reasons'>[];
|
|
63
|
+
get(type: string): NotificationTypeDeclaration | undefined;
|
|
64
|
+
defaults(scope: 'org' | 'community'): NotificationCategory[];
|
|
65
|
+
}
|
|
66
|
+
interface NotificationChannel {
|
|
67
|
+
key: string;
|
|
68
|
+
recipient(orgId: string, userId: string): Promise<ChannelRecipient | null>;
|
|
69
|
+
deliver(notification: StoredNotification, to: ChannelRecipient): Promise<DeliveryResult>;
|
|
70
|
+
}
|
|
71
|
+
interface ChannelRegistry {
|
|
72
|
+
list(): string[];
|
|
73
|
+
get(key: string): NotificationChannel | undefined;
|
|
74
|
+
}
|
|
75
|
+
interface NotificationCategoryService {
|
|
76
|
+
get(orgId: string, scopeId: string): Promise<{
|
|
77
|
+
categories: NotificationCategory[];
|
|
78
|
+
source: 'default' | 'stored';
|
|
79
|
+
}>;
|
|
80
|
+
replace(orgId: string, scopeId: string, categories: NotificationCategory[]): Promise<{
|
|
81
|
+
categories: NotificationCategory[];
|
|
82
|
+
source: 'stored';
|
|
83
|
+
}>;
|
|
84
|
+
reset(orgId: string, scopeId: string): Promise<void>;
|
|
85
|
+
defaults(): NotificationCategory[];
|
|
86
|
+
}
|
|
87
|
+
interface PushSender {
|
|
88
|
+
send(devices: PushDevice[], message: PushMessage): Promise<DeliveryResult>;
|
|
89
|
+
}
|
|
90
|
+
interface ScheduledJob {
|
|
91
|
+
job: string;
|
|
92
|
+
run(payload: JsonValue, fire: {
|
|
93
|
+
id: string;
|
|
94
|
+
startedAt: Date;
|
|
95
|
+
}): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
interface RecurringJob {
|
|
98
|
+
job: string;
|
|
99
|
+
cron: string;
|
|
100
|
+
}
|
|
101
|
+
interface Scheduler {
|
|
102
|
+
registerJobs(handlers: ScheduledJob[], recurring: RecurringJob[]): void;
|
|
103
|
+
at(job: string, runAt: Date, key: string, payload: JsonValue): Promise<void>;
|
|
104
|
+
cancel(job: string, key: string): Promise<void>;
|
|
105
|
+
}
|
|
60
106
|
//#endregion
|
|
61
|
-
export { Clock, CredentialStore, type DomainEvent, type EmailContent, type EmailMessage, type EmailSender, type EmailTemplateId, type EmailTemplateParams, EventBus, type EventDefinition, type EventOf, type EventOfValues, InvalidDomainEventError, type Logger, type NewDomainEvent, type ObjectStorage, OutboxAppender, OutboxMessage, OutboxRelay, OutboxStore, type PresignDownloadInput, type PresignedUpload, type RuntimeEventDefinition, type StoredObjectInfo, type TemplateContext, type TemplateRenderer, UnitOfWork, defineEvent, eventIdSchema, eventJsonValueSchema, eventMetadataSchema };
|
|
107
|
+
export { type ChannelRecipient, ChannelRegistry, Clock, CredentialStore, type DeliveryResult, type DomainEvent, type EmailContent, type EmailMessage, type EmailSender, type EmailTemplateId, type EmailTemplateParams, EventBus, type EventDefinition, type EventOf, type EventOfValues, InvalidDomainEventError, type JsonValue, type Logger, type NewDomainEvent, type NotificationCategory, NotificationCategoryService, NotificationChannel, type NotificationTypeDeclaration, NotificationTypeRegistry, type ObjectStorage, OutboxAppender, OutboxMessage, OutboxRelay, OutboxStore, type PresignDownloadInput, type PresignedUpload, type PushDevice, type PushMessage, PushSender, RecurringJob, type RuntimeEventDefinition, ScheduledJob, Scheduler, type StoredNotification, type StoredObjectInfo, type TemplateContext, type TemplateRenderer, UnitOfWork, defineEvent, eventIdSchema, eventJsonValueSchema, eventMetadataSchema };
|
|
62
108
|
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -5,7 +5,8 @@ interface SettingsRecord {
|
|
|
5
5
|
value?: Record<string, unknown>;
|
|
6
6
|
}
|
|
7
7
|
declare enum SettingsNamespace {
|
|
8
|
-
content = "content"
|
|
8
|
+
content = "content",
|
|
9
|
+
organizations = "organizations"
|
|
9
10
|
}
|
|
10
11
|
interface SettingsRepository {
|
|
11
12
|
/** Rows for the given scopes, optionally narrowed to one namespace. */
|
package/dist/shared/settings.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/shared/settings.ts
|
|
2
2
|
let SettingsNamespace = /* @__PURE__ */ function(SettingsNamespace) {
|
|
3
3
|
SettingsNamespace["content"] = "content";
|
|
4
|
+
SettingsNamespace["organizations"] = "organizations";
|
|
4
5
|
return SettingsNamespace;
|
|
5
6
|
}({});
|
|
6
7
|
var SettingsService = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","names":[],"sources":["../../src/shared/settings.ts"],"sourcesContent":["// Cross-cutting settings: storage, scoping and resolution for every domain's\n// configuration. Not a bounded context: it is a leaf every context may import, and it imports\n// no context.\n\nexport interface SettingsRecord {\n namespace: string;\n scopeId: string;\n value?: Record<string, unknown>;\n}\n\nexport enum SettingsNamespace {\n content = 'content',\n}\n\nexport interface SettingsRepository {\n /** Rows for the given scopes, optionally narrowed to one namespace. */\n find(orgId: string, scopeId: string, namespace?: string): Promise<SettingsRecord[]>;\n /** Deep-merges the patch into the row's value, inserting when absent. Nested\n * objects merge key by key; arrays and scalars are replaced outright. */\n patch(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<SettingsRecord>;\n}\n\nexport class SettingsService {\n constructor(private readonly repo: SettingsRepository) {}\n\n async get<T>(\n orgId: string,\n namespace: string,\n scopeId: string,\n defaultIfNull?: T,\n ): Promise<T | undefined> {\n const rows = await this.repo.find(orgId, scopeId, namespace);\n return (rows[0]?.value as T) ?? defaultIfNull;\n }\n\n async patch<T>(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<T> {\n const row = await this.repo.patch(orgId, namespace, scopeId, value);\n return row.value as T;\n }\n}\n"],"mappings":";AAUA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,aAAA;;AACF,EAAA,CAAA,CAAA;AAUA,IAAa,kBAAb,MAA6B;CACE;CAA7B,YAAY,MAA2C;EAA1B,KAAA,OAAA;CAA2B;CAExD,MAAM,IACJ,OACA,WACA,SACA,eACwB;EAExB,QAAQ,MADW,KAAK,KAAK,KAAK,OAAO,SAAS,SAAS,EAAA,CAC9C,EAAE,EAAE,SAAe;CAClC;CAEA,MAAM,MAAS,OAAe,WAAmB,SAAiB,OAA4B;EAE5F,QAAO,MADW,KAAK,KAAK,MAAM,OAAO,WAAW,SAAS,KAAK,EAAA,CACvD;CACb;AACF"}
|
|
1
|
+
{"version":3,"file":"settings.js","names":[],"sources":["../../src/shared/settings.ts"],"sourcesContent":["// Cross-cutting settings: storage, scoping and resolution for every domain's\n// configuration. Not a bounded context: it is a leaf every context may import, and it imports\n// no context.\n\nexport interface SettingsRecord {\n namespace: string;\n scopeId: string;\n value?: Record<string, unknown>;\n}\n\nexport enum SettingsNamespace {\n content = 'content',\n organizations = 'organizations',\n}\n\nexport interface SettingsRepository {\n /** Rows for the given scopes, optionally narrowed to one namespace. */\n find(orgId: string, scopeId: string, namespace?: string): Promise<SettingsRecord[]>;\n /** Deep-merges the patch into the row's value, inserting when absent. Nested\n * objects merge key by key; arrays and scalars are replaced outright. */\n patch(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<SettingsRecord>;\n}\n\nexport class SettingsService {\n constructor(private readonly repo: SettingsRepository) {}\n\n async get<T>(\n orgId: string,\n namespace: string,\n scopeId: string,\n defaultIfNull?: T,\n ): Promise<T | undefined> {\n const rows = await this.repo.find(orgId, scopeId, namespace);\n return (rows[0]?.value as T) ?? defaultIfNull;\n }\n\n async patch<T>(orgId: string, namespace: string, scopeId: string, value: unknown): Promise<T> {\n const row = await this.repo.patch(orgId, namespace, scopeId, value);\n return row.value as T;\n }\n}\n"],"mappings":";AAUA,IAAY,oBAAL,yBAAA,mBAAA;CACL,kBAAA,aAAA;CACA,kBAAA,mBAAA;;AACF,EAAA,CAAA,CAAA;AAUA,IAAa,kBAAb,MAA6B;CACE;CAA7B,YAAY,MAA2C;EAA1B,KAAA,OAAA;CAA2B;CAExD,MAAM,IACJ,OACA,WACA,SACA,eACwB;EAExB,QAAQ,MADW,KAAK,KAAK,KAAK,OAAO,SAAS,SAAS,EAAA,CAC9C,EAAE,EAAE,SAAe;CAClC;CAEA,MAAM,MAAS,OAAe,WAAmB,SAAiB,OAA4B;EAE5F,QAAO,MADW,KAAK,KAAK,MAAM,OAAO,WAAW,SAAS,KAAK,EAAA,CACvD;CACb;AACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DomainEvent } from "./shared.js";
|
|
2
|
-
import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery,
|
|
2
|
+
import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
|
|
3
3
|
//#region src/types/automations.d.ts
|
|
4
4
|
interface AutomationDispatch {
|
|
5
5
|
runId: string;
|
|
@@ -8,6 +8,10 @@ interface AutomationDispatch {
|
|
|
8
8
|
actions: AutomationAction[];
|
|
9
9
|
event: DomainEvent;
|
|
10
10
|
}
|
|
11
|
+
interface DeliveryDispatch {
|
|
12
|
+
orgId: string;
|
|
13
|
+
deliveryId: string;
|
|
14
|
+
}
|
|
11
15
|
interface ScheduledAutomation {
|
|
12
16
|
orgId: string;
|
|
13
17
|
automationId: string;
|
|
@@ -16,12 +20,14 @@ interface ScheduledAutomation {
|
|
|
16
20
|
interface AutomationExecutor {
|
|
17
21
|
runAction(d: AutomationDispatch, index: number): Promise<AutomationActionResult>;
|
|
18
22
|
finalize(d: AutomationDispatch, results: AutomationActionResult[]): Promise<void>;
|
|
23
|
+
runDelivery(d: DeliveryDispatch, lastAttempt: boolean): Promise<void>;
|
|
19
24
|
listSchedules?(): Promise<ScheduledAutomation[]>;
|
|
20
25
|
fireSchedule?(orgId: string, automationId: string, firedAt: Date): Promise<void>;
|
|
21
26
|
}
|
|
22
27
|
interface AutomationEngine {
|
|
23
28
|
register(executor: AutomationExecutor): void;
|
|
24
29
|
dispatch(d: AutomationDispatch): Promise<void>;
|
|
30
|
+
deliver(d: DeliveryDispatch): Promise<void>;
|
|
25
31
|
start(): Promise<void>;
|
|
26
32
|
stop(): Promise<void>;
|
|
27
33
|
syncSchedules?(): Promise<void>;
|
|
@@ -38,5 +44,5 @@ interface WebhookSender {
|
|
|
38
44
|
send(request: WebhookRequest): Promise<WebhookResponse>;
|
|
39
45
|
}
|
|
40
46
|
//#endregion
|
|
41
|
-
export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type
|
|
47
|
+
export { type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type CreateAutomationInput, type CreateWebhookInput, type CreatedWebhook, type DeliverWebhookInput, DeliveryDispatch, ScheduledAutomation, type UpdateAutomationInput, type UpdateWebhookInput, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
|
|
42
48
|
//# sourceMappingURL=automations.d.ts.map
|
package/dist/types/content.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
|
|
2
|
-
export type { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput };
|
|
1
|
+
import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
|
|
2
|
+
export type { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Page } from "./shared.js";
|
|
2
2
|
import { Role } from "./schemas/organizations.js";
|
|
3
3
|
import "./organizations.js";
|
|
4
|
-
import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, FlaggedComment, ListCommentsQuery, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution,
|
|
4
|
+
import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, DigestRun, FlaggedComment, ListCommentsQuery, Mention, MentionItemType, MentionView, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution, PostReaction, PostStatus, PostView, ReactionCounts, ReactionEmoji, Subscription, SubscriptionItemType, SubscriptionState, SubscriptionView } from "./schemas/discussion.js";
|
|
5
5
|
//#region src/types/discussion.d.ts
|
|
6
6
|
interface Comment {
|
|
7
7
|
readonly id: string;
|
|
@@ -41,5 +41,5 @@ interface CommentReport {
|
|
|
41
41
|
updatedAt: Date;
|
|
42
42
|
}
|
|
43
43
|
//#endregion
|
|
44
|
-
export { type ActivityCommentsRule, type BlockedUser, type Chat, type ChatKind, type ChatLastMessage, type ChatStatus, type ChatUser, Comment, CommentAuthor, type CommentFlagResolution, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type FlaggedComment, type ListCommentsQuery, type Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Page, type Post, type PostBookmark, type PostFlag, type PostFlagResolution, type
|
|
44
|
+
export { type ActivityCommentsRule, type BlockedUser, type Chat, type ChatKind, type ChatLastMessage, type ChatStatus, type ChatUser, Comment, CommentAuthor, type CommentFlagResolution, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type DigestRun, type FlaggedComment, type ListCommentsQuery, type Mention, type MentionItemType, type MentionView, type Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Page, type Post, type PostBookmark, type PostFlag, type PostFlagResolution, type PostReaction, type PostStatus, type PostView, type ReactionCounts, type ReactionEmoji, type Subscription, type SubscriptionItemType, type SubscriptionState, type SubscriptionView };
|
|
45
45
|
//# sourceMappingURL=discussion.d.ts.map
|
|
@@ -39,7 +39,7 @@ interface EmailTemplateParams {
|
|
|
39
39
|
accessGranted: {
|
|
40
40
|
contentTitle: string;
|
|
41
41
|
contentId: string;
|
|
42
|
-
contentType: ContentType;
|
|
42
|
+
contentType: ContentType | 'bundle';
|
|
43
43
|
};
|
|
44
44
|
accessRevoked: {
|
|
45
45
|
contentTitle: string;
|
|
@@ -58,8 +58,10 @@ interface EmailTemplateParams {
|
|
|
58
58
|
expiresAt: string;
|
|
59
59
|
};
|
|
60
60
|
membershipEnded: {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
communities: {
|
|
62
|
+
communityId: string;
|
|
63
|
+
communityTitle: string;
|
|
64
|
+
}[];
|
|
63
65
|
};
|
|
64
66
|
newPostInSpace: {
|
|
65
67
|
spaceName: string;
|
|
@@ -142,6 +144,15 @@ interface EmailTemplateParams {
|
|
|
142
144
|
digest: {
|
|
143
145
|
communityTitle: string;
|
|
144
146
|
communityId: string;
|
|
147
|
+
from: string;
|
|
148
|
+
to: string;
|
|
149
|
+
posts: {
|
|
150
|
+
postId: string;
|
|
151
|
+
title: string;
|
|
152
|
+
authorName: string;
|
|
153
|
+
spaceName: string;
|
|
154
|
+
commentCount: number;
|
|
155
|
+
}[];
|
|
145
156
|
};
|
|
146
157
|
postAwaitingReview: {
|
|
147
158
|
spaceName: string;
|
|
@@ -168,6 +179,89 @@ interface EmailTemplateParams {
|
|
|
168
179
|
reason: string;
|
|
169
180
|
communityId: string;
|
|
170
181
|
};
|
|
182
|
+
postReacted: {
|
|
183
|
+
postTitle: string;
|
|
184
|
+
reactorName: string;
|
|
185
|
+
reaction: string;
|
|
186
|
+
postId: string;
|
|
187
|
+
communityId: string;
|
|
188
|
+
};
|
|
189
|
+
commentReacted: {
|
|
190
|
+
postTitle: string;
|
|
191
|
+
excerpt: string;
|
|
192
|
+
reactorName: string;
|
|
193
|
+
reaction: string;
|
|
194
|
+
commentId: string;
|
|
195
|
+
postId: string;
|
|
196
|
+
communityId: string;
|
|
197
|
+
};
|
|
198
|
+
mention: {
|
|
199
|
+
authorName: string;
|
|
200
|
+
excerpt: string;
|
|
201
|
+
communityId: string;
|
|
202
|
+
} & ({
|
|
203
|
+
postTitle: string;
|
|
204
|
+
postId: string;
|
|
205
|
+
commentId?: string;
|
|
206
|
+
} | {
|
|
207
|
+
chatTitle: string;
|
|
208
|
+
chatId: string;
|
|
209
|
+
});
|
|
210
|
+
messageReacted: {
|
|
211
|
+
excerpt: string;
|
|
212
|
+
reactorName: string;
|
|
213
|
+
reaction: string;
|
|
214
|
+
chatId: string;
|
|
215
|
+
communityId: string;
|
|
216
|
+
};
|
|
217
|
+
courseActivityAdded: {
|
|
218
|
+
courseTitle: string;
|
|
219
|
+
moduleTitle: string;
|
|
220
|
+
activityTitle: string;
|
|
221
|
+
courseId: string;
|
|
222
|
+
activityId: string;
|
|
223
|
+
};
|
|
224
|
+
activityCommentCreated: {
|
|
225
|
+
activityTitle: string;
|
|
226
|
+
courseTitle: string;
|
|
227
|
+
commenterName: string;
|
|
228
|
+
excerpt: string;
|
|
229
|
+
courseId: string;
|
|
230
|
+
activityId: string;
|
|
231
|
+
commentId: string;
|
|
232
|
+
};
|
|
233
|
+
activityCommentRemoved: {
|
|
234
|
+
activityTitle: string;
|
|
235
|
+
courseTitle: string;
|
|
236
|
+
courseId: string;
|
|
237
|
+
activityId: string;
|
|
238
|
+
};
|
|
239
|
+
activityCommentReacted: {
|
|
240
|
+
activityTitle: string;
|
|
241
|
+
courseTitle: string;
|
|
242
|
+
excerpt: string;
|
|
243
|
+
reactorName: string;
|
|
244
|
+
reaction: string;
|
|
245
|
+
courseId: string;
|
|
246
|
+
activityId: string;
|
|
247
|
+
commentId: string;
|
|
248
|
+
};
|
|
249
|
+
activityCommentFlagged: {
|
|
250
|
+
activityTitle: string;
|
|
251
|
+
courseTitle: string;
|
|
252
|
+
excerpt: string;
|
|
253
|
+
reason: string;
|
|
254
|
+
courseId: string;
|
|
255
|
+
activityId: string;
|
|
256
|
+
};
|
|
257
|
+
activityMention: {
|
|
258
|
+
authorName: string;
|
|
259
|
+
excerpt: string;
|
|
260
|
+
activityTitle: string;
|
|
261
|
+
courseTitle: string;
|
|
262
|
+
courseId: string;
|
|
263
|
+
activityId: string;
|
|
264
|
+
};
|
|
171
265
|
}
|
|
172
266
|
type EmailTemplateId = keyof EmailTemplateParams;
|
|
173
267
|
/** Resolves a template + data to rendered content. Deployment-swappable;
|
package/dist/types/identity.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateUserInput,
|
|
1
|
+
import { CreateUserInput, ProvisionUserInput, UpdateUserInput, UserProfile, UserProfileView } from "./schemas/identity.js";
|
|
2
2
|
//#region src/types/identity.d.ts
|
|
3
3
|
interface User {
|
|
4
4
|
readonly id: string;
|
|
@@ -79,5 +79,5 @@ interface AppAccessAdmin {
|
|
|
79
79
|
deleteApiKey(headers: HeaderBag, orgId: string, keyId: string): Promise<void>;
|
|
80
80
|
}
|
|
81
81
|
//#endregion
|
|
82
|
-
export { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, AppAccessAdmin, ConnectedApp, type CreateUserInput, CreatedApiKey, HeaderBag, NewApiKey, type
|
|
82
|
+
export { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, AppAccessAdmin, ConnectedApp, type CreateUserInput, CreatedApiKey, HeaderBag, NewApiKey, type ProvisionUserInput, SessionVerifier, type UpdateUserInput, User, UserId, type UserProfile, type UserProfileView };
|
|
83
83
|
//# sourceMappingURL=identity.d.ts.map
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ContractNewDomainEvent, DomainEvent, EventMetadata, JsonValue, NewDomainEvent, Page } from "./shared.js";
|
|
2
2
|
import { EventDefinition, EventParseResult, MakeEventInput } from "./events.js";
|
|
3
3
|
import { EmailMessage, EmailSender, Logger, ObjectStorage, PresignDownloadInput, PresignedUpload, StoredObjectInfo } from "./ports.js";
|
|
4
|
-
import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
|
|
4
|
+
import { Activity, ActivityAsset, ActivitySettings, ActivityView, AddDownloadAssetInput, AddSpaceLinkInput, Bundle, BundleItem, Community, CommunitySettings, CommunityStatus, CommunityView, ContentItem, ContentType, Course, CourseSettings, CourseStatus, CourseView, CreateBundleInput, CreateCommunityInput, CreateCourseInput, CreateDownloadInput, CreateSpaceInput, DigestCadence, DigestSchedule, DmSettings, Download, DownloadAsset, DownloadFile, DownloadStatus, DownloadView, ListBundlesQuery, ListCommunitiesQuery, ListCoursesQuery, ListDownloadsQuery, Module, PatchCommunitySettingsInput, PatchDmSettingsInput, ReorderDownloadAssetsInput, SaveActivityInput, SetSpaceTopicsInput, Space, SpaceAccessRule, SpaceDetail, SpaceLink, SpaceSettings, SpaceTopic, UpdateBundleInput, UpdateCommunityInput, UpdateCourseInput, UpdateDownloadInput, UpdateSpaceInput } from "./schemas/content.js";
|
|
5
5
|
import { EmailContent, EmailTemplateId, EmailTemplateParams, TemplateContext, TemplateRenderer } from "./email-templates.js";
|
|
6
|
-
import { CreateUserInput,
|
|
6
|
+
import { CreateUserInput, ProvisionUserInput, UpdateUserInput, UserProfile, UserProfileView } from "./schemas/identity.js";
|
|
7
7
|
import { AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, ActiveSession, ApiKeySummary, AppAccessAdmin, ConnectedApp, CreatedApiKey, HeaderBag, NewApiKey, SessionVerifier, User, UserId } from "./identity.js";
|
|
8
8
|
import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role, UpdateOrgUserInput } from "./schemas/organizations.js";
|
|
9
9
|
import { CreateOrganizationInput, InviteId, OrgUserId, OrganizationId } from "./organizations.js";
|
|
@@ -16,8 +16,9 @@ import { Asset, AssetKind, AssetSource, AssetStatus, AssetUrls, AssetView, Asset
|
|
|
16
16
|
import "./assets.js";
|
|
17
17
|
import { ConfigureInput, ConnectInput, Connection, Validation } from "./schemas/integrations.js";
|
|
18
18
|
import { Action, ActionContext, Integration } from "./integrations.js";
|
|
19
|
-
import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery,
|
|
20
|
-
import { AutomationDispatch, AutomationEngine, AutomationExecutor, ScheduledAutomation, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
|
|
21
|
-
import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, FlaggedComment, ListCommentsQuery, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution,
|
|
19
|
+
import { Automation, AutomationAction, AutomationActionResult, AutomationKind, AutomationRun, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AutomationsQuery, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, CreateWebhookInput, CreatedWebhook, DeliverWebhookInput, UpdateAutomationInput, UpdateWebhookInput, Webhook, WebhookSecret } from "./schemas/automations.js";
|
|
20
|
+
import { AutomationDispatch, AutomationEngine, AutomationExecutor, DeliveryDispatch, ScheduledAutomation, WebhookRequest, WebhookResponse, WebhookSender } from "./automations.js";
|
|
21
|
+
import { ActivityCommentsRule, BlockedUser, Chat, ChatKind, ChatLastMessage, ChatStatus, ChatUser, CommentFlagResolution, CommentListItem, CommentReaction, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, DigestRun, FlaggedComment, ListCommentsQuery, Mention, MentionItemType, MentionView, Message, MessageAttachment, MessageFile, MessageFlag, MessageFlagResolution, MessageReaction, MessageView, Post, PostBookmark, PostFlag, PostFlagResolution, PostReaction, PostStatus, PostView, ReactionCounts, ReactionEmoji, Subscription, SubscriptionItemType, SubscriptionState, SubscriptionView } from "./schemas/discussion.js";
|
|
22
22
|
import { Comment, CommentAuthor, CommentReport } from "./discussion.js";
|
|
23
|
-
|
|
23
|
+
import { ChannelRecipient, Delivery, DeliveryResult, DeliveryStatus, DeviceView, NotificationCategory, NotificationFilter, NotificationTypeDeclaration, PushConfig, PushDevice, PushMessage, PushProvider, Reason, RecipientList, Scope, SettingsScope, StoredNotification, StoredSetting, SubjectRef } from "./notifications.js";
|
|
24
|
+
export { type AcceptInviteInput, AccessGrant, AccessRequest, AccessTokenVerifier, AccountProvisioner, Action, ActionContext, ActiveSession, type Activity, type ActivityAsset, type ActivityCommentsRule, type ActivitySettings, type ActivityView, type AddDownloadAssetInput, type AddOrgUserInput, type AddSpaceLinkInput, ApiKeySummary, AppAccessAdmin, type Asset, type AssetKind, type AssetSource, type AssetStatus, type AssetUrls, type AssetView, type AssetsQuery, type Automation, type AutomationAction, type AutomationActionResult, AutomationDispatch, AutomationEngine, AutomationExecutor, type AutomationKind, type AutomationRun, type AutomationRunStatus, type AutomationRunsQuery, type AutomationTrigger, type AutomationsQuery, type AvailableAction, type AvailableActions, type AvailableTriggers, type BlockedUser, type Bundle, type BundleItem, ChannelRecipient, type Chat, type ChatKind, type ChatLastMessage, type ChatStatus, type ChatUser, Comment, CommentAuthor, type CommentFlagResolution, type CommentListItem, type CommentReaction, CommentReport, type CommentReportSummary, type CommentSettings, type CommentStatus, type CommentView, type CommentsConfig, type Community, type CommunitySettings, type CommunityStatus, type CommunityView, type ConfigureInput, type ConnectInput, ConnectedApp, type Connection, type ContentItem, type ContentType, ContractNewDomainEvent, type Course, type CourseSettings, type CourseStatus, type CourseView, type CreateAutomationInput, type CreateBundleInput, type CreateCommunityInput, type CreateCourseInput, type CreateDownloadInput, type CreateInviteInput, type CreateOrgUserInput, CreateOrganizationInput, type CreateSpaceInput, type CreateUserInput, type CreateWebhookInput, CreatedApiKey, type CreatedWebhook, type DeliverWebhookInput, Delivery, DeliveryDispatch, DeliveryResult, DeliveryStatus, DeviceView, type DigestCadence, type DigestRun, type DigestSchedule, type DmSettings, DomainEvent, type Download, type DownloadAsset, type DownloadFile, type DownloadStatus, type DownloadView, EmailContent, EmailMessage, EmailSender, EmailTemplateId, EmailTemplateParams, type Entitlement, type EntitlementStatus, type EntitlementsQuery, EventDefinition, EventMetadata, EventParseResult, type FlaggedComment, type GrantEntitlementInput, HeaderBag, Integration, type Invite, InviteId, type InviteInput, type InviteRole, JsonValue, type ListBundlesQuery, type ListCommentsQuery, type ListCommunitiesQuery, type ListCoursesQuery, type ListDownloadsQuery, Logger, MakeEventInput, type Mention, type MentionItemType, type MentionView, type Message, type MessageAttachment, type MessageFile, type MessageFlag, type MessageFlagResolution, type MessageReaction, type MessageView, type Module, NewApiKey, NewDomainEvent, type NewOrganizationInput, NotificationCategory, NotificationFilter, NotificationTypeDeclaration, ObjectStorage, type OrgUser, OrgUserId, type OrgUserInput, type OrgUserProfile, type OrgUserStatus, type Organization, OrganizationId, type OrganizationInput, Page, type PatchCommunitySettingsInput, type PatchDmSettingsInput, type Post, type PostBookmark, type PostFlag, type PostFlagResolution, type PostReaction, type PostStatus, type PostView, PresignDownloadInput, PresignedUpload, ProgressId, type ProgressRecord, type ProgressRecordInput, type ProgressReportItem, type ProgressTarget, type ProgressTargetType, type ProvisionUserInput, PushConfig, PushDevice, PushMessage, PushProvider, type ReactionCounts, type ReactionEmoji, Reason, RecipientList, type ReorderDownloadAssetsInput, type ReportProgressInput, type RequestUploadInput, type Role, type SaveActivityInput, ScheduledAutomation, Scope, SessionVerifier, type SetSpaceTopicsInput, SettingsScope, type Space, type SpaceAccessRule, type SpaceDetail, type SpaceLink, type SpaceMember, type SpaceMemberSource, type SpaceMemberStatus, type SpaceSettings, type SpaceTopic, StoredNotification, StoredObjectInfo, StoredSetting, SubjectRef, type Subscription, type SubscriptionItemType, type SubscriptionState, type SubscriptionView, TemplateContext, TemplateRenderer, type UpdateAutomationInput, type UpdateBundleInput, type UpdateCommunityInput, type UpdateCourseInput, type UpdateDownloadInput, type UpdateOrgUserInput, type UpdateSpaceInput, type UpdateUserInput, type UpdateWebhookInput, type UploadTicket, User, UserId, type UserProfile, type UserProfileView, type Validation, type Webhook, WebhookRequest, WebhookResponse, type WebhookSecret, WebhookSender };
|