@headless-lms/core 0.2.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.
Files changed (307) hide show
  1. package/dist/assets/events.d.ts +42 -24
  2. package/dist/assets/events.js +1 -1
  3. package/dist/assets/events.js.map +1 -1
  4. package/dist/assets/file-urls.d.ts +20 -0
  5. package/dist/assets/file-urls.js +25 -0
  6. package/dist/assets/file-urls.js.map +1 -0
  7. package/dist/assets/index.d.ts +6 -4
  8. package/dist/assets/index.js +4 -2
  9. package/dist/assets/jobs.d.ts +15 -0
  10. package/dist/assets/jobs.js +30 -0
  11. package/dist/assets/jobs.js.map +1 -0
  12. package/dist/assets/model.d.ts +2 -2
  13. package/dist/assets/ports.d.ts +46 -15
  14. package/dist/assets/service.d.ts +38 -7
  15. package/dist/assets/service.js +287 -38
  16. package/dist/assets/service.js.map +1 -1
  17. package/dist/automations/actions.d.ts +13 -24
  18. package/dist/automations/actions.js +106 -42
  19. package/dist/automations/actions.js.map +1 -1
  20. package/dist/automations/catalog.js +226 -3
  21. package/dist/automations/catalog.js.map +1 -1
  22. package/dist/automations/community-derivations.d.ts +14 -0
  23. package/dist/automations/community-derivations.js +439 -0
  24. package/dist/automations/community-derivations.js.map +1 -0
  25. package/dist/automations/community-mail.d.ts +98 -0
  26. package/dist/automations/community-mail.js +70 -0
  27. package/dist/automations/community-mail.js.map +1 -0
  28. package/dist/automations/events.d.ts +18 -0
  29. package/dist/automations/index.d.ts +13 -4
  30. package/dist/automations/index.js +10 -2
  31. package/dist/automations/model.d.ts +10 -3
  32. package/dist/automations/model.js +15 -2
  33. package/dist/automations/model.js.map +1 -1
  34. package/dist/automations/notifications/debounce.d.ts +25 -0
  35. package/dist/automations/notifications/debounce.js +93 -0
  36. package/dist/automations/notifications/debounce.js.map +1 -0
  37. package/dist/automations/notifications/defaults.d.ts +8 -0
  38. package/dist/automations/notifications/defaults.js +316 -0
  39. package/dist/automations/notifications/defaults.js.map +1 -0
  40. package/dist/automations/notifications/delivery.d.ts +28 -0
  41. package/dist/automations/notifications/delivery.js +88 -0
  42. package/dist/automations/notifications/delivery.js.map +1 -0
  43. package/dist/automations/notifications/processor.d.ts +64 -0
  44. package/dist/automations/notifications/processor.js +270 -0
  45. package/dist/automations/notifications/processor.js.map +1 -0
  46. package/dist/automations/notifications/rules/content.d.ts +6 -0
  47. package/dist/automations/notifications/rules/content.js +39 -0
  48. package/dist/automations/notifications/rules/content.js.map +1 -0
  49. package/dist/automations/notifications/rules/discussion.d.ts +7 -0
  50. package/dist/automations/notifications/rules/discussion.js +678 -0
  51. package/dist/automations/notifications/rules/discussion.js.map +1 -0
  52. package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
  53. package/dist/automations/notifications/rules/entitlements.js +249 -0
  54. package/dist/automations/notifications/rules/entitlements.js.map +1 -0
  55. package/dist/automations/notifications/rules/index.d.ts +6 -0
  56. package/dist/automations/notifications/rules/index.js +15 -0
  57. package/dist/automations/notifications/rules/index.js.map +1 -0
  58. package/dist/automations/notifications/rules/organizations.d.ts +6 -0
  59. package/dist/automations/notifications/rules/organizations.js +28 -0
  60. package/dist/automations/notifications/rules/organizations.js.map +1 -0
  61. package/dist/automations/notifications/rules/recipients.d.ts +32 -0
  62. package/dist/automations/notifications/rules/recipients.js +99 -0
  63. package/dist/automations/notifications/rules/recipients.js.map +1 -0
  64. package/dist/automations/notifications/service.d.ts +27 -0
  65. package/dist/automations/notifications/service.js +45 -0
  66. package/dist/automations/notifications/service.js.map +1 -0
  67. package/dist/automations/notifications/types.d.ts +7 -0
  68. package/dist/automations/notifications/types.js +473 -0
  69. package/dist/automations/notifications/types.js.map +1 -0
  70. package/dist/automations/ports.d.ts +121 -3
  71. package/dist/automations/schedule.d.ts +6 -0
  72. package/dist/automations/schedule.js +41 -0
  73. package/dist/automations/schedule.js.map +1 -0
  74. package/dist/automations/service.d.ts +20 -4
  75. package/dist/automations/service.js +246 -45
  76. package/dist/automations/service.js.map +1 -1
  77. package/dist/content/events.d.ts +712 -50
  78. package/dist/content/events.js +55 -1
  79. package/dist/content/events.js.map +1 -1
  80. package/dist/content/index.d.ts +6 -4
  81. package/dist/content/index.js +3 -1
  82. package/dist/content/model.d.ts +2 -2
  83. package/dist/content/notification-categories.d.ts +36 -0
  84. package/dist/content/notification-categories.js +64 -0
  85. package/dist/content/notification-categories.js.map +1 -0
  86. package/dist/content/ports.d.ts +90 -18
  87. package/dist/content/service.d.ts +57 -18
  88. package/dist/content/service.js +520 -25
  89. package/dist/content/service.js.map +1 -1
  90. package/dist/content/titles.d.ts +22 -0
  91. package/dist/content/titles.js +69 -0
  92. package/dist/content/titles.js.map +1 -0
  93. package/dist/content/types.d.ts +2 -2
  94. package/dist/discussion/authors.d.ts +10 -0
  95. package/dist/discussion/authors.js +23 -0
  96. package/dist/discussion/authors.js.map +1 -0
  97. package/dist/discussion/chats.d.ts +109 -0
  98. package/dist/discussion/chats.js +831 -0
  99. package/dist/discussion/chats.js.map +1 -0
  100. package/dist/discussion/digests.d.ts +24 -0
  101. package/dist/discussion/digests.js +104 -0
  102. package/dist/discussion/digests.js.map +1 -0
  103. package/dist/discussion/events.d.ts +785 -56
  104. package/dist/discussion/events.js +165 -5
  105. package/dist/discussion/events.js.map +1 -1
  106. package/dist/discussion/index.d.ts +12 -3
  107. package/dist/discussion/index.js +9 -1
  108. package/dist/discussion/jobs.d.ts +16 -0
  109. package/dist/discussion/jobs.js +40 -0
  110. package/dist/discussion/jobs.js.map +1 -0
  111. package/dist/discussion/mentions.d.ts +11 -0
  112. package/dist/discussion/mentions.js +35 -0
  113. package/dist/discussion/mentions.js.map +1 -0
  114. package/dist/discussion/ports.d.ts +372 -28
  115. package/dist/discussion/ports.js +6 -1
  116. package/dist/discussion/ports.js.map +1 -0
  117. package/dist/discussion/posts.d.ts +113 -0
  118. package/dist/discussion/posts.js +775 -0
  119. package/dist/discussion/posts.js.map +1 -0
  120. package/dist/discussion/service.d.ts +42 -11
  121. package/dist/discussion/service.js +364 -85
  122. package/dist/discussion/service.js.map +1 -1
  123. package/dist/discussion/subscriptions.d.ts +37 -0
  124. package/dist/discussion/subscriptions.js +99 -0
  125. package/dist/discussion/subscriptions.js.map +1 -0
  126. package/dist/discussion/titles.d.ts +26 -0
  127. package/dist/discussion/titles.js +84 -0
  128. package/dist/discussion/titles.js.map +1 -0
  129. package/dist/entitlements/events.d.ts +178 -11
  130. package/dist/entitlements/events.js +28 -1
  131. package/dist/entitlements/events.js.map +1 -1
  132. package/dist/entitlements/index.d.ts +6 -4
  133. package/dist/entitlements/index.js +3 -1
  134. package/dist/entitlements/jobs.d.ts +12 -0
  135. package/dist/entitlements/jobs.js +18 -0
  136. package/dist/entitlements/jobs.js.map +1 -0
  137. package/dist/entitlements/model.d.ts +3 -2
  138. package/dist/entitlements/ports.d.ts +128 -11
  139. package/dist/entitlements/rules.d.ts +12 -0
  140. package/dist/entitlements/rules.js +17 -0
  141. package/dist/entitlements/rules.js.map +1 -0
  142. package/dist/entitlements/service.d.ts +57 -3
  143. package/dist/entitlements/service.js +492 -2
  144. package/dist/entitlements/service.js.map +1 -1
  145. package/dist/identity/access.d.ts +6 -0
  146. package/dist/identity/access.js +7 -0
  147. package/dist/identity/access.js.map +1 -0
  148. package/dist/identity/devices.d.ts +30 -0
  149. package/dist/identity/devices.js +107 -0
  150. package/dist/identity/devices.js.map +1 -0
  151. package/dist/identity/events.d.ts +2 -2
  152. package/dist/identity/index.d.ts +7 -4
  153. package/dist/identity/index.js +4 -1
  154. package/dist/identity/model.d.ts +2 -1
  155. package/dist/identity/notification-settings.d.ts +28 -0
  156. package/dist/identity/notification-settings.js +113 -0
  157. package/dist/identity/notification-settings.js.map +1 -0
  158. package/dist/identity/ports.d.ts +97 -3
  159. package/dist/identity/service.d.ts +14 -3
  160. package/dist/identity/service.js +62 -5
  161. package/dist/identity/service.js.map +1 -1
  162. package/dist/integrations/events.d.ts +3 -3
  163. package/dist/integrations/model.js +1 -1
  164. package/dist/integrations/model.js.map +1 -1
  165. package/dist/integrations/service.js +2 -2
  166. package/dist/integrations/service.js.map +1 -1
  167. package/dist/organizations/access-scopes.d.ts +19 -0
  168. package/dist/organizations/access-scopes.js +89 -0
  169. package/dist/organizations/access-scopes.js.map +1 -0
  170. package/dist/organizations/events.d.ts +75 -33
  171. package/dist/organizations/events.js +6 -0
  172. package/dist/organizations/events.js.map +1 -1
  173. package/dist/organizations/index.d.ts +8 -6
  174. package/dist/organizations/index.js +5 -3
  175. package/dist/organizations/members.d.ts +8 -5
  176. package/dist/organizations/members.js.map +1 -1
  177. package/dist/organizations/notification-categories.d.ts +32 -0
  178. package/dist/organizations/notification-categories.js +51 -0
  179. package/dist/organizations/notification-categories.js.map +1 -0
  180. package/dist/organizations/ports.d.ts +17 -11
  181. package/dist/organizations/roles.d.ts +6 -10
  182. package/dist/organizations/roles.js +19 -7
  183. package/dist/organizations/roles.js.map +1 -1
  184. package/dist/organizations/service.d.ts +22 -11
  185. package/dist/organizations/service.js +164 -47
  186. package/dist/organizations/service.js.map +1 -1
  187. package/dist/organizations/types.d.ts +1 -10
  188. package/dist/progress/events.d.ts +14 -14
  189. package/dist/progress/index.d.ts +2 -2
  190. package/dist/progress/ports.d.ts +6 -1
  191. package/dist/progress/service.d.ts +3 -1
  192. package/dist/progress/service.js +6 -2
  193. package/dist/progress/service.js.map +1 -1
  194. package/dist/reporting/admin/index.d.ts +4 -0
  195. package/dist/reporting/admin/index.js +2 -0
  196. package/dist/reporting/admin/model.d.ts +108 -0
  197. package/dist/reporting/admin/ports.d.ts +27 -0
  198. package/dist/reporting/admin/service.d.ts +22 -0
  199. package/dist/reporting/admin/service.js +38 -0
  200. package/dist/reporting/admin/service.js.map +1 -0
  201. package/dist/reporting/member/index.d.ts +5 -0
  202. package/dist/reporting/member/index.js +2 -0
  203. package/dist/reporting/member/model.d.ts +157 -0
  204. package/dist/reporting/member/ports.d.ts +48 -0
  205. package/dist/reporting/member/service.d.ts +92 -0
  206. package/dist/reporting/member/service.js +364 -0
  207. package/dist/reporting/member/service.js.map +1 -0
  208. package/dist/shared/actor.d.ts +9 -0
  209. package/dist/shared/errors.d.ts +19 -1
  210. package/dist/shared/errors.js +27 -1
  211. package/dist/shared/errors.js.map +1 -1
  212. package/dist/shared/id.d.ts +14 -0
  213. package/dist/shared/id.js +15 -1
  214. package/dist/shared/id.js.map +1 -1
  215. package/dist/shared/mailer.d.ts +15 -2
  216. package/dist/shared/mailer.js +32 -5
  217. package/dist/shared/mailer.js.map +1 -1
  218. package/dist/shared/network.d.ts +10 -0
  219. package/dist/shared/network.js +211 -0
  220. package/dist/shared/network.js.map +1 -0
  221. package/dist/shared/notification-categories.d.ts +16 -0
  222. package/dist/shared/notification-categories.js +94 -0
  223. package/dist/shared/notification-categories.js.map +1 -0
  224. package/dist/shared/notification-settings.d.ts +14 -0
  225. package/dist/shared/notification-settings.js +61 -0
  226. package/dist/shared/notification-settings.js.map +1 -0
  227. package/dist/shared/ports.d.ts +48 -2
  228. package/dist/shared/settings.d.ts +2 -1
  229. package/dist/shared/settings.js +1 -0
  230. package/dist/shared/settings.js.map +1 -1
  231. package/dist/types/assets.d.ts +2 -2
  232. package/dist/types/automations.d.ts +15 -1
  233. package/dist/types/content.d.ts +2 -2
  234. package/dist/types/discussion.d.ts +11 -3
  235. package/dist/types/email-templates.d.ts +216 -1
  236. package/dist/types/entitlements.d.ts +2 -2
  237. package/dist/types/identity.d.ts +48 -2
  238. package/dist/types/index.d.ts +9 -8
  239. package/dist/types/notifications.d.ts +157 -0
  240. package/dist/types/ports.d.ts +6 -0
  241. package/dist/types/schemas/assets.d.ts +65 -37
  242. package/dist/types/schemas/assets.js +17 -12
  243. package/dist/types/schemas/assets.js.map +1 -1
  244. package/dist/types/schemas/automations.d.ts +9 -1
  245. package/dist/types/schemas/automations.js +13 -6
  246. package/dist/types/schemas/automations.js.map +1 -1
  247. package/dist/types/schemas/content.d.ts +396 -3
  248. package/dist/types/schemas/content.js +161 -3
  249. package/dist/types/schemas/content.js.map +1 -1
  250. package/dist/types/schemas/discussion.d.ts +443 -3
  251. package/dist/types/schemas/discussion.js +233 -4
  252. package/dist/types/schemas/discussion.js.map +1 -1
  253. package/dist/types/schemas/entitlements.d.ts +36 -2
  254. package/dist/types/schemas/entitlements.js +23 -1
  255. package/dist/types/schemas/entitlements.js.map +1 -1
  256. package/dist/types/schemas/identity.d.ts +27 -1
  257. package/dist/types/schemas/identity.js +14 -2
  258. package/dist/types/schemas/identity.js.map +1 -1
  259. package/dist/types/schemas/index.d.ts +9 -8
  260. package/dist/types/schemas/index.js +9 -8
  261. package/dist/types/schemas/notifications.d.ts +95 -0
  262. package/dist/types/schemas/notifications.js +56 -0
  263. package/dist/types/schemas/notifications.js.map +1 -0
  264. package/dist/types/schemas/organizations.d.ts +8 -0
  265. package/dist/types/schemas/organizations.js +2 -0
  266. package/dist/types/schemas/organizations.js.map +1 -1
  267. package/dist/types/schemas/progress.d.ts +3 -3
  268. package/dist/types/schemas/shared.d.ts +3 -1
  269. package/dist/types/schemas/shared.js +5 -1
  270. package/dist/types/schemas/shared.js.map +1 -1
  271. package/package.json +2 -2
  272. package/dist/reporting/courses/index.d.ts +0 -4
  273. package/dist/reporting/courses/index.js +0 -2
  274. package/dist/reporting/courses/model.d.ts +0 -24
  275. package/dist/reporting/courses/ports.d.ts +0 -13
  276. package/dist/reporting/courses/service.d.ts +0 -19
  277. package/dist/reporting/courses/service.js +0 -20
  278. package/dist/reporting/courses/service.js.map +0 -1
  279. package/dist/reporting/dashboard/index.d.ts +0 -4
  280. package/dist/reporting/dashboard/index.js +0 -2
  281. package/dist/reporting/dashboard/model.d.ts +0 -14
  282. package/dist/reporting/dashboard/ports.d.ts +0 -13
  283. package/dist/reporting/dashboard/service.d.ts +0 -19
  284. package/dist/reporting/dashboard/service.js +0 -20
  285. package/dist/reporting/dashboard/service.js.map +0 -1
  286. package/dist/reporting/learn/index.d.ts +0 -5
  287. package/dist/reporting/learn/index.js +0 -2
  288. package/dist/reporting/learn/model.d.ts +0 -23
  289. package/dist/reporting/learn/ports.d.ts +0 -43
  290. package/dist/reporting/learn/service.d.ts +0 -49
  291. package/dist/reporting/learn/service.js +0 -116
  292. package/dist/reporting/learn/service.js.map +0 -1
  293. package/dist/reporting/students/index.d.ts +0 -4
  294. package/dist/reporting/students/index.js +0 -2
  295. package/dist/reporting/students/model.d.ts +0 -51
  296. package/dist/reporting/students/model.js +0 -1
  297. package/dist/reporting/students/ports.d.ts +0 -15
  298. package/dist/reporting/students/ports.js +0 -1
  299. package/dist/reporting/students/service.d.ts +0 -20
  300. package/dist/reporting/students/service.js +0 -23
  301. package/dist/reporting/students/service.js.map +0 -1
  302. /package/dist/reporting/{courses → admin}/model.js +0 -0
  303. /package/dist/reporting/{courses → admin}/ports.js +0 -0
  304. /package/dist/reporting/{dashboard → member}/model.js +0 -0
  305. /package/dist/reporting/{dashboard → member}/ports.js +0 -0
  306. /package/dist/{reporting/learn/model.js → shared/actor.js} +0 -0
  307. /package/dist/{reporting/learn/ports.js → types/notifications.js} +0 -0
@@ -1,14 +1,15 @@
1
- import { domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema } from "./shared.js";
2
- import { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema } from "./identity.js";
1
+ import { boundedJsonSchema, domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema } from "./shared.js";
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, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema } from "./discussion.js";
5
- import { activityAssetSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, bundleItemSchema, bundleSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, createBundleInputSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listBundlesQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateBundleInputSchema, updateCourseInputSchema, updateDownloadInputSchema } from "./content.js";
6
- import { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema } from "./entitlements.js";
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
+ 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, 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
+ import { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema } from "./entitlements.js";
7
8
  import { progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, reportProgressInputSchema } from "./progress.js";
8
- import { assetKindSchema, assetSchema, assetStatusSchema, assetsQuerySchema, downloadTicketSchema, requestUploadInputSchema, uploadTicketSchema } from "./assets.js";
9
9
  import { configureInputSchema, connectInputSchema, connectionSchema, validationSchema } from "./integrations.js";
10
- import { automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, automationTriggersSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, createWebhookInputSchema, createdWebhookSchema, deliverWebhookInputSchema, updateAutomationInputSchema, updateWebhookInputSchema, webhookSchema, webhookSecretSchema, webhookUrlSchema } from "./automations.js";
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
- export { acceptInviteInputSchema, activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, addOrgUserInputSchema, assetKindSchema, assetSchema, assetStatusSchema, assetsQuerySchema, automationActionResultSchema, automationActionSchema, automationKindSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, automationTriggersSchema, automationsQuerySchema, availableActionSchema, availableTriggersSchema, bundleItemSchema, bundleSchema, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, configureInputSchema, connectInputSchema, connectionSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, createAutomationInputSchema, createBundleInputSchema, createCourseInputSchema, createDownloadInputSchema, createInviteInputSchema, createOrgUserInputSchema, createUserInputSchema, createWebhookInputSchema, createdWebhookSchema, credentialSchema, deliverWebhookInputSchema, domainEventSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, downloadTicketSchema, emailSchema, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, eventMetadataSchema, eventOutboxSchema, grantEntitlementInputSchema, idSchema, inviteRoleSchema, inviteSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, listBundlesQuerySchema, listCommentsQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, newOrganizationInputSchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, provisionUserInputSchema, reactionCountsSchema, reactionEmojiSchema, reorderDownloadAssetsInputSchema, reportProgressInputSchema, requestUploadInputSchema, roleSchema, saveActivityInputSchema, serializableDateSchema, settingSchema, updateAutomationInputSchema, updateBundleInputSchema, updateCourseInputSchema, updateDownloadInputSchema, updateOrgUserInputSchema, updateUserInputSchema, updateWebhookInputSchema, uploadTicketSchema, userSchema, validationSchema, webhookSchema, webhookSecretSchema, webhookUrlSchema };
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"}
@@ -4,6 +4,7 @@ declare const roleSchema: z.ZodEnum<{
4
4
  owner: "owner";
5
5
  admin: "admin";
6
6
  instructor: "instructor";
7
+ moderator: "moderator";
7
8
  student: "student";
8
9
  }>;
9
10
  type Role = z.infer<typeof roleSchema>;
@@ -15,6 +16,7 @@ type OrgUserStatus = z.infer<typeof orgUserStatusSchema>;
15
16
  declare const inviteRoleSchema: z.ZodEnum<{
16
17
  admin: "admin";
17
18
  instructor: "instructor";
19
+ moderator: "moderator";
18
20
  student: "student";
19
21
  }>;
20
22
  type InviteRole = z.infer<typeof inviteRoleSchema>;
@@ -37,6 +39,7 @@ declare const orgUserSchema: z.ZodObject<{
37
39
  owner: "owner";
38
40
  admin: "admin";
39
41
  instructor: "instructor";
42
+ moderator: "moderator";
40
43
  student: "student";
41
44
  }>;
42
45
  status: z.ZodEnum<{
@@ -63,6 +66,7 @@ declare const inviteSchema: z.ZodObject<{
63
66
  role: z.ZodEnum<{
64
67
  admin: "admin";
65
68
  instructor: "instructor";
69
+ moderator: "moderator";
66
70
  student: "student";
67
71
  }>;
68
72
  status: z.ZodEnum<{
@@ -92,6 +96,7 @@ declare const addOrgUserInputSchema: z.ZodObject<{
92
96
  owner: "owner";
93
97
  admin: "admin";
94
98
  instructor: "instructor";
99
+ moderator: "moderator";
95
100
  student: "student";
96
101
  }>;
97
102
  }, z.core.$strict>;
@@ -103,6 +108,7 @@ declare const createOrgUserInputSchema: z.ZodObject<{
103
108
  owner: "owner";
104
109
  admin: "admin";
105
110
  instructor: "instructor";
111
+ moderator: "moderator";
106
112
  student: "student";
107
113
  }>;
108
114
  status: z.ZodOptional<z.ZodEnum<{
@@ -116,6 +122,7 @@ declare const updateOrgUserInputSchema: z.ZodObject<{
116
122
  owner: "owner";
117
123
  admin: "admin";
118
124
  instructor: "instructor";
125
+ moderator: "moderator";
119
126
  student: "student";
120
127
  }>>;
121
128
  status: z.ZodOptional<z.ZodEnum<{
@@ -130,6 +137,7 @@ declare const createInviteInputSchema: z.ZodObject<{
130
137
  role: z.ZodEnum<{
131
138
  admin: "admin";
132
139
  instructor: "instructor";
140
+ moderator: "moderator";
133
141
  student: "student";
134
142
  }>;
135
143
  inviterUserId: z.ZodString;
@@ -5,12 +5,14 @@ const roleSchema = z.enum([
5
5
  "owner",
6
6
  "admin",
7
7
  "instructor",
8
+ "moderator",
8
9
  "student"
9
10
  ]);
10
11
  const orgUserStatusSchema = z.enum(["invited", "active"]);
11
12
  const inviteRoleSchema = z.enum([
12
13
  "admin",
13
14
  "instructor",
15
+ "moderator",
14
16
  "student"
15
17
  ]);
16
18
  const organizationSchema = z.object({
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.js","names":[],"sources":["../../../src/types/schemas/organizations.ts"],"sourcesContent":["import { z } from 'zod';\nimport { idSchema, emailSchema } from './shared.js';\n\nexport const roleSchema = z.enum(['owner', 'admin', 'instructor', 'student']);\nexport type Role = z.infer<typeof roleSchema>;\n\nexport const orgUserStatusSchema = z.enum(['invited', 'active']);\nexport type OrgUserStatus = z.infer<typeof orgUserStatusSchema>;\n\nexport const inviteRoleSchema = z.enum(['admin', 'instructor', 'student']);\nexport type InviteRole = z.infer<typeof inviteRoleSchema>;\n\nexport const organizationSchema = z\n .object({\n id: idSchema,\n externalId: idSchema.nullable(),\n name: z.string(),\n slug: z.string(),\n ownerId: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Organization = z.output<typeof organizationSchema>;\nexport type OrganizationInput = z.input<typeof organizationSchema>;\n\nexport const orgUserSchema = z\n .object({\n id: idSchema,\n orgId: idSchema,\n userId: idSchema,\n role: roleSchema,\n status: orgUserStatusSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type OrgUser = z.output<typeof orgUserSchema>;\nexport type OrgUserInput = z.input<typeof orgUserSchema>;\n\nexport const orgUserProfileSchema = z\n .object({\n id: idSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n email: emailSchema,\n image: z.string().nullable(),\n })\n .strict();\nexport type OrgUserProfile = z.infer<typeof orgUserProfileSchema>;\n\nexport const inviteSchema = z\n .object({\n id: idSchema,\n orgId: idSchema,\n email: emailSchema,\n role: inviteRoleSchema,\n status: z.enum(['pending', 'accepted', 'rejected', 'canceled']),\n invitedBy: idSchema,\n tokenHash: z.string().nullable(),\n expiresAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Invite = z.output<typeof inviteSchema>;\nexport type InviteInput = z.input<typeof inviteSchema>;\n\nexport const newOrganizationInputSchema = z\n .object({\n name: z.string(),\n slug: z.string(),\n logo: z.string().optional(),\n })\n .strict();\nexport type NewOrganizationInput = z.infer<typeof newOrganizationInputSchema>;\n\nexport const addOrgUserInputSchema = z\n .object({\n orgId: idSchema,\n userId: idSchema,\n role: roleSchema,\n })\n .strict();\nexport type AddOrgUserInput = z.infer<typeof addOrgUserInputSchema>;\n\nexport const createOrgUserInputSchema = z\n .object({\n orgId: idSchema,\n userId: idSchema,\n role: roleSchema,\n status: orgUserStatusSchema.optional(),\n })\n .strict();\nexport type CreateOrgUserInput = z.infer<typeof createOrgUserInputSchema>;\n\nexport const updateOrgUserInputSchema = z\n .object({\n role: roleSchema.optional(),\n status: orgUserStatusSchema.optional(),\n })\n .strict();\nexport type UpdateOrgUserInput = z.infer<typeof updateOrgUserInputSchema>;\n\nexport const createInviteInputSchema = z\n .object({\n orgId: idSchema,\n email: emailSchema,\n role: inviteRoleSchema,\n inviterUserId: idSchema,\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n sendEmail: z.boolean().optional(),\n })\n .strict();\nexport type CreateInviteInput = z.infer<typeof createInviteInputSchema>;\n\nexport const acceptInviteInputSchema = z\n .object({\n token: z.string().trim().min(1),\n userId: idSchema,\n email: emailSchema,\n })\n .strict();\nexport type AcceptInviteInput = z.infer<typeof acceptInviteInputSchema>;\n"],"mappings":";;;AAGA,MAAa,aAAa,EAAE,KAAK;CAAC;CAAS;CAAS;CAAc;AAAS,CAAC;AAG5E,MAAa,sBAAsB,EAAE,KAAK,CAAC,WAAW,QAAQ,CAAC;AAG/D,MAAa,mBAAmB,EAAE,KAAK;CAAC;CAAS;CAAc;AAAS,CAAC;AAGzE,MAAa,qBAAqB,EAC/B,OAAO;CACN,IAAI;CACJ,YAAY,SAAS,SAAS;CAC9B,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,SAAS;CACT,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,gBAAgB,EAC1B,OAAO;CACN,IAAI;CACJ,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,uBAAuB,EACjC,OAAO;CACN,IAAI;CACJ,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO;CACP,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,eAAe,EACzB,OAAO;CACN,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;CACN,QAAQ,EAAE,KAAK;EAAC;EAAW;EAAY;EAAY;CAAU,CAAC;CAC9D,WAAW;CACX,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACpC,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,6BAA6B,EACvC,OAAO;CACN,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAC5B,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,wBAAwB,EAClC,OAAO;CACN,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,2BAA2B,EACrC,OAAO;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ,oBAAoB,SAAS;AACvC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,2BAA2B,EACrC,OAAO;CACN,MAAM,WAAW,SAAS;CAC1B,QAAQ,oBAAoB,SAAS;AACvC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,0BAA0B,EACpC,OAAO;CACN,OAAO;CACP,OAAO;CACP,MAAM;CACN,eAAe;CACf,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS;AAClC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,0BAA0B,EACpC,OAAO;CACN,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC9B,QAAQ;CACR,OAAO;AACT,CAAC,CAAC,CACD,OAAO"}
1
+ {"version":3,"file":"organizations.js","names":[],"sources":["../../../src/types/schemas/organizations.ts"],"sourcesContent":["import { z } from 'zod';\nimport { idSchema, emailSchema } from './shared.js';\n\nexport const roleSchema = z.enum(['owner', 'admin', 'instructor', 'moderator', 'student']);\nexport type Role = z.infer<typeof roleSchema>;\n\nexport const orgUserStatusSchema = z.enum(['invited', 'active']);\nexport type OrgUserStatus = z.infer<typeof orgUserStatusSchema>;\n\nexport const inviteRoleSchema = z.enum(['admin', 'instructor', 'moderator', 'student']);\nexport type InviteRole = z.infer<typeof inviteRoleSchema>;\n\nexport const organizationSchema = z\n .object({\n id: idSchema,\n externalId: idSchema.nullable(),\n name: z.string(),\n slug: z.string(),\n ownerId: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Organization = z.output<typeof organizationSchema>;\nexport type OrganizationInput = z.input<typeof organizationSchema>;\n\nexport const orgUserSchema = z\n .object({\n id: idSchema,\n orgId: idSchema,\n userId: idSchema,\n role: roleSchema,\n status: orgUserStatusSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type OrgUser = z.output<typeof orgUserSchema>;\nexport type OrgUserInput = z.input<typeof orgUserSchema>;\n\nexport const orgUserProfileSchema = z\n .object({\n id: idSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n email: emailSchema,\n image: z.string().nullable(),\n })\n .strict();\nexport type OrgUserProfile = z.infer<typeof orgUserProfileSchema>;\n\nexport const inviteSchema = z\n .object({\n id: idSchema,\n orgId: idSchema,\n email: emailSchema,\n role: inviteRoleSchema,\n status: z.enum(['pending', 'accepted', 'rejected', 'canceled']),\n invitedBy: idSchema,\n tokenHash: z.string().nullable(),\n expiresAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Invite = z.output<typeof inviteSchema>;\nexport type InviteInput = z.input<typeof inviteSchema>;\n\nexport const newOrganizationInputSchema = z\n .object({\n name: z.string(),\n slug: z.string(),\n logo: z.string().optional(),\n })\n .strict();\nexport type NewOrganizationInput = z.infer<typeof newOrganizationInputSchema>;\n\nexport const addOrgUserInputSchema = z\n .object({\n orgId: idSchema,\n userId: idSchema,\n role: roleSchema,\n })\n .strict();\nexport type AddOrgUserInput = z.infer<typeof addOrgUserInputSchema>;\n\nexport const createOrgUserInputSchema = z\n .object({\n orgId: idSchema,\n userId: idSchema,\n role: roleSchema,\n status: orgUserStatusSchema.optional(),\n })\n .strict();\nexport type CreateOrgUserInput = z.infer<typeof createOrgUserInputSchema>;\n\nexport const updateOrgUserInputSchema = z\n .object({\n role: roleSchema.optional(),\n status: orgUserStatusSchema.optional(),\n })\n .strict();\nexport type UpdateOrgUserInput = z.infer<typeof updateOrgUserInputSchema>;\n\nexport const createInviteInputSchema = z\n .object({\n orgId: idSchema,\n email: emailSchema,\n role: inviteRoleSchema,\n inviterUserId: idSchema,\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n sendEmail: z.boolean().optional(),\n })\n .strict();\nexport type CreateInviteInput = z.infer<typeof createInviteInputSchema>;\n\nexport const acceptInviteInputSchema = z\n .object({\n token: z.string().trim().min(1),\n userId: idSchema,\n email: emailSchema,\n })\n .strict();\nexport type AcceptInviteInput = z.infer<typeof acceptInviteInputSchema>;\n"],"mappings":";;;AAGA,MAAa,aAAa,EAAE,KAAK;CAAC;CAAS;CAAS;CAAc;CAAa;AAAS,CAAC;AAGzF,MAAa,sBAAsB,EAAE,KAAK,CAAC,WAAW,QAAQ,CAAC;AAG/D,MAAa,mBAAmB,EAAE,KAAK;CAAC;CAAS;CAAc;CAAa;AAAS,CAAC;AAGtF,MAAa,qBAAqB,EAC/B,OAAO;CACN,IAAI;CACJ,YAAY,SAAS,SAAS;CAC9B,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,SAAS;CACT,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,gBAAgB,EAC1B,OAAO;CACN,IAAI;CACJ,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ;CACR,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,uBAAuB,EACjC,OAAO;CACN,IAAI;CACJ,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO;CACP,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;AAC7B,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,eAAe,EACzB,OAAO;CACN,IAAI;CACJ,OAAO;CACP,OAAO;CACP,MAAM;CACN,QAAQ,EAAE,KAAK;EAAC;EAAW;EAAY;EAAY;CAAU,CAAC;CAC9D,WAAW;CACX,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACpC,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,6BAA6B,EACvC,OAAO;CACN,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO;CACf,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;AAC5B,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,wBAAwB,EAClC,OAAO;CACN,OAAO;CACP,QAAQ;CACR,MAAM;AACR,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,2BAA2B,EACrC,OAAO;CACN,OAAO;CACP,QAAQ;CACR,MAAM;CACN,QAAQ,oBAAoB,SAAS;AACvC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,2BAA2B,EACrC,OAAO;CACN,MAAM,WAAW,SAAS;CAC1B,QAAQ,oBAAoB,SAAS;AACvC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,0BAA0B,EACpC,OAAO;CACN,OAAO;CACP,OAAO;CACP,MAAM;CACN,eAAe;CACf,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,QAAQ,CAAC,CAAC,SAAS;AAClC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,0BAA0B,EACpC,OAAO;CACN,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC9B,QAAQ;CACR,OAAO;AACT,CAAC,CAAC,CACD,OAAO"}
@@ -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>;
@@ -7,8 +7,10 @@ declare const isoDateStringSchema: z.ZodString;
7
7
  declare const serializableDateSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodCoercedDate<unknown>, z.ZodTransform<string, Date>>, z.ZodString]>;
8
8
  declare const jsonValueSchema: z.ZodType<JsonValue, unknown>;
9
9
  declare const jsonRecordSchema: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
10
+ /** Free-form JSON whose serialized form fits in `maxBytes` of UTF-8. */
11
+ declare function boundedJsonSchema(maxBytes: number): z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
10
12
  declare const eventMetadataSchema: z.ZodType<EventMetadata>;
11
13
  declare const domainEventSchema: z.ZodType<DomainEvent>;
12
14
  //#endregion
13
- export { domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema };
15
+ export { boundedJsonSchema, domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema };
14
16
  //# sourceMappingURL=shared.d.ts.map
@@ -14,6 +14,10 @@ const jsonValueSchema = z.lazy(() => z.union([
14
14
  ]));
15
15
  z.globalRegistry.add(jsonValueSchema, { id: "JsonValue" });
16
16
  const jsonRecordSchema = z.record(z.string(), jsonValueSchema);
17
+ /** Free-form JSON whose serialized form fits in `maxBytes` of UTF-8. */
18
+ function boundedJsonSchema(maxBytes) {
19
+ return jsonValueSchema.refine((value) => new TextEncoder().encode(JSON.stringify(value)).length <= maxBytes, { message: `must be at most ${Math.floor(maxBytes / 1024)} KB once serialized` }).describe(`Free-form JSON, at most ${Math.floor(maxBytes / 1024)} KB once serialized`);
20
+ }
17
21
  const eventMetadataSchema = z.record(z.string(), jsonValueSchema);
18
22
  const domainEventSchema = z.object({
19
23
  type: z.string().trim().min(1),
@@ -25,6 +29,6 @@ const domainEventSchema = z.object({
25
29
  metadata: eventMetadataSchema.optional()
26
30
  }).strict();
27
31
  //#endregion
28
- export { domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema };
32
+ export { boundedJsonSchema, domainEventSchema, emailSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema };
29
33
 
30
34
  //# sourceMappingURL=shared.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","names":[],"sources":["../../../src/types/schemas/shared.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { DomainEvent, EventMetadata, JsonValue } from '../shared.js';\n\nexport const idSchema: z.ZodString = z.string().trim().min(1);\n\n// The default z.email() pattern uses lookaheads, which RE2-based OpenAPI\n// consumers (Go, linters) reject. The HTML5 pattern is lookahead-free.\nexport const emailSchema: z.ZodEmail = z.email({ pattern: z.regexes.html5Email });\n\nexport const isoDateStringSchema = z.string().trim().min(1);\n\nexport const serializableDateSchema = z.union([\n z.coerce.date().transform((value) => value.toISOString()),\n isoDateStringSchema,\n]);\n\nexport const jsonValueSchema: z.ZodType<JsonValue, unknown> = z.lazy(() =>\n z.union([\n z.null(),\n z.string(),\n z.number().finite(),\n z.boolean(),\n z.array(jsonValueSchema),\n z.record(z.string(), jsonValueSchema),\n ]),\n);\n// Recursive schemas serialize to JSON Schema as a $ref; without a registered\n// id the ref gets an auto-name (\"schema0\") that OpenAPI tooling can't resolve.\nz.globalRegistry.add(jsonValueSchema, { id: 'JsonValue' });\n\nexport const jsonRecordSchema = z.record(z.string(), jsonValueSchema);\n\nexport const eventMetadataSchema: z.ZodType<EventMetadata> = z.record(z.string(), jsonValueSchema);\n\nexport const domainEventSchema: z.ZodType<DomainEvent> = z\n .object({\n type: z.string().trim().min(1),\n version: z.number().int().positive(),\n id: idSchema,\n orgId: idSchema,\n occurredAt: isoDateStringSchema,\n data: jsonValueSchema,\n metadata: eventMetadataSchema.optional(),\n })\n .strict();\n"],"mappings":";;AAGA,MAAa,WAAwB,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAI5D,MAAa,cAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,WAAW,CAAC;AAEhF,MAAa,sBAAsB,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAE1D,MAAa,yBAAyB,EAAE,MAAM,CAC5C,EAAE,OAAO,KAAK,CAAC,CAAC,WAAW,UAAU,MAAM,YAAY,CAAC,GACxD,mBACF,CAAC;AAED,MAAa,kBAAiD,EAAE,WAC9D,EAAE,MAAM;CACN,EAAE,KAAK;CACP,EAAE,OAAO;CACT,EAAE,OAAO,CAAC,CAAC,OAAO;CAClB,EAAE,QAAQ;CACV,EAAE,MAAM,eAAe;CACvB,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;AACtC,CAAC,CACH;AAGA,EAAE,eAAe,IAAI,iBAAiB,EAAE,IAAI,YAAY,CAAC;AAEzD,MAAa,mBAAmB,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;AAEpE,MAAa,sBAAgD,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;AAEjG,MAAa,oBAA4C,EACtD,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC7B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CACnC,IAAI;CACJ,OAAO;CACP,YAAY;CACZ,MAAM;CACN,UAAU,oBAAoB,SAAS;AACzC,CAAC,CAAC,CACD,OAAO"}
1
+ {"version":3,"file":"shared.js","names":[],"sources":["../../../src/types/schemas/shared.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { DomainEvent, EventMetadata, JsonValue } from '../shared.js';\n\nexport const idSchema: z.ZodString = z.string().trim().min(1);\n\n// The default z.email() pattern uses lookaheads, which RE2-based OpenAPI\n// consumers (Go, linters) reject. The HTML5 pattern is lookahead-free.\nexport const emailSchema: z.ZodEmail = z.email({ pattern: z.regexes.html5Email });\n\nexport const isoDateStringSchema = z.string().trim().min(1);\n\nexport const serializableDateSchema = z.union([\n z.coerce.date().transform((value) => value.toISOString()),\n isoDateStringSchema,\n]);\n\nexport const jsonValueSchema: z.ZodType<JsonValue, unknown> = z.lazy(() =>\n z.union([\n z.null(),\n z.string(),\n z.number().finite(),\n z.boolean(),\n z.array(jsonValueSchema),\n z.record(z.string(), jsonValueSchema),\n ]),\n);\n// Recursive schemas serialize to JSON Schema as a $ref; without a registered\n// id the ref gets an auto-name (\"schema0\") that OpenAPI tooling can't resolve.\nz.globalRegistry.add(jsonValueSchema, { id: 'JsonValue' });\n\nexport const jsonRecordSchema = z.record(z.string(), jsonValueSchema);\n\n/** Free-form JSON whose serialized form fits in `maxBytes` of UTF-8. */\nexport function boundedJsonSchema(maxBytes: number) {\n return jsonValueSchema\n .refine((value) => new TextEncoder().encode(JSON.stringify(value)).length <= maxBytes, {\n message: `must be at most ${Math.floor(maxBytes / 1024)} KB once serialized`,\n })\n .describe(`Free-form JSON, at most ${Math.floor(maxBytes / 1024)} KB once serialized`);\n}\n\nexport const eventMetadataSchema: z.ZodType<EventMetadata> = z.record(z.string(), jsonValueSchema);\n\nexport const domainEventSchema: z.ZodType<DomainEvent> = z\n .object({\n type: z.string().trim().min(1),\n version: z.number().int().positive(),\n id: idSchema,\n orgId: idSchema,\n occurredAt: isoDateStringSchema,\n data: jsonValueSchema,\n metadata: eventMetadataSchema.optional(),\n })\n .strict();\n"],"mappings":";;AAGA,MAAa,WAAwB,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAI5D,MAAa,cAA0B,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,WAAW,CAAC;AAEhF,MAAa,sBAAsB,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;AAE1D,MAAa,yBAAyB,EAAE,MAAM,CAC5C,EAAE,OAAO,KAAK,CAAC,CAAC,WAAW,UAAU,MAAM,YAAY,CAAC,GACxD,mBACF,CAAC;AAED,MAAa,kBAAiD,EAAE,WAC9D,EAAE,MAAM;CACN,EAAE,KAAK;CACP,EAAE,OAAO;CACT,EAAE,OAAO,CAAC,CAAC,OAAO;CAClB,EAAE,QAAQ;CACV,EAAE,MAAM,eAAe;CACvB,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;AACtC,CAAC,CACH;AAGA,EAAE,eAAe,IAAI,iBAAiB,EAAE,IAAI,YAAY,CAAC;AAEzD,MAAa,mBAAmB,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;;AAGpE,SAAgB,kBAAkB,UAAkB;CAClD,OAAO,gBACJ,QAAQ,UAAU,IAAI,YAAY,CAAC,CAAC,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,UAAU,UAAU,EACrF,SAAS,mBAAmB,KAAK,MAAM,WAAW,IAAI,EAAE,qBAC1D,CAAC,CAAC,CACD,SAAS,2BAA2B,KAAK,MAAM,WAAW,IAAI,EAAE,oBAAoB;AACzF;AAEA,MAAa,sBAAgD,EAAE,OAAO,EAAE,OAAO,GAAG,eAAe;AAEjG,MAAa,oBAA4C,EACtD,OAAO;CACN,MAAM,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC;CAC7B,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS;CACnC,IAAI;CACJ,OAAO;CACP,YAAY;CACZ,MAAM;CACN,UAAU,oBAAoB,SAAS;AACzC,CAAC,CAAC,CACD,OAAO"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@headless-lms/core",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "exports": {
@@ -30,7 +30,7 @@
30
30
  ],
31
31
  "dependencies": {
32
32
  "ksuid": "^3.0.0",
33
- "zod": "4.4.3"
33
+ "zod": "4.6.7"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/node": "^22.10.2",
@@ -1,4 +0,0 @@
1
- import { CourseActivityEngagement, CourseAnalytics, CourseEnrollmentPoint } from "./model.js";
2
- import { CoursesReportRepository, CoursesReportService } from "./ports.js";
3
- import { CoursesReportServiceImpl } from "./service.js";
4
- export { type CourseActivityEngagement, type CourseAnalytics, type CourseEnrollmentPoint, type CoursesReportRepository, type CoursesReportService, CoursesReportServiceImpl };
@@ -1,2 +0,0 @@
1
- import { CoursesReportServiceImpl } from "./service.js";
2
- export { CoursesReportServiceImpl };
@@ -1,24 +0,0 @@
1
- //#region src/reporting/courses/model.d.ts
2
- interface CourseActivityEngagement {
3
- activityId: string;
4
- title: string;
5
- moduleId: string;
6
- moduleTitle: string;
7
- started: number;
8
- completed: number;
9
- }
10
- interface CourseAnalytics {
11
- enrolled: number;
12
- started: number;
13
- completed: number;
14
- /** Mean of each cohort member's completed-activities percentage (0–100). */
15
- avgProgress: number;
16
- activities: CourseActivityEngagement[];
17
- }
18
- interface CourseEnrollmentPoint {
19
- date: string;
20
- count: number;
21
- }
22
- //#endregion
23
- export { CourseActivityEngagement, CourseAnalytics, CourseEnrollmentPoint };
24
- //# sourceMappingURL=model.d.ts.map
@@ -1,13 +0,0 @@
1
- import { CourseAnalytics, CourseEnrollmentPoint } from "./model.js";
2
- //#region src/reporting/courses/ports.d.ts
3
- interface CoursesReportService {
4
- analytics(orgId: string, courseId: string): Promise<CourseAnalytics | null>;
5
- enrollments(orgId: string, courseId: string, days: number): Promise<CourseEnrollmentPoint[] | null>;
6
- }
7
- interface CoursesReportRepository {
8
- analytics(orgId: string, courseId: string): Promise<CourseAnalytics | null>;
9
- enrollments(orgId: string, courseId: string, days: number): Promise<CourseEnrollmentPoint[] | null>;
10
- }
11
- //#endregion
12
- export { CoursesReportRepository, CoursesReportService };
13
- //# sourceMappingURL=ports.d.ts.map
@@ -1,19 +0,0 @@
1
- import { Logger } from "../../types/ports.js";
2
- import "../../shared/ports.js";
3
- import { CourseAnalytics, CourseEnrollmentPoint } from "./model.js";
4
- import { CoursesReportRepository, CoursesReportService } from "./ports.js";
5
- //#region src/reporting/courses/service.d.ts
6
- type CoursesReportServiceParams = {
7
- repo: CoursesReportRepository;
8
- logger?: Logger;
9
- };
10
- declare class CoursesReportServiceImpl implements CoursesReportService {
11
- private readonly repo;
12
- private readonly logger;
13
- constructor(params: CoursesReportServiceParams);
14
- analytics(orgId: string, courseId: string): Promise<CourseAnalytics | null>;
15
- enrollments(orgId: string, courseId: string, days: number): Promise<CourseEnrollmentPoint[] | null>;
16
- }
17
- //#endregion
18
- export { CoursesReportServiceImpl, CoursesReportServiceParams };
19
- //# sourceMappingURL=service.d.ts.map
@@ -1,20 +0,0 @@
1
- import { noopLogger } from "../../shared/logger.js";
2
- //#region src/reporting/courses/service.ts
3
- var CoursesReportServiceImpl = class {
4
- repo;
5
- logger;
6
- constructor(params) {
7
- this.repo = params.repo;
8
- this.logger = params.logger ?? noopLogger;
9
- }
10
- analytics(orgId, courseId) {
11
- return this.repo.analytics(orgId, courseId);
12
- }
13
- enrollments(orgId, courseId, days) {
14
- return this.repo.enrollments(orgId, courseId, days);
15
- }
16
- };
17
- //#endregion
18
- export { CoursesReportServiceImpl };
19
-
20
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","names":[],"sources":["../../../src/reporting/courses/service.ts"],"sourcesContent":["// reporting/courses — service implementation (inbound port).\nimport type { CourseAnalytics, CourseEnrollmentPoint } from './model.js';\nimport type { CoursesReportRepository, CoursesReportService } from './ports.js';\nimport type { Logger } from '../../shared/ports.js';\nimport { noopLogger } from '../../shared/logger.js';\n\nexport type CoursesReportServiceParams = {\n repo: CoursesReportRepository;\n logger?: Logger;\n};\n\nexport class CoursesReportServiceImpl implements CoursesReportService {\n private readonly repo: CoursesReportRepository;\n private readonly logger: Logger;\n\n constructor(params: CoursesReportServiceParams) {\n this.repo = params.repo;\n this.logger = params.logger ?? noopLogger;\n }\n\n analytics(orgId: string, courseId: string): Promise<CourseAnalytics | null> {\n return this.repo.analytics(orgId, courseId);\n }\n\n enrollments(\n orgId: string,\n courseId: string,\n days: number,\n ): Promise<CourseEnrollmentPoint[] | null> {\n return this.repo.enrollments(orgId, courseId, days);\n }\n}\n"],"mappings":";;AAWA,IAAa,2BAAb,MAAsE;CACpE;CACA;CAEA,YAAY,QAAoC;EAC9C,KAAK,OAAO,OAAO;EACnB,KAAK,SAAS,OAAO,UAAU;CACjC;CAEA,UAAU,OAAe,UAAmD;EAC1E,OAAO,KAAK,KAAK,UAAU,OAAO,QAAQ;CAC5C;CAEA,YACE,OACA,UACA,MACyC;EACzC,OAAO,KAAK,KAAK,YAAY,OAAO,UAAU,IAAI;CACpD;AACF"}
@@ -1,4 +0,0 @@
1
- import { EnrollmentPoint, OverviewStats } from "./model.js";
2
- import { DashboardReportRepository, DashboardReportService } from "./ports.js";
3
- import { DashboardReportServiceImpl } from "./service.js";
4
- export { type DashboardReportRepository, type DashboardReportService, DashboardReportServiceImpl, type EnrollmentPoint, type OverviewStats };
@@ -1,2 +0,0 @@
1
- import { DashboardReportServiceImpl } from "./service.js";
2
- export { DashboardReportServiceImpl };
@@ -1,14 +0,0 @@
1
- //#region src/reporting/dashboard/model.d.ts
2
- interface OverviewStats {
3
- publishedCourses: number;
4
- draftCourses: number;
5
- activeStudents: number;
6
- expiringSoon: number;
7
- }
8
- interface EnrollmentPoint {
9
- date: string;
10
- count: number;
11
- }
12
- //#endregion
13
- export { EnrollmentPoint, OverviewStats };
14
- //# sourceMappingURL=model.d.ts.map
@@ -1,13 +0,0 @@
1
- import { EnrollmentPoint, OverviewStats } from "./model.js";
2
- //#region src/reporting/dashboard/ports.d.ts
3
- interface DashboardReportService {
4
- overview(orgId: string): Promise<OverviewStats>;
5
- enrollments(orgId: string, days: number): Promise<EnrollmentPoint[]>;
6
- }
7
- interface DashboardReportRepository {
8
- overview(orgId: string): Promise<OverviewStats>;
9
- enrollments(orgId: string, days: number): Promise<EnrollmentPoint[]>;
10
- }
11
- //#endregion
12
- export { DashboardReportRepository, DashboardReportService };
13
- //# sourceMappingURL=ports.d.ts.map
@@ -1,19 +0,0 @@
1
- import { Logger } from "../../types/ports.js";
2
- import "../../shared/ports.js";
3
- import { EnrollmentPoint, OverviewStats } from "./model.js";
4
- import { DashboardReportRepository, DashboardReportService } from "./ports.js";
5
- //#region src/reporting/dashboard/service.d.ts
6
- type DashboardReportServiceParams = {
7
- repo: DashboardReportRepository;
8
- logger?: Logger;
9
- };
10
- declare class DashboardReportServiceImpl implements DashboardReportService {
11
- private readonly repo;
12
- private readonly logger;
13
- constructor(params: DashboardReportServiceParams);
14
- overview(orgId: string): Promise<OverviewStats>;
15
- enrollments(orgId: string, days: number): Promise<EnrollmentPoint[]>;
16
- }
17
- //#endregion
18
- export { DashboardReportServiceImpl, DashboardReportServiceParams };
19
- //# sourceMappingURL=service.d.ts.map
@@ -1,20 +0,0 @@
1
- import { noopLogger } from "../../shared/logger.js";
2
- //#region src/reporting/dashboard/service.ts
3
- var DashboardReportServiceImpl = class {
4
- repo;
5
- logger;
6
- constructor(params) {
7
- this.repo = params.repo;
8
- this.logger = params.logger ?? noopLogger;
9
- }
10
- overview(orgId) {
11
- return this.repo.overview(orgId);
12
- }
13
- enrollments(orgId, days) {
14
- return this.repo.enrollments(orgId, days);
15
- }
16
- };
17
- //#endregion
18
- export { DashboardReportServiceImpl };
19
-
20
- //# sourceMappingURL=service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"service.js","names":[],"sources":["../../../src/reporting/dashboard/service.ts"],"sourcesContent":["// reporting/dashboard — service implementation (inbound port).\nimport type { EnrollmentPoint, OverviewStats } from './model.js';\nimport type { DashboardReportRepository, DashboardReportService } from './ports.js';\nimport type { Logger } from '../../shared/ports.js';\nimport { noopLogger } from '../../shared/logger.js';\n\nexport type DashboardReportServiceParams = {\n repo: DashboardReportRepository;\n logger?: Logger;\n};\n\nexport class DashboardReportServiceImpl implements DashboardReportService {\n private readonly repo: DashboardReportRepository;\n private readonly logger: Logger;\n\n constructor(params: DashboardReportServiceParams) {\n this.repo = params.repo;\n this.logger = params.logger ?? noopLogger;\n }\n\n overview(orgId: string): Promise<OverviewStats> {\n return this.repo.overview(orgId);\n }\n\n enrollments(orgId: string, days: number): Promise<EnrollmentPoint[]> {\n return this.repo.enrollments(orgId, days);\n }\n}\n"],"mappings":";;AAWA,IAAa,6BAAb,MAA0E;CACxE;CACA;CAEA,YAAY,QAAsC;EAChD,KAAK,OAAO,OAAO;EACnB,KAAK,SAAS,OAAO,UAAU;CACjC;CAEA,SAAS,OAAuC;EAC9C,OAAO,KAAK,KAAK,SAAS,KAAK;CACjC;CAEA,YAAY,OAAe,MAA0C;EACnE,OAAO,KAAK,KAAK,YAAY,OAAO,IAAI;CAC1C;AACF"}
@@ -1,5 +0,0 @@
1
- import { Course, Module } from "../../types/schemas/content.js";
2
- import { ContentRef, CourseProgressView } from "./model.js";
3
- import { LearnEntitlementReader, LearnReportService } from "./ports.js";
4
- import { LearnReportServiceImpl } from "./service.js";
5
- export { type ContentRef, type Course, type CourseProgressView, type LearnEntitlementReader, type LearnReportService, LearnReportServiceImpl, type Module };
@@ -1,2 +0,0 @@
1
- import { LearnReportServiceImpl } from "./service.js";
2
- export { LearnReportServiceImpl };