@headless-lms/core 0.1.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 (261) hide show
  1. package/LICENSE +21 -0
  2. package/dist/assets/events.d.ts +81 -0
  3. package/dist/assets/events.js +24 -0
  4. package/dist/assets/events.js.map +1 -0
  5. package/dist/assets/index.d.ts +7 -0
  6. package/dist/assets/index.js +3 -0
  7. package/dist/assets/model.d.ts +4 -0
  8. package/dist/assets/model.js +1 -0
  9. package/dist/assets/ports.d.ts +34 -0
  10. package/dist/assets/ports.js +1 -0
  11. package/dist/assets/service.d.ts +29 -0
  12. package/dist/assets/service.js +130 -0
  13. package/dist/assets/service.js.map +1 -0
  14. package/dist/automations/actions.d.ts +24 -0
  15. package/dist/automations/actions.js +59 -0
  16. package/dist/automations/actions.js.map +1 -0
  17. package/dist/automations/catalog.d.ts +12 -0
  18. package/dist/automations/catalog.js +224 -0
  19. package/dist/automations/catalog.js.map +1 -0
  20. package/dist/automations/events.d.ts +264 -0
  21. package/dist/automations/events.js +54 -0
  22. package/dist/automations/events.js.map +1 -0
  23. package/dist/automations/index.d.ts +9 -0
  24. package/dist/automations/index.js +4 -0
  25. package/dist/automations/model.d.ts +12 -0
  26. package/dist/automations/model.js +14 -0
  27. package/dist/automations/model.js.map +1 -0
  28. package/dist/automations/ports.d.ts +56 -0
  29. package/dist/automations/ports.js +1 -0
  30. package/dist/automations/service.d.ts +53 -0
  31. package/dist/automations/service.js +225 -0
  32. package/dist/automations/service.js.map +1 -0
  33. package/dist/automations/types.d.ts +3 -0
  34. package/dist/automations/types.js +1 -0
  35. package/dist/content/events.d.ts +410 -0
  36. package/dist/content/events.js +105 -0
  37. package/dist/content/events.js.map +1 -0
  38. package/dist/content/index.d.ts +8 -0
  39. package/dist/content/index.js +3 -0
  40. package/dist/content/model.d.ts +3 -0
  41. package/dist/content/model.js +1 -0
  42. package/dist/content/ports.d.ts +85 -0
  43. package/dist/content/ports.js +1 -0
  44. package/dist/content/service.d.ts +54 -0
  45. package/dist/content/service.js +479 -0
  46. package/dist/content/service.js.map +1 -0
  47. package/dist/content/types.d.ts +4 -0
  48. package/dist/content/types.js +1 -0
  49. package/dist/discussion/events.d.ts +101 -0
  50. package/dist/discussion/events.js +29 -0
  51. package/dist/discussion/events.js.map +1 -0
  52. package/dist/discussion/index.d.ts +8 -0
  53. package/dist/discussion/index.js +3 -0
  54. package/dist/discussion/model.d.ts +5 -0
  55. package/dist/discussion/model.js +1 -0
  56. package/dist/discussion/ports.d.ts +112 -0
  57. package/dist/discussion/ports.js +1 -0
  58. package/dist/discussion/service.d.ts +67 -0
  59. package/dist/discussion/service.js +343 -0
  60. package/dist/discussion/service.js.map +1 -0
  61. package/dist/discussion/types.d.ts +4 -0
  62. package/dist/discussion/types.js +1 -0
  63. package/dist/entitlements/events.d.ts +89 -0
  64. package/dist/entitlements/events.js +29 -0
  65. package/dist/entitlements/events.js.map +1 -0
  66. package/dist/entitlements/index.d.ts +7 -0
  67. package/dist/entitlements/index.js +3 -0
  68. package/dist/entitlements/model.d.ts +4 -0
  69. package/dist/entitlements/model.js +1 -0
  70. package/dist/entitlements/ports.d.ts +34 -0
  71. package/dist/entitlements/ports.js +1 -0
  72. package/dist/entitlements/service.d.ts +27 -0
  73. package/dist/entitlements/service.js +60 -0
  74. package/dist/entitlements/service.js.map +1 -0
  75. package/dist/identity/events.d.ts +63 -0
  76. package/dist/identity/events.js +24 -0
  77. package/dist/identity/events.js.map +1 -0
  78. package/dist/identity/index.d.ts +8 -0
  79. package/dist/identity/index.js +3 -0
  80. package/dist/identity/model.d.ts +3 -0
  81. package/dist/identity/model.js +1 -0
  82. package/dist/identity/ports.d.ts +58 -0
  83. package/dist/identity/ports.js +1 -0
  84. package/dist/identity/service.d.ts +38 -0
  85. package/dist/identity/service.js +79 -0
  86. package/dist/identity/service.js.map +1 -0
  87. package/dist/identity/types.d.ts +4 -0
  88. package/dist/identity/types.js +1 -0
  89. package/dist/integrations/events.d.ts +70 -0
  90. package/dist/integrations/events.js +24 -0
  91. package/dist/integrations/events.js.map +1 -0
  92. package/dist/integrations/index.d.ts +9 -0
  93. package/dist/integrations/index.js +6 -0
  94. package/dist/integrations/model.d.ts +28 -0
  95. package/dist/integrations/model.js +45 -0
  96. package/dist/integrations/model.js.map +1 -0
  97. package/dist/integrations/ports.d.ts +62 -0
  98. package/dist/integrations/ports.js +1 -0
  99. package/dist/integrations/registry.d.ts +7 -0
  100. package/dist/integrations/registry.js +16 -0
  101. package/dist/integrations/registry.js.map +1 -0
  102. package/dist/integrations/service.d.ts +47 -0
  103. package/dist/integrations/service.js +184 -0
  104. package/dist/integrations/service.js.map +1 -0
  105. package/dist/integrations/zod.d.ts +29 -0
  106. package/dist/integrations/zod.js +40 -0
  107. package/dist/integrations/zod.js.map +1 -0
  108. package/dist/organizations/events.d.ts +197 -0
  109. package/dist/organizations/events.js +59 -0
  110. package/dist/organizations/events.js.map +1 -0
  111. package/dist/organizations/index.d.ts +11 -0
  112. package/dist/organizations/index.js +5 -0
  113. package/dist/organizations/members.d.ts +32 -0
  114. package/dist/organizations/members.js +12 -0
  115. package/dist/organizations/members.js.map +1 -0
  116. package/dist/organizations/model.d.ts +3 -0
  117. package/dist/organizations/model.js +1 -0
  118. package/dist/organizations/ports.d.ts +127 -0
  119. package/dist/organizations/ports.js +1 -0
  120. package/dist/organizations/roles.d.ts +23 -0
  121. package/dist/organizations/roles.js +70 -0
  122. package/dist/organizations/roles.js.map +1 -0
  123. package/dist/organizations/service.d.ts +58 -0
  124. package/dist/organizations/service.js +359 -0
  125. package/dist/organizations/service.js.map +1 -0
  126. package/dist/organizations/types.d.ts +39 -0
  127. package/dist/organizations/types.js +1 -0
  128. package/dist/progress/events.d.ts +55 -0
  129. package/dist/progress/events.js +19 -0
  130. package/dist/progress/events.js.map +1 -0
  131. package/dist/progress/index.d.ts +8 -0
  132. package/dist/progress/index.js +3 -0
  133. package/dist/progress/model.d.ts +3 -0
  134. package/dist/progress/model.js +1 -0
  135. package/dist/progress/ports.d.ts +37 -0
  136. package/dist/progress/ports.js +1 -0
  137. package/dist/progress/service.d.ts +33 -0
  138. package/dist/progress/service.js +181 -0
  139. package/dist/progress/service.js.map +1 -0
  140. package/dist/progress/types.d.ts +4 -0
  141. package/dist/progress/types.js +1 -0
  142. package/dist/reporting/dashboard/index.d.ts +4 -0
  143. package/dist/reporting/dashboard/index.js +2 -0
  144. package/dist/reporting/dashboard/model.d.ts +14 -0
  145. package/dist/reporting/dashboard/model.js +1 -0
  146. package/dist/reporting/dashboard/ports.d.ts +13 -0
  147. package/dist/reporting/dashboard/ports.js +1 -0
  148. package/dist/reporting/dashboard/service.d.ts +19 -0
  149. package/dist/reporting/dashboard/service.js +20 -0
  150. package/dist/reporting/dashboard/service.js.map +1 -0
  151. package/dist/reporting/learn/index.d.ts +5 -0
  152. package/dist/reporting/learn/index.js +2 -0
  153. package/dist/reporting/learn/model.d.ts +23 -0
  154. package/dist/reporting/learn/model.js +1 -0
  155. package/dist/reporting/learn/ports.d.ts +42 -0
  156. package/dist/reporting/learn/ports.js +1 -0
  157. package/dist/reporting/learn/service.d.ts +48 -0
  158. package/dist/reporting/learn/service.js +111 -0
  159. package/dist/reporting/learn/service.js.map +1 -0
  160. package/dist/reporting/students/index.d.ts +4 -0
  161. package/dist/reporting/students/index.js +2 -0
  162. package/dist/reporting/students/model.d.ts +31 -0
  163. package/dist/reporting/students/model.js +1 -0
  164. package/dist/reporting/students/ports.d.ts +13 -0
  165. package/dist/reporting/students/ports.js +1 -0
  166. package/dist/reporting/students/service.d.ts +19 -0
  167. package/dist/reporting/students/service.js +20 -0
  168. package/dist/reporting/students/service.js.map +1 -0
  169. package/dist/shared/errors.d.ts +22 -0
  170. package/dist/shared/errors.js +34 -0
  171. package/dist/shared/errors.js.map +1 -0
  172. package/dist/shared/events.d.ts +31 -0
  173. package/dist/shared/events.js +75 -0
  174. package/dist/shared/events.js.map +1 -0
  175. package/dist/shared/id.d.ts +44 -0
  176. package/dist/shared/id.js +53 -0
  177. package/dist/shared/id.js.map +1 -0
  178. package/dist/shared/invite-token.d.ts +9 -0
  179. package/dist/shared/invite-token.js +16 -0
  180. package/dist/shared/invite-token.js.map +1 -0
  181. package/dist/shared/logger.d.ts +19 -0
  182. package/dist/shared/logger.js +44 -0
  183. package/dist/shared/logger.js.map +1 -0
  184. package/dist/shared/mailer.d.ts +23 -0
  185. package/dist/shared/mailer.js +27 -0
  186. package/dist/shared/mailer.js.map +1 -0
  187. package/dist/shared/ports.d.ts +62 -0
  188. package/dist/shared/ports.js +2 -0
  189. package/dist/shared/settings.d.ts +25 -0
  190. package/dist/shared/settings.js +21 -0
  191. package/dist/shared/settings.js.map +1 -0
  192. package/dist/types/assets.d.ts +2 -0
  193. package/dist/types/assets.js +1 -0
  194. package/dist/types/automations.d.ts +23 -0
  195. package/dist/types/automations.js +1 -0
  196. package/dist/types/content.d.ts +2 -0
  197. package/dist/types/content.js +1 -0
  198. package/dist/types/discussion.d.ts +36 -0
  199. package/dist/types/discussion.js +1 -0
  200. package/dist/types/email-templates.d.ts +57 -0
  201. package/dist/types/email-templates.js +1 -0
  202. package/dist/types/entitlements.d.ts +3 -0
  203. package/dist/types/entitlements.js +1 -0
  204. package/dist/types/events.d.ts +25 -0
  205. package/dist/types/events.js +1 -0
  206. package/dist/types/identity.d.ts +37 -0
  207. package/dist/types/identity.js +1 -0
  208. package/dist/types/index.d.ts +23 -0
  209. package/dist/types/index.js +1 -0
  210. package/dist/types/integrations.d.ts +45 -0
  211. package/dist/types/integrations.js +1 -0
  212. package/dist/types/organizations.d.ts +15 -0
  213. package/dist/types/organizations.js +1 -0
  214. package/dist/types/ports.d.ts +57 -0
  215. package/dist/types/ports.js +1 -0
  216. package/dist/types/progress.d.ts +6 -0
  217. package/dist/types/progress.js +1 -0
  218. package/dist/types/schemas/assets.d.ts +109 -0
  219. package/dist/types/schemas/assets.js +49 -0
  220. package/dist/types/schemas/assets.js.map +1 -0
  221. package/dist/types/schemas/automations.d.ts +118 -0
  222. package/dist/types/schemas/automations.js +73 -0
  223. package/dist/types/schemas/automations.js.map +1 -0
  224. package/dist/types/schemas/content.d.ts +216 -0
  225. package/dist/types/schemas/content.js +138 -0
  226. package/dist/types/schemas/content.js.map +1 -0
  227. package/dist/types/schemas/credentials.d.ts +15 -0
  228. package/dist/types/schemas/credentials.js +15 -0
  229. package/dist/types/schemas/credentials.js.map +1 -0
  230. package/dist/types/schemas/discussion.d.ts +192 -0
  231. package/dist/types/schemas/discussion.js +100 -0
  232. package/dist/types/schemas/discussion.js.map +1 -0
  233. package/dist/types/schemas/entitlements.d.ts +50 -0
  234. package/dist/types/schemas/entitlements.js +38 -0
  235. package/dist/types/schemas/entitlements.js.map +1 -0
  236. package/dist/types/schemas/identity.d.ts +37 -0
  237. package/dist/types/schemas/identity.js +34 -0
  238. package/dist/types/schemas/identity.js.map +1 -0
  239. package/dist/types/schemas/index.d.ts +14 -0
  240. package/dist/types/schemas/index.js +14 -0
  241. package/dist/types/schemas/integrations.d.ts +36 -0
  242. package/dist/types/schemas/integrations.js +30 -0
  243. package/dist/types/schemas/integrations.js.map +1 -0
  244. package/dist/types/schemas/organizations.d.ts +135 -0
  245. package/dist/types/schemas/organizations.js +90 -0
  246. package/dist/types/schemas/organizations.js.map +1 -0
  247. package/dist/types/schemas/outbox.d.ts +19 -0
  248. package/dist/types/schemas/outbox.js +18 -0
  249. package/dist/types/schemas/outbox.js.map +1 -0
  250. package/dist/types/schemas/progress.d.ts +53 -0
  251. package/dist/types/schemas/progress.js +37 -0
  252. package/dist/types/schemas/progress.js.map +1 -0
  253. package/dist/types/schemas/settings.d.ts +16 -0
  254. package/dist/types/schemas/settings.js +15 -0
  255. package/dist/types/schemas/settings.js.map +1 -0
  256. package/dist/types/schemas/shared.d.ts +13 -0
  257. package/dist/types/schemas/shared.js +28 -0
  258. package/dist/types/schemas/shared.js.map +1 -0
  259. package/dist/types/shared.d.ts +25 -0
  260. package/dist/types/shared.js +1 -0
  261. package/package.json +61 -0
@@ -0,0 +1,192 @@
1
+ import { z } from "zod";
2
+ //#region src/types/schemas/discussion.d.ts
3
+ declare const commentStatusSchema: z.ZodEnum<{
4
+ pending: "pending";
5
+ published: "published";
6
+ removed: "removed";
7
+ }>;
8
+ type CommentStatus = z.infer<typeof commentStatusSchema>;
9
+ declare const reactionEmojiSchema: z.ZodString;
10
+ type ReactionEmoji = z.infer<typeof reactionEmojiSchema>;
11
+ declare const reactionCountsSchema: z.ZodRecord<z.ZodString, z.ZodNumber>;
12
+ type ReactionCounts = z.infer<typeof reactionCountsSchema>;
13
+ declare const commentSettingsSchema: z.ZodObject<{
14
+ enabled: z.ZodBoolean;
15
+ threaded: z.ZodBoolean;
16
+ requireReview: z.ZodBoolean;
17
+ reactions: z.ZodBoolean;
18
+ }, z.core.$strict>;
19
+ type CommentSettings = z.infer<typeof commentSettingsSchema>;
20
+ type CommentsConfig = CommentSettings;
21
+ declare const commentSchema: z.ZodObject<{
22
+ id: z.ZodString;
23
+ orgId: z.ZodString;
24
+ activityId: z.ZodString;
25
+ parentId: z.ZodNullable<z.ZodString>;
26
+ orgUserId: z.ZodString;
27
+ body: z.ZodString;
28
+ status: z.ZodEnum<{
29
+ pending: "pending";
30
+ published: "published";
31
+ removed: "removed";
32
+ }>;
33
+ removedBy: z.ZodNullable<z.ZodString>;
34
+ createdAt: z.ZodCoercedDate<unknown>;
35
+ updatedAt: z.ZodCoercedDate<unknown>;
36
+ }, z.core.$strict>;
37
+ type Comment = z.output<typeof commentSchema>;
38
+ type CommentInput = z.input<typeof commentSchema>;
39
+ declare const commentAuthorSchema: z.ZodObject<{
40
+ id: z.ZodString;
41
+ firstName: z.ZodNullable<z.ZodString>;
42
+ lastName: z.ZodNullable<z.ZodString>;
43
+ image: z.ZodNullable<z.ZodString>;
44
+ role: z.ZodEnum<{
45
+ owner: "owner";
46
+ admin: "admin";
47
+ instructor: "instructor";
48
+ student: "student";
49
+ }>;
50
+ }, z.core.$strict>;
51
+ type CommentAuthor = z.infer<typeof commentAuthorSchema>;
52
+ declare const commentReactionSchema: z.ZodObject<{
53
+ orgId: z.ZodString;
54
+ commentId: z.ZodString;
55
+ orgUserId: z.ZodString;
56
+ emoji: z.ZodString;
57
+ createdAt: z.ZodCoercedDate<unknown>;
58
+ }, z.core.$strict>;
59
+ type CommentReaction = z.output<typeof commentReactionSchema>;
60
+ declare const commentReportSchema: z.ZodObject<{
61
+ id: z.ZodString;
62
+ orgId: z.ZodString;
63
+ commentId: z.ZodString;
64
+ orgUserId: z.ZodString;
65
+ reason: z.ZodString;
66
+ resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
67
+ createdAt: z.ZodCoercedDate<unknown>;
68
+ }, z.core.$strict>;
69
+ type CommentReport = z.output<typeof commentReportSchema>;
70
+ type CommentReportInput = z.input<typeof commentReportSchema>;
71
+ declare const commentViewSchema: z.ZodObject<{
72
+ id: z.ZodString;
73
+ activityId: z.ZodString;
74
+ parentId: z.ZodNullable<z.ZodString>;
75
+ author: z.ZodObject<{
76
+ id: z.ZodString;
77
+ firstName: z.ZodNullable<z.ZodString>;
78
+ lastName: z.ZodNullable<z.ZodString>;
79
+ image: z.ZodNullable<z.ZodString>;
80
+ role: z.ZodEnum<{
81
+ owner: "owner";
82
+ admin: "admin";
83
+ instructor: "instructor";
84
+ student: "student";
85
+ }>;
86
+ }, z.core.$strict>;
87
+ body: z.ZodNullable<z.ZodString>;
88
+ status: z.ZodEnum<{
89
+ pending: "pending";
90
+ published: "published";
91
+ removed: "removed";
92
+ }>;
93
+ removedBy: z.ZodNullable<z.ZodObject<{
94
+ id: z.ZodString;
95
+ firstName: z.ZodNullable<z.ZodString>;
96
+ lastName: z.ZodNullable<z.ZodString>;
97
+ image: z.ZodNullable<z.ZodString>;
98
+ role: z.ZodEnum<{
99
+ owner: "owner";
100
+ admin: "admin";
101
+ instructor: "instructor";
102
+ student: "student";
103
+ }>;
104
+ }, z.core.$strict>>;
105
+ reactions: z.ZodRecord<z.ZodString, z.ZodNumber>;
106
+ viewerReaction: z.ZodOptional<z.ZodString>;
107
+ createdAt: z.ZodCoercedDate<unknown>;
108
+ updatedAt: z.ZodCoercedDate<unknown>;
109
+ }, z.core.$strict>;
110
+ type CommentView = z.output<typeof commentViewSchema>;
111
+ declare const commentReportSummarySchema: z.ZodObject<{
112
+ reporter: z.ZodObject<{
113
+ id: z.ZodString;
114
+ firstName: z.ZodNullable<z.ZodString>;
115
+ lastName: z.ZodNullable<z.ZodString>;
116
+ image: z.ZodNullable<z.ZodString>;
117
+ role: z.ZodEnum<{
118
+ owner: "owner";
119
+ admin: "admin";
120
+ instructor: "instructor";
121
+ student: "student";
122
+ }>;
123
+ }, z.core.$strict>;
124
+ reason: z.ZodString;
125
+ createdAt: z.ZodCoercedDate<unknown>;
126
+ }, z.core.$strict>;
127
+ type CommentReportSummary = z.output<typeof commentReportSummarySchema>;
128
+ declare const commentListItemSchema: z.ZodObject<{
129
+ id: z.ZodString;
130
+ parentId: z.ZodNullable<z.ZodString>;
131
+ activityId: z.ZodString;
132
+ activityTitle: z.ZodString;
133
+ courseId: z.ZodString;
134
+ body: z.ZodString;
135
+ status: z.ZodEnum<{
136
+ pending: "pending";
137
+ published: "published";
138
+ removed: "removed";
139
+ }>;
140
+ author: z.ZodObject<{
141
+ id: z.ZodString;
142
+ firstName: z.ZodNullable<z.ZodString>;
143
+ lastName: z.ZodNullable<z.ZodString>;
144
+ image: z.ZodNullable<z.ZodString>;
145
+ role: z.ZodEnum<{
146
+ owner: "owner";
147
+ admin: "admin";
148
+ instructor: "instructor";
149
+ student: "student";
150
+ }>;
151
+ }, z.core.$strict>;
152
+ authorEmail: z.ZodString;
153
+ removedBy: z.ZodNullable<z.ZodString>;
154
+ reports: z.ZodArray<z.ZodObject<{
155
+ reporter: z.ZodObject<{
156
+ id: z.ZodString;
157
+ firstName: z.ZodNullable<z.ZodString>;
158
+ lastName: z.ZodNullable<z.ZodString>;
159
+ image: z.ZodNullable<z.ZodString>;
160
+ role: z.ZodEnum<{
161
+ owner: "owner";
162
+ admin: "admin";
163
+ instructor: "instructor";
164
+ student: "student";
165
+ }>;
166
+ }, z.core.$strict>;
167
+ reason: z.ZodString;
168
+ createdAt: z.ZodCoercedDate<unknown>;
169
+ }, z.core.$strict>>;
170
+ createdAt: z.ZodCoercedDate<unknown>;
171
+ updatedAt: z.ZodCoercedDate<unknown>;
172
+ }, z.core.$strict>;
173
+ type CommentListItem = z.output<typeof commentListItemSchema>;
174
+ declare const listCommentsQuerySchema: z.ZodObject<{
175
+ page: z.ZodNumber;
176
+ pageSize: z.ZodNumber;
177
+ search: z.ZodOptional<z.ZodString>;
178
+ sort: z.ZodOptional<z.ZodString>;
179
+ status: z.ZodOptional<z.ZodEnum<{
180
+ pending: "pending";
181
+ published: "published";
182
+ removed: "removed";
183
+ }>>;
184
+ reported: z.ZodOptional<z.ZodBoolean>;
185
+ courseId: z.ZodOptional<z.ZodString>;
186
+ activityId: z.ZodOptional<z.ZodString>;
187
+ orgUserId: z.ZodOptional<z.ZodString>;
188
+ }, z.core.$strict>;
189
+ type ListCommentsQuery = z.infer<typeof listCommentsQuerySchema>;
190
+ //#endregion
191
+ export { Comment, CommentAuthor, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
192
+ //# sourceMappingURL=discussion.d.ts.map
@@ -0,0 +1,100 @@
1
+ import { idSchema } from "./shared.js";
2
+ import { roleSchema } from "./organizations.js";
3
+ import { z } from "zod";
4
+ //#region src/types/schemas/discussion.ts
5
+ const commentStatusSchema = z.enum([
6
+ "pending",
7
+ "published",
8
+ "removed"
9
+ ]);
10
+ const reactionEmojiSchema = z.string();
11
+ const reactionCountsSchema = z.record(reactionEmojiSchema, z.number().int().min(0));
12
+ const commentSettingsSchema = z.object({
13
+ enabled: z.boolean(),
14
+ threaded: z.boolean(),
15
+ requireReview: z.boolean(),
16
+ reactions: z.boolean()
17
+ }).strict();
18
+ const commentSchema = z.object({
19
+ id: idSchema,
20
+ orgId: idSchema,
21
+ activityId: idSchema,
22
+ parentId: idSchema.nullable(),
23
+ orgUserId: idSchema,
24
+ body: z.string(),
25
+ status: commentStatusSchema,
26
+ removedBy: idSchema.nullable(),
27
+ createdAt: z.coerce.date(),
28
+ updatedAt: z.coerce.date()
29
+ }).strict();
30
+ const commentAuthorSchema = z.object({
31
+ id: idSchema,
32
+ firstName: z.string().nullable(),
33
+ lastName: z.string().nullable(),
34
+ image: z.string().nullable(),
35
+ role: roleSchema
36
+ }).strict();
37
+ const commentReactionSchema = z.object({
38
+ orgId: idSchema,
39
+ commentId: idSchema,
40
+ orgUserId: idSchema,
41
+ emoji: reactionEmojiSchema,
42
+ createdAt: z.coerce.date()
43
+ }).strict();
44
+ const commentReportSchema = z.object({
45
+ id: idSchema,
46
+ orgId: idSchema,
47
+ commentId: idSchema,
48
+ orgUserId: idSchema,
49
+ reason: z.string(),
50
+ resolvedAt: z.coerce.date().nullable(),
51
+ createdAt: z.coerce.date()
52
+ }).strict();
53
+ const commentViewSchema = z.object({
54
+ id: idSchema,
55
+ activityId: idSchema,
56
+ parentId: idSchema.nullable(),
57
+ author: commentAuthorSchema,
58
+ body: z.string().nullable(),
59
+ status: commentStatusSchema,
60
+ removedBy: commentAuthorSchema.nullable(),
61
+ reactions: reactionCountsSchema,
62
+ viewerReaction: reactionEmojiSchema.optional(),
63
+ createdAt: z.coerce.date(),
64
+ updatedAt: z.coerce.date()
65
+ }).strict();
66
+ const commentReportSummarySchema = z.object({
67
+ reporter: commentAuthorSchema,
68
+ reason: z.string(),
69
+ createdAt: z.coerce.date()
70
+ }).strict();
71
+ const commentListItemSchema = z.object({
72
+ id: idSchema,
73
+ parentId: idSchema.nullable(),
74
+ activityId: idSchema,
75
+ activityTitle: z.string(),
76
+ courseId: idSchema,
77
+ body: z.string(),
78
+ status: commentStatusSchema,
79
+ author: commentAuthorSchema,
80
+ authorEmail: z.string().email(),
81
+ removedBy: idSchema.nullable(),
82
+ reports: z.array(commentReportSummarySchema),
83
+ createdAt: z.coerce.date(),
84
+ updatedAt: z.coerce.date()
85
+ }).strict();
86
+ const listCommentsQuerySchema = z.object({
87
+ page: z.number().int().min(1),
88
+ pageSize: z.number().int().min(1),
89
+ search: z.string().optional(),
90
+ sort: z.string().optional(),
91
+ status: commentStatusSchema.optional(),
92
+ reported: z.boolean().optional(),
93
+ courseId: idSchema.optional(),
94
+ activityId: idSchema.optional(),
95
+ orgUserId: idSchema.optional()
96
+ }).strict();
97
+ //#endregion
98
+ export { commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
99
+
100
+ //# sourceMappingURL=discussion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"discussion.js","names":[],"sources":["../../../src/types/schemas/discussion.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { roleSchema } from \"./organizations.js\";\nimport { idSchema } from \"./shared.js\";\n\nexport const commentStatusSchema = z.enum([\"pending\", \"published\", \"removed\"]);\nexport type CommentStatus = z.infer<typeof commentStatusSchema>;\n\nexport const reactionEmojiSchema = z.string();\nexport type ReactionEmoji = z.infer<typeof reactionEmojiSchema>;\n\nexport const reactionCountsSchema = z.record(reactionEmojiSchema, z.number().int().min(0));\nexport type ReactionCounts = z.infer<typeof reactionCountsSchema>;\n\nexport const commentSettingsSchema = z.object({\n enabled: z.boolean(),\n threaded: z.boolean(),\n requireReview: z.boolean(),\n reactions: z.boolean(),\n}).strict();\nexport type CommentSettings = z.infer<typeof commentSettingsSchema>;\n\nexport type CommentsConfig = CommentSettings;\n\nexport const commentSchema = z.object({\n id: idSchema,\n orgId: idSchema,\n activityId: idSchema,\n parentId: idSchema.nullable(),\n orgUserId: idSchema,\n body: z.string(),\n status: commentStatusSchema,\n removedBy: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Comment = z.output<typeof commentSchema>;\nexport type CommentInput = z.input<typeof commentSchema>;\n\nexport const commentAuthorSchema = z.object({\n id: idSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n image: z.string().nullable(),\n role: roleSchema,\n}).strict();\nexport type CommentAuthor = z.infer<typeof commentAuthorSchema>;\n\nexport const commentReactionSchema = z.object({\n orgId: idSchema,\n commentId: idSchema,\n orgUserId: idSchema,\n emoji: reactionEmojiSchema,\n createdAt: z.coerce.date(),\n}).strict();\nexport type CommentReaction = z.output<typeof commentReactionSchema>;\n\nexport const commentReportSchema = z.object({\n id: idSchema,\n orgId: idSchema,\n commentId: idSchema,\n orgUserId: idSchema,\n reason: z.string(),\n resolvedAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n}).strict();\nexport type CommentReport = z.output<typeof commentReportSchema>;\nexport type CommentReportInput = z.input<typeof commentReportSchema>;\n\nexport const commentViewSchema = z.object({\n id: idSchema,\n activityId: idSchema,\n parentId: idSchema.nullable(),\n author: commentAuthorSchema,\n body: z.string().nullable(),\n status: commentStatusSchema,\n removedBy: commentAuthorSchema.nullable(),\n reactions: reactionCountsSchema,\n viewerReaction: reactionEmojiSchema.optional(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type CommentView = z.output<typeof commentViewSchema>;\n\nexport const commentReportSummarySchema = z.object({\n reporter: commentAuthorSchema,\n reason: z.string(),\n createdAt: z.coerce.date(),\n}).strict();\nexport type CommentReportSummary = z.output<typeof commentReportSummarySchema>;\n\nexport const commentListItemSchema = z.object({\n id: idSchema,\n parentId: idSchema.nullable(),\n activityId: idSchema,\n activityTitle: z.string(),\n courseId: idSchema,\n body: z.string(),\n status: commentStatusSchema,\n author: commentAuthorSchema,\n authorEmail: z.string().email(),\n removedBy: idSchema.nullable(),\n reports: z.array(commentReportSummarySchema),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type CommentListItem = z.output<typeof commentListItemSchema>;\n\nexport const listCommentsQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n status: commentStatusSchema.optional(),\n reported: z.boolean().optional(),\n courseId: idSchema.optional(),\n activityId: idSchema.optional(),\n orgUserId: idSchema.optional(),\n}).strict();\nexport type ListCommentsQuery = z.infer<typeof listCommentsQuerySchema>;\n"],"mappings":";;;;AAIA,MAAa,sBAAsB,EAAE,KAAK;CAAC;CAAW;CAAa;AAAS,CAAC;AAG7E,MAAa,sBAAsB,EAAE,OAAO;AAG5C,MAAa,uBAAuB,EAAE,OAAO,qBAAqB,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;AAGzF,MAAa,wBAAwB,EAAE,OAAO;CAC5C,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,QAAQ;CACpB,eAAe,EAAE,QAAQ;CACzB,WAAW,EAAE,QAAQ;AACvB,CAAC,CAAC,CAAC,OAAO;AAKV,MAAa,gBAAgB,EAAE,OAAO;CACpC,IAAI;CACJ,OAAO;CACP,YAAY;CACZ,UAAU,SAAS,SAAS;CAC5B,WAAW;CACX,MAAM,EAAE,OAAO;CACf,QAAQ;CACR,WAAW,SAAS,SAAS;CAC7B,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,sBAAsB,EAAE,OAAO;CAC1C,IAAI;CACJ,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,MAAM;AACR,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,wBAAwB,EAAE,OAAO;CAC5C,OAAO;CACP,WAAW;CACX,WAAW;CACX,OAAO;CACP,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,sBAAsB,EAAE,OAAO;CAC1C,IAAI;CACJ,OAAO;CACP,WAAW;CACX,WAAW;CACX,QAAQ,EAAE,OAAO;CACjB,YAAY,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACrC,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,oBAAoB,EAAE,OAAO;CACxC,IAAI;CACJ,YAAY;CACZ,UAAU,SAAS,SAAS;CAC5B,QAAQ;CACR,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,QAAQ;CACR,WAAW,oBAAoB,SAAS;CACxC,WAAW;CACX,gBAAgB,oBAAoB,SAAS;CAC7C,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,6BAA6B,EAAE,OAAO;CACjD,UAAU;CACV,QAAQ,EAAE,OAAO;CACjB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,wBAAwB,EAAE,OAAO;CAC5C,IAAI;CACJ,UAAU,SAAS,SAAS;CAC5B,YAAY;CACZ,eAAe,EAAE,OAAO;CACxB,UAAU;CACV,MAAM,EAAE,OAAO;CACf,QAAQ;CACR,QAAQ;CACR,aAAa,EAAE,OAAO,CAAC,CAAC,MAAM;CAC9B,WAAW,SAAS,SAAS;CAC7B,SAAS,EAAE,MAAM,0BAA0B;CAC3C,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,0BAA0B,EAAE,OAAO;CAC9C,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAC5B,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAChC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,QAAQ,oBAAoB,SAAS;CACrC,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,UAAU,SAAS,SAAS;CAC5B,YAAY,SAAS,SAAS;CAC9B,WAAW,SAAS,SAAS;AAC/B,CAAC,CAAC,CAAC,OAAO"}
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ //#region src/types/schemas/entitlements.d.ts
3
+ declare const entitlementStatusSchema: z.ZodEnum<{
4
+ active: "active";
5
+ revoked: "revoked";
6
+ }>;
7
+ type EntitlementStatus = z.infer<typeof entitlementStatusSchema>;
8
+ declare const entitlementSchema: z.ZodObject<{
9
+ orgId: z.ZodString;
10
+ id: z.ZodString;
11
+ orgUserId: z.ZodString;
12
+ contentId: z.ZodString;
13
+ status: z.ZodEnum<{
14
+ active: "active";
15
+ revoked: "revoked";
16
+ }>;
17
+ source: z.ZodString;
18
+ grantedAt: z.ZodCoercedDate<unknown>;
19
+ expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
20
+ }, z.core.$strict>;
21
+ type Entitlement = z.output<typeof entitlementSchema>;
22
+ type EntitlementInput = z.input<typeof entitlementSchema>;
23
+ declare const entitlementsQuerySchema: z.ZodObject<{
24
+ page: z.ZodNumber;
25
+ pageSize: z.ZodNumber;
26
+ search: z.ZodOptional<z.ZodString>;
27
+ sort: z.ZodOptional<z.ZodString>;
28
+ status: z.ZodOptional<z.ZodEnum<{
29
+ active: "active";
30
+ revoked: "revoked";
31
+ expired: "expired";
32
+ }>>;
33
+ source: z.ZodOptional<z.ZodString>;
34
+ orgUserId: z.ZodOptional<z.ZodString>;
35
+ contentId: z.ZodOptional<z.ZodString>;
36
+ type: z.ZodOptional<z.ZodEnum<{
37
+ download: "download";
38
+ course: "course";
39
+ }>>;
40
+ }, z.core.$strict>;
41
+ type EntitlementsQuery = z.infer<typeof entitlementsQuerySchema>;
42
+ declare const grantEntitlementInputSchema: z.ZodObject<{
43
+ orgUserId: z.ZodString;
44
+ contentId: z.ZodString;
45
+ expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
46
+ }, z.core.$strict>;
47
+ type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;
48
+ //#endregion
49
+ export { Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema };
50
+ //# sourceMappingURL=entitlements.d.ts.map
@@ -0,0 +1,38 @@
1
+ import { idSchema } from "./shared.js";
2
+ import { z } from "zod";
3
+ //#region src/types/schemas/entitlements.ts
4
+ const entitlementStatusSchema = z.enum(["active", "revoked"]);
5
+ const entitlementSchema = z.object({
6
+ orgId: idSchema,
7
+ id: idSchema,
8
+ orgUserId: idSchema,
9
+ contentId: idSchema,
10
+ status: entitlementStatusSchema,
11
+ source: z.string(),
12
+ grantedAt: z.coerce.date(),
13
+ expiresAt: z.coerce.date().nullable()
14
+ }).strict();
15
+ const entitlementsQuerySchema = z.object({
16
+ page: z.number().int().min(1),
17
+ pageSize: z.number().int().min(1),
18
+ search: z.string().optional(),
19
+ sort: z.string().optional(),
20
+ status: z.enum([
21
+ "active",
22
+ "expired",
23
+ "revoked"
24
+ ]).optional(),
25
+ source: z.string().optional(),
26
+ orgUserId: idSchema.optional(),
27
+ contentId: idSchema.optional(),
28
+ type: z.enum(["course", "download"]).optional()
29
+ }).strict();
30
+ const grantEntitlementInputSchema = z.object({
31
+ orgUserId: idSchema,
32
+ contentId: idSchema,
33
+ expiresAt: z.coerce.date().nullable()
34
+ }).strict();
35
+ //#endregion
36
+ export { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema };
37
+
38
+ //# sourceMappingURL=entitlements.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entitlements.js","names":[],"sources":["../../../src/types/schemas/entitlements.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { idSchema } from \"./shared.js\";\n\nexport const entitlementStatusSchema = z.enum([\"active\", \"revoked\"]);\nexport type EntitlementStatus = z.infer<typeof entitlementStatusSchema>;\n\nexport const entitlementSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n orgUserId: idSchema,\n contentId: idSchema,\n status: entitlementStatusSchema,\n source: z.string(),\n grantedAt: z.coerce.date(),\n expiresAt: z.coerce.date().nullable(),\n}).strict();\nexport type Entitlement = z.output<typeof entitlementSchema>;\nexport type EntitlementInput = z.input<typeof entitlementSchema>;\n\nexport const entitlementsQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n status: z.enum([\"active\", \"expired\", \"revoked\"]).optional(),\n source: z.string().optional(),\n orgUserId: idSchema.optional(),\n contentId: idSchema.optional(),\n type: z.enum([\"course\", \"download\"]).optional(),\n}).strict();\nexport type EntitlementsQuery = z.infer<typeof entitlementsQuerySchema>;\n\nexport const grantEntitlementInputSchema = z.object({\n orgUserId: idSchema,\n contentId: idSchema,\n expiresAt: z.coerce.date().nullable(),\n}).strict();\nexport type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;AAGnE,MAAa,oBAAoB,EAAE,OAAO;CACxC,OAAO;CACP,IAAI;CACJ,WAAW;CACX,WAAW;CACX,QAAQ;CACR,QAAQ,EAAE,OAAO;CACjB,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;AACtC,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,0BAA0B,EAAE,OAAO;CAC9C,MAAM,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAC5B,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;CAChC,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,MAAM,EAAE,OAAO,CAAC,CAAC,SAAS;CAC1B,QAAQ,EAAE,KAAK;EAAC;EAAU;EAAW;CAAS,CAAC,CAAC,CAAC,SAAS;CAC1D,QAAQ,EAAE,OAAO,CAAC,CAAC,SAAS;CAC5B,WAAW,SAAS,SAAS;CAC7B,WAAW,SAAS,SAAS;CAC7B,MAAM,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC,CAAC,CAAC,SAAS;AAChD,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,8BAA8B,EAAE,OAAO;CAClD,WAAW;CACX,WAAW;CACX,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;AACtC,CAAC,CAAC,CAAC,OAAO"}
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ //#region src/types/schemas/identity.d.ts
3
+ declare const userSchema: z.ZodObject<{
4
+ id: z.ZodString;
5
+ externalId: z.ZodNullable<z.ZodString>;
6
+ email: z.ZodString;
7
+ firstName: z.ZodNullable<z.ZodString>;
8
+ lastName: z.ZodNullable<z.ZodString>;
9
+ createdAt: z.ZodCoercedDate<unknown>;
10
+ updatedAt: z.ZodCoercedDate<unknown>;
11
+ }, z.core.$strict>;
12
+ type User = z.output<typeof userSchema>;
13
+ type UserInput = z.input<typeof userSchema>;
14
+ declare const createUserInputSchema: z.ZodObject<{
15
+ id: z.ZodOptional<z.ZodString>;
16
+ externalId: z.ZodOptional<z.ZodString>;
17
+ email: z.ZodString;
18
+ firstName: z.ZodOptional<z.ZodString>;
19
+ lastName: z.ZodOptional<z.ZodString>;
20
+ }, z.core.$strict>;
21
+ type CreateUserInput = z.infer<typeof createUserInputSchema>;
22
+ declare const provisionUserInputSchema: z.ZodObject<{
23
+ email: z.ZodString;
24
+ firstName: z.ZodOptional<z.ZodString>;
25
+ lastName: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strict>;
27
+ type ProvisionUserInput = z.infer<typeof provisionUserInputSchema>;
28
+ declare const updateUserInputSchema: z.ZodObject<{
29
+ externalId: z.ZodOptional<z.ZodString>;
30
+ firstName: z.ZodOptional<z.ZodString>;
31
+ lastName: z.ZodOptional<z.ZodString>;
32
+ email: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strict>;
34
+ type UpdateUserInput = z.infer<typeof updateUserInputSchema>;
35
+ //#endregion
36
+ export { CreateUserInput, ProvisionUserInput, UpdateUserInput, User, UserInput, createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema };
37
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1,34 @@
1
+ import { idSchema } from "./shared.js";
2
+ import { z } from "zod";
3
+ //#region src/types/schemas/identity.ts
4
+ const userSchema = z.object({
5
+ id: idSchema,
6
+ externalId: idSchema.nullable(),
7
+ email: z.string().email(),
8
+ firstName: z.string().nullable(),
9
+ lastName: z.string().nullable(),
10
+ createdAt: z.coerce.date(),
11
+ updatedAt: z.coerce.date()
12
+ }).strict();
13
+ const createUserInputSchema = z.object({
14
+ id: idSchema.optional(),
15
+ externalId: idSchema.optional(),
16
+ email: z.string().email(),
17
+ firstName: z.string().optional(),
18
+ lastName: z.string().optional()
19
+ }).strict();
20
+ const provisionUserInputSchema = z.object({
21
+ email: z.string().email(),
22
+ firstName: z.string().optional(),
23
+ lastName: z.string().optional()
24
+ }).strict();
25
+ const updateUserInputSchema = z.object({
26
+ externalId: idSchema.optional(),
27
+ firstName: z.string().optional(),
28
+ lastName: z.string().optional(),
29
+ email: z.string().email().optional()
30
+ }).strict();
31
+ //#endregion
32
+ export { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema };
33
+
34
+ //# sourceMappingURL=identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.js","names":[],"sources":["../../../src/types/schemas/identity.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { idSchema } from \"./shared.js\";\n\nexport const userSchema = z.object({\n id: idSchema,\n externalId: idSchema.nullable(),\n email: z.string().email(),\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type User = z.output<typeof userSchema>;\nexport type UserInput = z.input<typeof userSchema>;\n\nexport const createUserInputSchema = z.object({\n id: idSchema.optional(),\n externalId: idSchema.optional(),\n email: z.string().email(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n}).strict();\nexport type CreateUserInput = z.infer<typeof createUserInputSchema>;\n\nexport const provisionUserInputSchema = z.object({\n email: z.string().email(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n}).strict();\nexport type ProvisionUserInput = z.infer<typeof provisionUserInputSchema>;\n\nexport const updateUserInputSchema = z.object({\n externalId: idSchema.optional(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n email: z.string().email().optional(),\n}).strict();\nexport type UpdateUserInput = z.infer<typeof updateUserInputSchema>;\n"],"mappings":";;;AAGA,MAAa,aAAa,EAAE,OAAO;CACjC,IAAI;CACJ,YAAY,SAAS,SAAS;CAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,wBAAwB,EAAE,OAAO;CAC5C,IAAI,SAAS,SAAS;CACtB,YAAY,SAAS,SAAS;CAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,2BAA2B,EAAE,OAAO;CAC/C,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM;CACxB,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,wBAAwB,EAAE,OAAO;CAC5C,YAAY,SAAS,SAAS;CAC9B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS;AACrC,CAAC,CAAC,CAAC,OAAO"}
@@ -0,0 +1,14 @@
1
+ import { CreateUserInput, ProvisionUserInput, UpdateUserInput, User, UserInput, createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema } from "./identity.js";
2
+ import { AcceptInviteInput, AddOrgUserInput, CreateInviteInput, CreateOrgUserInput, Invite, InviteInput, InviteRole, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, Role, acceptInviteInputSchema, addOrgUserInputSchema, createInviteInputSchema, createOrgUserInputSchema, inviteRoleSchema, inviteSchema, newOrganizationInputSchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, roleSchema } from "./organizations.js";
3
+ import { Activity, ActivityAsset, ActivityAssetInput, ActivityCommentsRule, ActivityInput, ActivitySettings, AddDownloadAssetInput, ContentItem, ContentItemInput, ContentType, Course, CourseInput, CourseSettings, CourseStatus, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadAssetInput, DownloadInput, DownloadStatus, ListCoursesQuery, ListDownloadsQuery, Module, ModuleInput, ReorderDownloadAssetsInput, SaveActivityInput, UpdateCourseInput, UpdateDownloadInput, activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsSchema, courseStatusSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateCourseInputSchema, updateDownloadInputSchema } from "./content.js";
4
+ import { Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema } from "./entitlements.js";
5
+ import { ProgressRecord, ProgressRecordInput, ProgressReportItem, ProgressTarget, ProgressTargetType, ReportProgressInput, progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, reportProgressInputSchema } from "./progress.js";
6
+ import { Asset, AssetInput, AssetKind, AssetStatus, AssetsQuery, DownloadTicket, RequestUploadInput, UploadTicket, assetKindSchema, assetSchema, assetStatusSchema, assetsQuerySchema, downloadTicketSchema, requestUploadInputSchema, uploadTicketSchema } from "./assets.js";
7
+ import { ConfigureInput, ConnectInput, Connection, ConnectionInput, Validation, configureInputSchema, connectInputSchema, connectionSchema, validationSchema } from "./integrations.js";
8
+ import { Automation, AutomationAction, AutomationActionResult, AutomationInput, AutomationRun, AutomationRunInput, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableActions, AvailableTriggers, CreateAutomationInput, UpdateAutomationInput, automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema } from "./automations.js";
9
+ import { Comment, CommentAuthor, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema } from "./discussion.js";
10
+ import { Credential, CredentialInput, credentialSchema } from "./credentials.js";
11
+ import { domainEventSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema } from "./shared.js";
12
+ import { EventOutbox, EventOutboxInput, eventOutboxSchema } from "./outbox.js";
13
+ import { Setting, SettingInput, settingSchema } from "./settings.js";
14
+ export { AcceptInviteInput, Activity, ActivityAsset, ActivityAssetInput, ActivityCommentsRule, ActivityInput, ActivitySettings, AddDownloadAssetInput, AddOrgUserInput, Asset, AssetInput, AssetKind, AssetStatus, AssetsQuery, Automation, AutomationAction, AutomationActionResult, AutomationInput, AutomationRun, AutomationRunInput, AutomationRunStatus, AutomationRunsQuery, AutomationTrigger, AvailableAction, AvailableActions, AvailableTriggers, Comment, CommentAuthor, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ConfigureInput, ConnectInput, Connection, ConnectionInput, ContentItem, ContentItemInput, ContentType, Course, CourseInput, CourseSettings, CourseStatus, CreateAutomationInput, CreateCourseInput, CreateDownloadInput, CreateInviteInput, CreateOrgUserInput, CreateUserInput, Credential, CredentialInput, Download, DownloadAsset, DownloadAssetInput, DownloadInput, DownloadStatus, DownloadTicket, Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, EventOutbox, EventOutboxInput, GrantEntitlementInput, Invite, InviteInput, InviteRole, ListCommentsQuery, ListCoursesQuery, ListDownloadsQuery, Module, ModuleInput, NewOrganizationInput, OrgUser, OrgUserInput, OrgUserProfile, OrgUserStatus, Organization, OrganizationInput, ProgressRecord, ProgressRecordInput, ProgressReportItem, ProgressTarget, ProgressTargetType, ProvisionUserInput, ReactionCounts, ReactionEmoji, ReorderDownloadAssetsInput, ReportProgressInput, RequestUploadInput, Role, SaveActivityInput, Setting, SettingInput, UpdateAutomationInput, UpdateCourseInput, UpdateDownloadInput, UpdateUserInput, UploadTicket, User, UserInput, Validation, acceptInviteInputSchema, activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, addOrgUserInputSchema, assetKindSchema, assetSchema, assetStatusSchema, assetsQuerySchema, automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, configureInputSchema, connectInputSchema, connectionSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsSchema, courseStatusSchema, createAutomationInputSchema, createCourseInputSchema, createDownloadInputSchema, createInviteInputSchema, createOrgUserInputSchema, createUserInputSchema, credentialSchema, domainEventSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, downloadTicketSchema, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, eventMetadataSchema, eventOutboxSchema, grantEntitlementInputSchema, idSchema, inviteRoleSchema, inviteSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, listCommentsQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, newOrganizationInputSchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, provisionUserInputSchema, reactionCountsSchema, reactionEmojiSchema, reorderDownloadAssetsInputSchema, reportProgressInputSchema, requestUploadInputSchema, roleSchema, saveActivityInputSchema, serializableDateSchema, settingSchema, updateAutomationInputSchema, updateCourseInputSchema, updateDownloadInputSchema, updateUserInputSchema, uploadTicketSchema, userSchema, validationSchema };
@@ -0,0 +1,14 @@
1
+ import { domainEventSchema, eventMetadataSchema, idSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, serializableDateSchema } from "./shared.js";
2
+ import { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema } from "./identity.js";
3
+ import { acceptInviteInputSchema, addOrgUserInputSchema, createInviteInputSchema, createOrgUserInputSchema, inviteRoleSchema, inviteSchema, newOrganizationInputSchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, roleSchema } from "./organizations.js";
4
+ import { commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema } from "./discussion.js";
5
+ import { activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsSchema, courseStatusSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateCourseInputSchema, updateDownloadInputSchema } from "./content.js";
6
+ import { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema } from "./entitlements.js";
7
+ import { progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, reportProgressInputSchema } from "./progress.js";
8
+ import { assetKindSchema, assetSchema, assetStatusSchema, assetsQuerySchema, downloadTicketSchema, requestUploadInputSchema, uploadTicketSchema } from "./assets.js";
9
+ import { configureInputSchema, connectInputSchema, connectionSchema, validationSchema } from "./integrations.js";
10
+ import { automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, createAutomationInputSchema, updateAutomationInputSchema } from "./automations.js";
11
+ import { credentialSchema } from "./credentials.js";
12
+ import { eventOutboxSchema } from "./outbox.js";
13
+ import { settingSchema } from "./settings.js";
14
+ export { acceptInviteInputSchema, activityAssetSchema, activityCommentsRuleSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, addOrgUserInputSchema, assetKindSchema, assetSchema, assetStatusSchema, assetsQuerySchema, automationActionResultSchema, automationActionSchema, automationRunSchema, automationRunStatusSchema, automationRunsQuerySchema, automationSchema, automationTriggerSchema, availableActionSchema, availableTriggersSchema, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, configureInputSchema, connectInputSchema, connectionSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsSchema, courseStatusSchema, createAutomationInputSchema, createCourseInputSchema, createDownloadInputSchema, createInviteInputSchema, createOrgUserInputSchema, createUserInputSchema, credentialSchema, domainEventSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, downloadTicketSchema, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, eventMetadataSchema, eventOutboxSchema, grantEntitlementInputSchema, idSchema, inviteRoleSchema, inviteSchema, isoDateStringSchema, jsonRecordSchema, jsonValueSchema, listCommentsQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, newOrganizationInputSchema, orgUserProfileSchema, orgUserSchema, orgUserStatusSchema, organizationSchema, progressRecordSchema, progressReportItemSchema, progressTargetSchema, progressTargetTypeSchema, provisionUserInputSchema, reactionCountsSchema, reactionEmojiSchema, reorderDownloadAssetsInputSchema, reportProgressInputSchema, requestUploadInputSchema, roleSchema, saveActivityInputSchema, serializableDateSchema, settingSchema, updateAutomationInputSchema, updateCourseInputSchema, updateDownloadInputSchema, updateUserInputSchema, uploadTicketSchema, userSchema, validationSchema };
@@ -0,0 +1,36 @@
1
+ import { JsonValue } from "../shared.js";
2
+ import { z } from "zod";
3
+ //#region src/types/schemas/integrations.d.ts
4
+ declare const validationSchema: z.ZodUnion<readonly [z.ZodObject<{
5
+ ok: z.ZodLiteral<true>;
6
+ }, z.core.$strict>, z.ZodObject<{
7
+ ok: z.ZodLiteral<false>;
8
+ errors: z.ZodArray<z.ZodString>;
9
+ }, z.core.$strict>]>;
10
+ type Validation = z.infer<typeof validationSchema>;
11
+ declare const connectionSchema: z.ZodObject<{
12
+ orgId: z.ZodString;
13
+ id: z.ZodString;
14
+ integrationId: z.ZodString;
15
+ config: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
16
+ active: z.ZodBoolean;
17
+ credentialRef: z.ZodString;
18
+ createdAt: z.ZodCoercedDate<unknown>;
19
+ updatedAt: z.ZodCoercedDate<unknown>;
20
+ }, z.core.$strict>;
21
+ type Connection = z.output<typeof connectionSchema>;
22
+ type ConnectionInput = z.input<typeof connectionSchema>;
23
+ declare const connectInputSchema: z.ZodObject<{
24
+ integrationId: z.ZodString;
25
+ secrets: z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>;
26
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
27
+ }, z.core.$strict>;
28
+ type ConnectInput = z.output<typeof connectInputSchema>;
29
+ declare const configureInputSchema: z.ZodObject<{
30
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>>>;
31
+ active: z.ZodOptional<z.ZodBoolean>;
32
+ }, z.core.$strict>;
33
+ type ConfigureInput = z.output<typeof configureInputSchema>;
34
+ //#endregion
35
+ export { ConfigureInput, ConnectInput, Connection, ConnectionInput, Validation, configureInputSchema, connectInputSchema, connectionSchema, validationSchema };
36
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1,30 @@
1
+ import { idSchema, jsonRecordSchema } from "./shared.js";
2
+ import { z } from "zod";
3
+ //#region src/types/schemas/integrations.ts
4
+ const validationSchema = z.union([z.object({ ok: z.literal(true) }).strict(), z.object({
5
+ ok: z.literal(false),
6
+ errors: z.array(z.string())
7
+ }).strict()]);
8
+ const connectionSchema = z.object({
9
+ orgId: idSchema,
10
+ id: idSchema,
11
+ integrationId: idSchema,
12
+ config: jsonRecordSchema,
13
+ active: z.boolean(),
14
+ credentialRef: idSchema,
15
+ createdAt: z.coerce.date(),
16
+ updatedAt: z.coerce.date()
17
+ }).strict();
18
+ const connectInputSchema = z.object({
19
+ integrationId: idSchema,
20
+ secrets: jsonRecordSchema,
21
+ config: jsonRecordSchema.optional()
22
+ }).strict();
23
+ const configureInputSchema = z.object({
24
+ config: jsonRecordSchema.optional(),
25
+ active: z.boolean().optional()
26
+ }).strict();
27
+ //#endregion
28
+ export { configureInputSchema, connectInputSchema, connectionSchema, validationSchema };
29
+
30
+ //# sourceMappingURL=integrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.js","names":[],"sources":["../../../src/types/schemas/integrations.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { idSchema, jsonRecordSchema } from \"./shared.js\";\n\nexport const validationSchema = z.union([\n z.object({ ok: z.literal(true) }).strict(),\n z.object({ ok: z.literal(false), errors: z.array(z.string()) }).strict(),\n]);\nexport type Validation = z.infer<typeof validationSchema>;\n\nexport const connectionSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n integrationId: idSchema,\n config: jsonRecordSchema,\n active: z.boolean(),\n credentialRef: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Connection = z.output<typeof connectionSchema>;\nexport type ConnectionInput = z.input<typeof connectionSchema>;\n\nexport const connectInputSchema = z.object({\n integrationId: idSchema,\n secrets: jsonRecordSchema,\n config: jsonRecordSchema.optional(),\n}).strict();\nexport type ConnectInput = z.output<typeof connectInputSchema>;\n\nexport const configureInputSchema = z.object({\n config: jsonRecordSchema.optional(),\n active: z.boolean().optional(),\n}).strict();\nexport type ConfigureInput = z.output<typeof configureInputSchema>;\n"],"mappings":";;;AAGA,MAAa,mBAAmB,EAAE,MAAM,CACtC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,GACzC,EAAE,OAAO;CAAE,IAAI,EAAE,QAAQ,KAAK;CAAG,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;AAAE,CAAC,CAAC,CAAC,OAAO,CACzE,CAAC;AAGD,MAAa,mBAAmB,EAAE,OAAO;CACvC,OAAO;CACP,IAAI;CACJ,eAAe;CACf,QAAQ;CACR,QAAQ,EAAE,QAAQ;CAClB,eAAe;CACf,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CAAC,OAAO;AAIV,MAAa,qBAAqB,EAAE,OAAO;CACzC,eAAe;CACf,SAAS;CACT,QAAQ,iBAAiB,SAAS;AACpC,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,uBAAuB,EAAE,OAAO;CAC3C,QAAQ,iBAAiB,SAAS;CAClC,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS;AAC/B,CAAC,CAAC,CAAC,OAAO"}