@headless-lms/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/events.d.ts +39 -21
- package/dist/assets/events.js +1 -1
- package/dist/assets/events.js.map +1 -1
- package/dist/assets/file-urls.d.ts +20 -0
- package/dist/assets/file-urls.js +25 -0
- package/dist/assets/file-urls.js.map +1 -0
- package/dist/assets/index.d.ts +5 -4
- package/dist/assets/index.js +3 -2
- package/dist/assets/model.d.ts +2 -2
- package/dist/assets/ports.d.ts +45 -15
- package/dist/assets/service.d.ts +39 -7
- package/dist/assets/service.js +291 -38
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.d.ts +13 -24
- package/dist/automations/actions.js +168 -43
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.d.ts +2 -1
- package/dist/automations/catalog.js +229 -13
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/community-derivations.d.ts +14 -0
- package/dist/automations/community-derivations.js +439 -0
- package/dist/automations/community-derivations.js.map +1 -0
- package/dist/automations/community-mail.d.ts +112 -0
- package/dist/automations/community-mail.js +90 -0
- package/dist/automations/community-mail.js.map +1 -0
- package/dist/automations/community-notifications.d.ts +16 -0
- package/dist/automations/community-notifications.js +84 -0
- package/dist/automations/community-notifications.js.map +1 -0
- package/dist/automations/events.d.ts +28 -0
- package/dist/automations/index.d.ts +4 -2
- package/dist/automations/index.js +3 -2
- package/dist/automations/model.d.ts +10 -3
- package/dist/automations/model.js +15 -2
- package/dist/automations/model.js.map +1 -1
- package/dist/automations/ports.d.ts +5 -1
- package/dist/automations/schedule.d.ts +6 -0
- package/dist/automations/schedule.js +41 -0
- package/dist/automations/schedule.js.map +1 -0
- package/dist/automations/seeds.d.ts +17 -0
- package/dist/automations/seeds.js +235 -0
- package/dist/automations/seeds.js.map +1 -0
- package/dist/automations/service.d.ts +22 -3
- package/dist/automations/service.js +306 -43
- package/dist/automations/service.js.map +1 -1
- package/dist/content/events.d.ts +631 -19
- package/dist/content/events.js +44 -1
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +4 -4
- package/dist/content/model.d.ts +2 -2
- package/dist/content/ports.d.ts +71 -18
- package/dist/content/service.d.ts +57 -18
- package/dist/content/service.js +502 -23
- package/dist/content/service.js.map +1 -1
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/authors.d.ts +10 -0
- package/dist/discussion/authors.js +23 -0
- package/dist/discussion/authors.js.map +1 -0
- package/dist/discussion/chats.d.ts +104 -0
- package/dist/discussion/chats.js +798 -0
- package/dist/discussion/chats.js.map +1 -0
- package/dist/discussion/events.d.ts +619 -56
- package/dist/discussion/events.js +106 -3
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/index.d.ts +7 -3
- package/dist/discussion/index.js +4 -1
- package/dist/discussion/ports.d.ts +288 -27
- package/dist/discussion/ports.js +6 -1
- package/dist/discussion/ports.js.map +1 -0
- package/dist/discussion/posts.d.ts +103 -0
- package/dist/discussion/posts.js +723 -0
- package/dist/discussion/posts.js.map +1 -0
- package/dist/discussion/service.d.ts +32 -10
- package/dist/discussion/service.js +293 -78
- package/dist/discussion/service.js.map +1 -1
- package/dist/entitlements/events.d.ts +178 -11
- package/dist/entitlements/events.js +28 -1
- package/dist/entitlements/events.js.map +1 -1
- package/dist/entitlements/index.d.ts +5 -4
- package/dist/entitlements/index.js +2 -1
- package/dist/entitlements/model.d.ts +3 -2
- package/dist/entitlements/ports.d.ts +124 -11
- package/dist/entitlements/rules.d.ts +12 -0
- package/dist/entitlements/rules.js +17 -0
- package/dist/entitlements/rules.js.map +1 -0
- package/dist/entitlements/service.d.ts +54 -3
- package/dist/entitlements/service.js +472 -2
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/access.d.ts +6 -0
- package/dist/identity/access.js +7 -0
- package/dist/identity/access.js.map +1 -0
- package/dist/identity/index.d.ts +6 -4
- package/dist/identity/index.js +3 -1
- package/dist/identity/model.d.ts +2 -1
- package/dist/identity/notifications.d.ts +27 -0
- package/dist/identity/notifications.js +101 -0
- package/dist/identity/notifications.js.map +1 -0
- package/dist/identity/ports.d.ts +73 -3
- package/dist/identity/service.d.ts +14 -3
- package/dist/identity/service.js +62 -5
- package/dist/identity/service.js.map +1 -1
- package/dist/integrations/model.js +1 -1
- package/dist/integrations/model.js.map +1 -1
- package/dist/integrations/service.js +2 -2
- package/dist/integrations/service.js.map +1 -1
- package/dist/organizations/access-scopes.d.ts +19 -0
- package/dist/organizations/access-scopes.js +89 -0
- package/dist/organizations/access-scopes.js.map +1 -0
- package/dist/organizations/events.d.ts +74 -32
- package/dist/organizations/events.js +6 -0
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +7 -6
- package/dist/organizations/index.js +4 -3
- package/dist/organizations/members.d.ts +8 -5
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/ports.d.ts +14 -11
- package/dist/organizations/roles.d.ts +6 -10
- package/dist/organizations/roles.js +19 -7
- package/dist/organizations/roles.js.map +1 -1
- package/dist/organizations/service.d.ts +20 -11
- package/dist/organizations/service.js +157 -47
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/types.d.ts +1 -10
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/ports.d.ts +6 -1
- package/dist/progress/service.d.ts +3 -1
- package/dist/progress/service.js +6 -2
- package/dist/progress/service.js.map +1 -1
- package/dist/reporting/admin/index.d.ts +4 -0
- package/dist/reporting/admin/index.js +2 -0
- package/dist/reporting/admin/model.d.ts +108 -0
- package/dist/reporting/admin/ports.d.ts +27 -0
- package/dist/reporting/admin/service.d.ts +22 -0
- package/dist/reporting/admin/service.js +38 -0
- package/dist/reporting/admin/service.js.map +1 -0
- package/dist/reporting/member/index.d.ts +5 -0
- package/dist/reporting/member/index.js +2 -0
- package/dist/reporting/member/model.d.ts +124 -0
- package/dist/reporting/member/ports.d.ts +45 -0
- package/dist/reporting/member/service.d.ts +73 -0
- package/dist/reporting/member/service.js +286 -0
- package/dist/reporting/member/service.js.map +1 -0
- package/dist/shared/actor.d.ts +9 -0
- package/dist/shared/errors.d.ts +7 -1
- package/dist/shared/errors.js +10 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/id.d.ts +11 -0
- package/dist/shared/id.js +12 -1
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/mailer.d.ts +4 -1
- package/dist/shared/mailer.js.map +1 -1
- package/dist/shared/network.d.ts +10 -0
- package/dist/shared/network.js +211 -0
- package/dist/shared/network.js.map +1 -0
- package/dist/types/assets.d.ts +2 -2
- package/dist/types/automations.d.ts +10 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +11 -3
- package/dist/types/email-templates.d.ts +121 -0
- package/dist/types/entitlements.d.ts +2 -2
- package/dist/types/identity.d.ts +48 -2
- package/dist/types/index.d.ts +9 -9
- package/dist/types/ports.d.ts +6 -0
- package/dist/types/schemas/assets.d.ts +65 -37
- package/dist/types/schemas/assets.js +17 -12
- package/dist/types/schemas/assets.js.map +1 -1
- package/dist/types/schemas/automations.d.ts +18 -1
- package/dist/types/schemas/automations.js +15 -6
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +335 -3
- package/dist/types/schemas/content.js +139 -3
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +370 -3
- package/dist/types/schemas/discussion.js +199 -4
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/entitlements.d.ts +36 -2
- package/dist/types/schemas/entitlements.js +23 -1
- package/dist/types/schemas/entitlements.js.map +1 -1
- package/dist/types/schemas/identity.d.ts +111 -1
- package/dist/types/schemas/identity.js +55 -2
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +8 -8
- package/dist/types/schemas/index.js +8 -8
- package/dist/types/schemas/organizations.d.ts +8 -0
- package/dist/types/schemas/organizations.js +2 -0
- package/dist/types/schemas/organizations.js.map +1 -1
- package/dist/types/schemas/shared.d.ts +3 -1
- package/dist/types/schemas/shared.js +5 -1
- package/dist/types/schemas/shared.js.map +1 -1
- package/package.json +2 -2
- package/dist/reporting/courses/index.d.ts +0 -4
- package/dist/reporting/courses/index.js +0 -2
- package/dist/reporting/courses/model.d.ts +0 -24
- package/dist/reporting/courses/ports.d.ts +0 -13
- package/dist/reporting/courses/service.d.ts +0 -19
- package/dist/reporting/courses/service.js +0 -20
- package/dist/reporting/courses/service.js.map +0 -1
- package/dist/reporting/dashboard/index.d.ts +0 -4
- package/dist/reporting/dashboard/index.js +0 -2
- package/dist/reporting/dashboard/model.d.ts +0 -14
- package/dist/reporting/dashboard/ports.d.ts +0 -13
- package/dist/reporting/dashboard/service.d.ts +0 -19
- package/dist/reporting/dashboard/service.js +0 -20
- package/dist/reporting/dashboard/service.js.map +0 -1
- package/dist/reporting/learn/index.d.ts +0 -5
- package/dist/reporting/learn/index.js +0 -2
- package/dist/reporting/learn/model.d.ts +0 -23
- package/dist/reporting/learn/ports.d.ts +0 -43
- package/dist/reporting/learn/ports.js +0 -1
- package/dist/reporting/learn/service.d.ts +0 -49
- package/dist/reporting/learn/service.js +0 -116
- package/dist/reporting/learn/service.js.map +0 -1
- package/dist/reporting/students/index.d.ts +0 -4
- package/dist/reporting/students/index.js +0 -2
- package/dist/reporting/students/model.d.ts +0 -51
- package/dist/reporting/students/model.js +0 -1
- package/dist/reporting/students/ports.d.ts +0 -15
- package/dist/reporting/students/ports.js +0 -1
- package/dist/reporting/students/service.d.ts +0 -20
- package/dist/reporting/students/service.js +0 -23
- package/dist/reporting/students/service.js.map +0 -1
- /package/dist/reporting/{courses → admin}/model.js +0 -0
- /package/dist/reporting/{courses → admin}/ports.js +0 -0
- /package/dist/reporting/{dashboard → member}/model.js +0 -0
- /package/dist/reporting/{dashboard → member}/ports.js +0 -0
- /package/dist/{reporting/learn/model.js → shared/actor.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emailSchema, idSchema } from "./shared.js";
|
|
1
|
+
import { emailSchema, idSchema, jsonValueSchema } from "./shared.js";
|
|
2
2
|
import { roleSchema } from "./organizations.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/types/schemas/discussion.ts
|
|
@@ -23,7 +23,9 @@ const activityCommentsRuleSchema = z.enum([
|
|
|
23
23
|
const commentSchema = z.object({
|
|
24
24
|
id: idSchema,
|
|
25
25
|
orgId: idSchema,
|
|
26
|
-
activityId: idSchema,
|
|
26
|
+
activityId: idSchema.nullable(),
|
|
27
|
+
postId: idSchema.nullable(),
|
|
28
|
+
communityId: idSchema.nullable(),
|
|
27
29
|
parentId: idSchema.nullable(),
|
|
28
30
|
orgUserId: idSchema,
|
|
29
31
|
body: z.string(),
|
|
@@ -36,7 +38,11 @@ const commentAuthorSchema = z.object({
|
|
|
36
38
|
id: idSchema,
|
|
37
39
|
firstName: z.string().nullable(),
|
|
38
40
|
lastName: z.string().nullable(),
|
|
41
|
+
displayName: z.string().nullable(),
|
|
42
|
+
headline: z.string().nullable(),
|
|
39
43
|
image: z.string().nullable(),
|
|
44
|
+
imageAssetId: idSchema.nullable(),
|
|
45
|
+
imageUrl: z.string().nullable(),
|
|
40
46
|
role: roleSchema
|
|
41
47
|
}).strict();
|
|
42
48
|
const commentReactionSchema = z.object({
|
|
@@ -47,6 +53,7 @@ const commentReactionSchema = z.object({
|
|
|
47
53
|
createdAt: z.coerce.date(),
|
|
48
54
|
updatedAt: z.coerce.date()
|
|
49
55
|
}).strict();
|
|
56
|
+
const commentFlagResolutionSchema = z.enum(["dismissed", "removed"]);
|
|
50
57
|
const commentReportSchema = z.object({
|
|
51
58
|
id: idSchema,
|
|
52
59
|
orgId: idSchema,
|
|
@@ -54,12 +61,16 @@ const commentReportSchema = z.object({
|
|
|
54
61
|
orgUserId: idSchema,
|
|
55
62
|
reason: z.string(),
|
|
56
63
|
resolvedAt: z.coerce.date().nullable(),
|
|
64
|
+
resolution: commentFlagResolutionSchema.nullable(),
|
|
65
|
+
resolvedBy: idSchema.nullable(),
|
|
57
66
|
createdAt: z.coerce.date(),
|
|
58
67
|
updatedAt: z.coerce.date()
|
|
59
68
|
}).strict();
|
|
60
69
|
const commentViewSchema = z.object({
|
|
61
70
|
id: idSchema,
|
|
62
|
-
activityId: idSchema,
|
|
71
|
+
activityId: idSchema.nullable(),
|
|
72
|
+
postId: idSchema.nullable(),
|
|
73
|
+
communityId: idSchema.nullable(),
|
|
63
74
|
parentId: idSchema.nullable(),
|
|
64
75
|
author: commentAuthorSchema,
|
|
65
76
|
body: z.string().nullable(),
|
|
@@ -101,7 +112,191 @@ const listCommentsQuerySchema = z.object({
|
|
|
101
112
|
activityId: idSchema.optional(),
|
|
102
113
|
orgUserId: idSchema.optional()
|
|
103
114
|
}).strict();
|
|
115
|
+
const postStatusSchema = z.enum([
|
|
116
|
+
"draft",
|
|
117
|
+
"scheduled",
|
|
118
|
+
"pending",
|
|
119
|
+
"published",
|
|
120
|
+
"removed"
|
|
121
|
+
]);
|
|
122
|
+
const postSchema = z.object({
|
|
123
|
+
orgId: idSchema,
|
|
124
|
+
id: idSchema,
|
|
125
|
+
communityId: idSchema,
|
|
126
|
+
spaceId: idSchema,
|
|
127
|
+
orgUserId: idSchema,
|
|
128
|
+
topicId: idSchema.nullable(),
|
|
129
|
+
title: z.string(),
|
|
130
|
+
body: z.string(),
|
|
131
|
+
extra: jsonValueSchema,
|
|
132
|
+
coverAssetId: idSchema.nullable(),
|
|
133
|
+
status: postStatusSchema,
|
|
134
|
+
scheduledAt: z.coerce.date().nullable(),
|
|
135
|
+
publishedAt: z.coerce.date().nullable(),
|
|
136
|
+
removedBy: idSchema.nullable(),
|
|
137
|
+
pinned: z.boolean(),
|
|
138
|
+
commentsClosed: z.boolean().nullable(),
|
|
139
|
+
reactionsEnabled: z.boolean().nullable(),
|
|
140
|
+
createdAt: z.coerce.date(),
|
|
141
|
+
updatedAt: z.coerce.date()
|
|
142
|
+
}).strict();
|
|
143
|
+
const postViewSchema = postSchema.extend({
|
|
144
|
+
coverUrl: z.string().nullable(),
|
|
145
|
+
author: commentAuthorSchema,
|
|
146
|
+
reactions: reactionCountsSchema,
|
|
147
|
+
viewerReaction: reactionEmojiSchema.nullable(),
|
|
148
|
+
commentCount: z.number().int().min(0),
|
|
149
|
+
following: z.boolean(),
|
|
150
|
+
bookmarked: z.boolean()
|
|
151
|
+
}).strict();
|
|
152
|
+
const flaggedCommentSchema = commentReportSchema.extend({ comment: z.object({
|
|
153
|
+
id: idSchema,
|
|
154
|
+
postId: idSchema,
|
|
155
|
+
body: z.string(),
|
|
156
|
+
orgUserId: idSchema,
|
|
157
|
+
status: commentStatusSchema
|
|
158
|
+
}).strict() }).strict();
|
|
159
|
+
const postReactionSchema = z.object({
|
|
160
|
+
orgId: idSchema,
|
|
161
|
+
postId: idSchema,
|
|
162
|
+
orgUserId: idSchema,
|
|
163
|
+
emoji: reactionEmojiSchema,
|
|
164
|
+
createdAt: z.coerce.date(),
|
|
165
|
+
updatedAt: z.coerce.date()
|
|
166
|
+
}).strict();
|
|
167
|
+
const postFollowSchema = z.object({
|
|
168
|
+
orgId: idSchema,
|
|
169
|
+
postId: idSchema,
|
|
170
|
+
orgUserId: idSchema,
|
|
171
|
+
createdAt: z.coerce.date(),
|
|
172
|
+
updatedAt: z.coerce.date()
|
|
173
|
+
}).strict();
|
|
174
|
+
const postBookmarkSchema = z.object({
|
|
175
|
+
orgId: idSchema,
|
|
176
|
+
postId: idSchema,
|
|
177
|
+
orgUserId: idSchema,
|
|
178
|
+
createdAt: z.coerce.date(),
|
|
179
|
+
updatedAt: z.coerce.date()
|
|
180
|
+
}).strict();
|
|
181
|
+
const postFlagResolutionSchema = z.enum(["dismissed", "removed"]);
|
|
182
|
+
const postFlagSchema = z.object({
|
|
183
|
+
orgId: idSchema,
|
|
184
|
+
id: idSchema,
|
|
185
|
+
postId: idSchema,
|
|
186
|
+
orgUserId: idSchema,
|
|
187
|
+
reason: z.string(),
|
|
188
|
+
resolvedAt: z.coerce.date().nullable(),
|
|
189
|
+
resolution: postFlagResolutionSchema.nullable(),
|
|
190
|
+
resolvedBy: idSchema.nullable(),
|
|
191
|
+
createdAt: z.coerce.date(),
|
|
192
|
+
updatedAt: z.coerce.date()
|
|
193
|
+
}).strict();
|
|
194
|
+
const chatKindSchema = z.enum(["direct", "group"]);
|
|
195
|
+
const chatStatusSchema = z.enum([
|
|
196
|
+
"pending",
|
|
197
|
+
"open",
|
|
198
|
+
"closed"
|
|
199
|
+
]);
|
|
200
|
+
const chatSchema = z.object({
|
|
201
|
+
orgId: idSchema,
|
|
202
|
+
id: idSchema,
|
|
203
|
+
communityId: idSchema,
|
|
204
|
+
kind: chatKindSchema,
|
|
205
|
+
status: chatStatusSchema,
|
|
206
|
+
createdBy: idSchema.nullable(),
|
|
207
|
+
lockedAt: z.coerce.date().nullable(),
|
|
208
|
+
lockedBy: idSchema.nullable(),
|
|
209
|
+
createdAt: z.coerce.date(),
|
|
210
|
+
updatedAt: z.coerce.date()
|
|
211
|
+
}).strict();
|
|
212
|
+
const chatUserSchema = z.object({
|
|
213
|
+
orgId: idSchema,
|
|
214
|
+
communityId: idSchema,
|
|
215
|
+
chatId: idSchema,
|
|
216
|
+
orgUserId: idSchema,
|
|
217
|
+
joinedAt: z.coerce.date(),
|
|
218
|
+
leftAt: z.coerce.date().nullable(),
|
|
219
|
+
lastReadMessageId: idSchema.nullable(),
|
|
220
|
+
muted: z.boolean(),
|
|
221
|
+
mutedUntil: z.coerce.date().nullable(),
|
|
222
|
+
createdAt: z.coerce.date(),
|
|
223
|
+
updatedAt: z.coerce.date()
|
|
224
|
+
}).strict();
|
|
225
|
+
const messageSchema = z.object({
|
|
226
|
+
orgId: idSchema,
|
|
227
|
+
id: idSchema,
|
|
228
|
+
communityId: idSchema,
|
|
229
|
+
chatId: idSchema,
|
|
230
|
+
orgUserId: idSchema,
|
|
231
|
+
body: z.string(),
|
|
232
|
+
replyToId: idSchema.nullable(),
|
|
233
|
+
editedAt: z.coerce.date().nullable(),
|
|
234
|
+
deletedAt: z.coerce.date().nullable(),
|
|
235
|
+
createdAt: z.coerce.date(),
|
|
236
|
+
updatedAt: z.coerce.date()
|
|
237
|
+
}).strict();
|
|
238
|
+
const messageFileSchema = z.object({
|
|
239
|
+
assetId: idSchema,
|
|
240
|
+
url: z.string()
|
|
241
|
+
}).strict();
|
|
242
|
+
const messageViewSchema = messageSchema.extend({
|
|
243
|
+
sender: commentAuthorSchema,
|
|
244
|
+
attachments: z.array(messageFileSchema),
|
|
245
|
+
reactions: reactionCountsSchema,
|
|
246
|
+
viewerReaction: reactionEmojiSchema.nullable()
|
|
247
|
+
}).strict();
|
|
248
|
+
const chatLastMessageSchema = z.object({
|
|
249
|
+
id: idSchema,
|
|
250
|
+
orgUserId: idSchema,
|
|
251
|
+
body: z.string(),
|
|
252
|
+
createdAt: z.coerce.date(),
|
|
253
|
+
deletedAt: z.coerce.date().nullable()
|
|
254
|
+
}).strict();
|
|
255
|
+
const messageAttachmentSchema = z.object({
|
|
256
|
+
orgId: idSchema,
|
|
257
|
+
communityId: idSchema,
|
|
258
|
+
messageId: idSchema,
|
|
259
|
+
assetId: idSchema,
|
|
260
|
+
seq: z.number().int(),
|
|
261
|
+
createdAt: z.coerce.date(),
|
|
262
|
+
updatedAt: z.coerce.date()
|
|
263
|
+
}).strict();
|
|
264
|
+
const messageReactionSchema = z.object({
|
|
265
|
+
orgId: idSchema,
|
|
266
|
+
communityId: idSchema,
|
|
267
|
+
messageId: idSchema,
|
|
268
|
+
orgUserId: idSchema,
|
|
269
|
+
emoji: reactionEmojiSchema,
|
|
270
|
+
createdAt: z.coerce.date(),
|
|
271
|
+
updatedAt: z.coerce.date()
|
|
272
|
+
}).strict();
|
|
273
|
+
const messageFlagResolutionSchema = z.enum([
|
|
274
|
+
"dismissed",
|
|
275
|
+
"deleted",
|
|
276
|
+
"locked"
|
|
277
|
+
]);
|
|
278
|
+
const messageFlagSchema = z.object({
|
|
279
|
+
orgId: idSchema,
|
|
280
|
+
id: idSchema,
|
|
281
|
+
communityId: idSchema,
|
|
282
|
+
messageId: idSchema,
|
|
283
|
+
orgUserId: idSchema,
|
|
284
|
+
reason: z.string(),
|
|
285
|
+
resolvedAt: z.coerce.date().nullable(),
|
|
286
|
+
resolution: messageFlagResolutionSchema.nullable(),
|
|
287
|
+
resolvedBy: idSchema.nullable(),
|
|
288
|
+
createdAt: z.coerce.date(),
|
|
289
|
+
updatedAt: z.coerce.date()
|
|
290
|
+
}).strict();
|
|
291
|
+
const blockedUserSchema = z.object({
|
|
292
|
+
orgId: idSchema,
|
|
293
|
+
communityId: idSchema,
|
|
294
|
+
blockerOrgUserId: idSchema,
|
|
295
|
+
blockedOrgUserId: idSchema,
|
|
296
|
+
createdAt: z.coerce.date(),
|
|
297
|
+
updatedAt: z.coerce.date()
|
|
298
|
+
}).strict();
|
|
104
299
|
//#endregion
|
|
105
|
-
export { activityCommentsRuleSchema, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
|
|
300
|
+
export { activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatSchema, chatStatusSchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, flaggedCommentSchema, listCommentsQuerySchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postFollowSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema };
|
|
106
301
|
|
|
107
302
|
//# sourceMappingURL=discussion.js.map
|
|
@@ -1 +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, emailSchema } 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\n .object({\n enabled: z.boolean(),\n threaded: z.boolean(),\n requireReview: z.boolean(),\n reactions: z.boolean(),\n })\n .strict();\nexport type CommentSettings = z.infer<typeof commentSettingsSchema>;\n\nexport type CommentsConfig = CommentSettings;\n\nexport const activityCommentsRuleSchema = z.enum(['inherit', 'always', 'never']);\nexport type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;\n\nexport const commentSchema = z\n .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 })\n .strict();\nexport type Comment = z.output<typeof commentSchema>;\nexport type CommentInput = z.input<typeof commentSchema>;\n\nexport const commentAuthorSchema = z\n .object({\n id: idSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n image: z.string().nullable(),\n role: roleSchema,\n })\n .strict();\nexport type CommentAuthor = z.infer<typeof commentAuthorSchema>;\n\nexport const commentReactionSchema = z\n .object({\n orgId: idSchema,\n commentId: idSchema,\n orgUserId: idSchema,\n emoji: reactionEmojiSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type CommentReaction = z.output<typeof commentReactionSchema>;\n\nexport const commentReportSchema = z\n .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 updatedAt: z.coerce.date(),\n })\n .strict();\nexport type CommentReport = z.output<typeof commentReportSchema>;\nexport type CommentReportInput = z.input<typeof commentReportSchema>;\n\nexport const commentViewSchema = z\n .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 })\n .strict();\nexport type CommentView = z.output<typeof commentViewSchema>;\n\nexport const commentReportSummarySchema = z\n .object({\n reporter: commentAuthorSchema,\n reason: z.string(),\n createdAt: z.coerce.date(),\n })\n .strict();\nexport type CommentReportSummary = z.output<typeof commentReportSummarySchema>;\n\nexport const commentListItemSchema = z\n .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: emailSchema,\n removedBy: idSchema.nullable(),\n reports: z.array(commentReportSummarySchema),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type CommentListItem = z.output<typeof commentListItemSchema>;\n\nexport const listCommentsQuerySchema = z\n .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 })\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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\nimport { roleSchema } from './organizations.js';\nimport { idSchema, emailSchema, jsonValueSchema } 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\n .object({\n enabled: z.boolean(),\n threaded: z.boolean(),\n requireReview: z.boolean(),\n reactions: z.boolean(),\n })\n .strict();\nexport type CommentSettings = z.infer<typeof commentSettingsSchema>;\n\nexport type CommentsConfig = CommentSettings;\n\nexport const activityCommentsRuleSchema = z.enum(['inherit', 'always', 'never']);\nexport type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;\n\nexport const commentSchema = z\n .object({\n id: idSchema,\n orgId: idSchema,\n activityId: idSchema.nullable(),\n postId: idSchema.nullable(),\n communityId: idSchema.nullable(),\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 })\n .strict();\nexport type Comment = z.output<typeof commentSchema>;\nexport type CommentInput = z.input<typeof commentSchema>;\n\nexport const commentAuthorSchema = z\n .object({\n id: idSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n displayName: z.string().nullable(),\n headline: z.string().nullable(),\n image: z.string().nullable(),\n imageAssetId: idSchema.nullable(),\n imageUrl: z.string().nullable(),\n role: roleSchema,\n })\n .strict();\nexport type CommentAuthor = z.infer<typeof commentAuthorSchema>;\n\nexport const commentReactionSchema = z\n .object({\n orgId: idSchema,\n commentId: idSchema,\n orgUserId: idSchema,\n emoji: reactionEmojiSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type CommentReaction = z.output<typeof commentReactionSchema>;\n\nexport const commentFlagResolutionSchema = z.enum(['dismissed', 'removed']);\nexport type CommentFlagResolution = z.infer<typeof commentFlagResolutionSchema>;\n\nexport const commentReportSchema = z\n .object({\n id: idSchema,\n orgId: idSchema,\n commentId: idSchema,\n orgUserId: idSchema,\n reason: z.string(),\n resolvedAt: z.coerce.date().nullable(),\n resolution: commentFlagResolutionSchema.nullable(),\n resolvedBy: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type CommentReport = z.output<typeof commentReportSchema>;\nexport type CommentReportInput = z.input<typeof commentReportSchema>;\n\nexport const commentViewSchema = z\n .object({\n id: idSchema,\n activityId: idSchema.nullable(),\n postId: idSchema.nullable(),\n communityId: idSchema.nullable(),\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 })\n .strict();\nexport type CommentView = z.output<typeof commentViewSchema>;\n\nexport const commentReportSummarySchema = z\n .object({\n reporter: commentAuthorSchema,\n reason: z.string(),\n createdAt: z.coerce.date(),\n })\n .strict();\nexport type CommentReportSummary = z.output<typeof commentReportSummarySchema>;\n\nexport const commentListItemSchema = z\n .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: emailSchema,\n removedBy: idSchema.nullable(),\n reports: z.array(commentReportSummarySchema),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type CommentListItem = z.output<typeof commentListItemSchema>;\n\nexport const listCommentsQuerySchema = z\n .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 })\n .strict();\nexport type ListCommentsQuery = z.infer<typeof listCommentsQuerySchema>;\n\nexport const postStatusSchema = z.enum(['draft', 'scheduled', 'pending', 'published', 'removed']);\nexport type PostStatus = z.infer<typeof postStatusSchema>;\n\nexport const postSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n communityId: idSchema,\n spaceId: idSchema,\n orgUserId: idSchema,\n topicId: idSchema.nullable(),\n title: z.string(),\n body: z.string(),\n extra: jsonValueSchema,\n coverAssetId: idSchema.nullable(),\n status: postStatusSchema,\n scheduledAt: z.coerce.date().nullable(),\n publishedAt: z.coerce.date().nullable(),\n removedBy: idSchema.nullable(),\n pinned: z.boolean(),\n commentsClosed: z.boolean().nullable(),\n reactionsEnabled: z.boolean().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Post = z.output<typeof postSchema>;\n\nexport const postViewSchema = postSchema\n .extend({\n coverUrl: z.string().nullable(),\n author: commentAuthorSchema,\n reactions: reactionCountsSchema,\n viewerReaction: reactionEmojiSchema.nullable(),\n commentCount: z.number().int().min(0),\n following: z.boolean(),\n bookmarked: z.boolean(),\n })\n .strict();\nexport type PostView = z.output<typeof postViewSchema>;\n\nexport const flaggedCommentSchema = commentReportSchema\n .extend({\n comment: z\n .object({\n id: idSchema,\n postId: idSchema,\n body: z.string(),\n orgUserId: idSchema,\n status: commentStatusSchema,\n })\n .strict(),\n })\n .strict();\nexport type FlaggedComment = z.output<typeof flaggedCommentSchema>;\n\nexport const postReactionSchema = z\n .object({\n orgId: idSchema,\n postId: idSchema,\n orgUserId: idSchema,\n emoji: reactionEmojiSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type PostReaction = z.output<typeof postReactionSchema>;\n\nexport const postFollowSchema = z\n .object({\n orgId: idSchema,\n postId: idSchema,\n orgUserId: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type PostFollow = z.output<typeof postFollowSchema>;\n\nexport const postBookmarkSchema = z\n .object({\n orgId: idSchema,\n postId: idSchema,\n orgUserId: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type PostBookmark = z.output<typeof postBookmarkSchema>;\n\nexport const postFlagResolutionSchema = z.enum(['dismissed', 'removed']);\nexport type PostFlagResolution = z.infer<typeof postFlagResolutionSchema>;\n\nexport const postFlagSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n postId: idSchema,\n orgUserId: idSchema,\n reason: z.string(),\n resolvedAt: z.coerce.date().nullable(),\n resolution: postFlagResolutionSchema.nullable(),\n resolvedBy: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type PostFlag = z.output<typeof postFlagSchema>;\n\nexport const chatKindSchema = z.enum(['direct', 'group']);\nexport type ChatKind = z.infer<typeof chatKindSchema>;\n\nexport const chatStatusSchema = z.enum(['pending', 'open', 'closed']);\nexport type ChatStatus = z.infer<typeof chatStatusSchema>;\n\nexport const chatSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n communityId: idSchema,\n kind: chatKindSchema,\n status: chatStatusSchema,\n createdBy: idSchema.nullable(),\n lockedAt: z.coerce.date().nullable(),\n lockedBy: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Chat = z.output<typeof chatSchema>;\n\nexport const chatUserSchema = z\n .object({\n orgId: idSchema,\n communityId: idSchema,\n chatId: idSchema,\n orgUserId: idSchema,\n joinedAt: z.coerce.date(),\n leftAt: z.coerce.date().nullable(),\n lastReadMessageId: idSchema.nullable(),\n muted: z.boolean(),\n mutedUntil: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type ChatUser = z.output<typeof chatUserSchema>;\n\nexport const messageSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n communityId: idSchema,\n chatId: idSchema,\n orgUserId: idSchema,\n body: z.string(),\n replyToId: idSchema.nullable(),\n editedAt: z.coerce.date().nullable(),\n deletedAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Message = z.output<typeof messageSchema>;\n\nexport const messageFileSchema = z.object({ assetId: idSchema, url: z.string() }).strict();\nexport type MessageFile = z.output<typeof messageFileSchema>;\n\nexport const messageViewSchema = messageSchema\n .extend({\n sender: commentAuthorSchema,\n attachments: z.array(messageFileSchema),\n reactions: reactionCountsSchema,\n viewerReaction: reactionEmojiSchema.nullable(),\n })\n .strict();\nexport type MessageView = z.output<typeof messageViewSchema>;\n\nexport const chatLastMessageSchema = z\n .object({\n id: idSchema,\n orgUserId: idSchema,\n body: z.string(),\n createdAt: z.coerce.date(),\n deletedAt: z.coerce.date().nullable(),\n })\n .strict();\nexport type ChatLastMessage = z.output<typeof chatLastMessageSchema>;\n\nexport const messageAttachmentSchema = z\n .object({\n orgId: idSchema,\n communityId: idSchema,\n messageId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type MessageAttachment = z.output<typeof messageAttachmentSchema>;\n\nexport const messageReactionSchema = z\n .object({\n orgId: idSchema,\n communityId: idSchema,\n messageId: idSchema,\n orgUserId: idSchema,\n emoji: reactionEmojiSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type MessageReaction = z.output<typeof messageReactionSchema>;\n\nexport const messageFlagResolutionSchema = z.enum(['dismissed', 'deleted', 'locked']);\nexport type MessageFlagResolution = z.infer<typeof messageFlagResolutionSchema>;\n\nexport const messageFlagSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n communityId: idSchema,\n messageId: idSchema,\n orgUserId: idSchema,\n reason: z.string(),\n resolvedAt: z.coerce.date().nullable(),\n resolution: messageFlagResolutionSchema.nullable(),\n resolvedBy: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type MessageFlag = z.output<typeof messageFlagSchema>;\n\nexport const blockedUserSchema = z\n .object({\n orgId: idSchema,\n communityId: idSchema,\n blockerOrgUserId: idSchema,\n blockedOrgUserId: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type BlockedUser = z.output<typeof blockedUserSchema>;\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,EAClC,OAAO;CACN,SAAS,EAAE,QAAQ;CACnB,UAAU,EAAE,QAAQ;CACpB,eAAe,EAAE,QAAQ;CACzB,WAAW,EAAE,QAAQ;AACvB,CAAC,CAAC,CACD,OAAO;AAKV,MAAa,6BAA6B,EAAE,KAAK;CAAC;CAAW;CAAU;AAAO,CAAC;AAG/E,MAAa,gBAAgB,EAC1B,OAAO;CACN,IAAI;CACJ,OAAO;CACP,YAAY,SAAS,SAAS;CAC9B,QAAQ,SAAS,SAAS;CAC1B,aAAa,SAAS,SAAS;CAC/B,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,CACD,OAAO;AAIV,MAAa,sBAAsB,EAChC,OAAO;CACN,IAAI;CACJ,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,C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AAGV,MAAa,oBAAoB,EAC9B,OAAO;CACN,OAAO;CACP,aAAa;CACb,kBAAkB;CAClB,kBAAkB;CAClB,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO"}
|
|
@@ -38,8 +38,8 @@ declare const entitlementsQuerySchema: z.ZodObject<{
|
|
|
38
38
|
contentId: z.ZodOptional<z.ZodString>;
|
|
39
39
|
bundleId: z.ZodOptional<z.ZodString>;
|
|
40
40
|
type: z.ZodOptional<z.ZodEnum<{
|
|
41
|
-
download: "download";
|
|
42
41
|
course: "course";
|
|
42
|
+
download: "download";
|
|
43
43
|
}>>;
|
|
44
44
|
}, z.core.$strict>;
|
|
45
45
|
type EntitlementsQuery = z.infer<typeof entitlementsQuerySchema>;
|
|
@@ -51,6 +51,40 @@ declare const grantEntitlementInputSchema: z.ZodObject<{
|
|
|
51
51
|
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
52
52
|
}, z.core.$strict>;
|
|
53
53
|
type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;
|
|
54
|
+
declare const spaceMemberStatusSchema: z.ZodEnum<{
|
|
55
|
+
active: "active";
|
|
56
|
+
revoked: "revoked";
|
|
57
|
+
requested: "requested";
|
|
58
|
+
invited: "invited";
|
|
59
|
+
}>;
|
|
60
|
+
type SpaceMemberStatus = z.infer<typeof spaceMemberStatusSchema>;
|
|
61
|
+
declare const spaceMemberSourceSchema: z.ZodEnum<{
|
|
62
|
+
request: "request";
|
|
63
|
+
invite: "invite";
|
|
64
|
+
manual: "manual";
|
|
65
|
+
}>;
|
|
66
|
+
type SpaceMemberSource = z.infer<typeof spaceMemberSourceSchema>;
|
|
67
|
+
declare const spaceMemberSchema: z.ZodObject<{
|
|
68
|
+
orgId: z.ZodString;
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
communityId: z.ZodString;
|
|
71
|
+
spaceId: z.ZodString;
|
|
72
|
+
orgUserId: z.ZodString;
|
|
73
|
+
status: z.ZodEnum<{
|
|
74
|
+
active: "active";
|
|
75
|
+
revoked: "revoked";
|
|
76
|
+
requested: "requested";
|
|
77
|
+
invited: "invited";
|
|
78
|
+
}>;
|
|
79
|
+
source: z.ZodEnum<{
|
|
80
|
+
request: "request";
|
|
81
|
+
invite: "invite";
|
|
82
|
+
manual: "manual";
|
|
83
|
+
}>;
|
|
84
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
85
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
type SpaceMember = z.output<typeof spaceMemberSchema>;
|
|
54
88
|
//#endregion
|
|
55
|
-
export { Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema };
|
|
89
|
+
export { Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, SpaceMember, SpaceMemberSource, SpaceMemberStatus, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema };
|
|
56
90
|
//# sourceMappingURL=entitlements.d.ts.map
|
|
@@ -38,7 +38,29 @@ const grantEntitlementInputSchema = z.object({
|
|
|
38
38
|
bundleId: idSchema.nullish(),
|
|
39
39
|
expiresAt: z.coerce.date().nullable()
|
|
40
40
|
}).strict().refine((v) => v.contentId != null !== (v.bundleId != null), { message: "Provide exactly one of contentId or bundleId" });
|
|
41
|
+
const spaceMemberStatusSchema = z.enum([
|
|
42
|
+
"requested",
|
|
43
|
+
"invited",
|
|
44
|
+
"active",
|
|
45
|
+
"revoked"
|
|
46
|
+
]);
|
|
47
|
+
const spaceMemberSourceSchema = z.enum([
|
|
48
|
+
"request",
|
|
49
|
+
"invite",
|
|
50
|
+
"manual"
|
|
51
|
+
]);
|
|
52
|
+
const spaceMemberSchema = z.object({
|
|
53
|
+
orgId: idSchema,
|
|
54
|
+
id: idSchema,
|
|
55
|
+
communityId: idSchema,
|
|
56
|
+
spaceId: idSchema,
|
|
57
|
+
orgUserId: idSchema,
|
|
58
|
+
status: spaceMemberStatusSchema,
|
|
59
|
+
source: spaceMemberSourceSchema,
|
|
60
|
+
createdAt: z.coerce.date(),
|
|
61
|
+
updatedAt: z.coerce.date()
|
|
62
|
+
}).strict();
|
|
41
63
|
//#endregion
|
|
42
|
-
export { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema };
|
|
64
|
+
export { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema };
|
|
43
65
|
|
|
44
66
|
//# sourceMappingURL=entitlements.js.map
|
|
@@ -1 +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\n .object({\n orgId: idSchema,\n id: idSchema,\n orgUserId: idSchema,\n bundleId: idSchema.nullable(),\n contentId: idSchema.nullable(),\n status: entitlementStatusSchema,\n source: z.string(),\n grantedAt: z.coerce.date(),\n expiresAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Entitlement = z.output<typeof entitlementSchema>;\nexport type EntitlementInput = z.input<typeof entitlementSchema>;\n\nexport const entitlementsQuerySchema = z\n .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 bundleId: idSchema.optional(),\n type: z.enum(['course', 'download']).optional(),\n })\n .strict();\nexport type EntitlementsQuery = z.infer<typeof entitlementsQuerySchema>;\n\n/** A grant targets exactly one of: a bundle or a single content item. */\nexport const grantEntitlementInputSchema = z\n .object({\n orgUserId: idSchema,\n contentId: idSchema.nullish(),\n bundleId: idSchema.nullish(),\n expiresAt: z.coerce.date().nullable(),\n })\n .strict()\n .refine((v) => (v.contentId != null) !== (v.bundleId != null), {\n message: 'Provide exactly one of contentId or bundleId',\n });\nexport type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;AAGnE,MAAa,oBAAoB,EAC9B,OAAO;CACN,OAAO;CACP,IAAI;CACJ,WAAW;CACX,UAAU,SAAS,SAAS;CAC5B,WAAW,SAAS,SAAS;CAC7B,QAAQ;CACR,QAAQ,EAAE,OAAO;CACjB,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACpC,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,0BAA0B,EACpC,OAAO;CACN,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,UAAU,SAAS,SAAS;CAC5B,MAAM,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC,CAAC,CAAC,SAAS;AAChD,CAAC,CAAC,CACD,OAAO;;AAIV,MAAa,8BAA8B,EACxC,OAAO;CACN,WAAW;CACX,WAAW,SAAS,QAAQ;CAC5B,UAAU,SAAS,QAAQ;CAC3B,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;AACtC,CAAC,CAAC,CACD,OAAO,CAAC,CACR,QAAQ,MAAO,EAAE,aAAa,UAAW,EAAE,YAAY,OAAO,EAC7D,SAAS,+CACX,CAAC"}
|
|
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\n .object({\n orgId: idSchema,\n id: idSchema,\n orgUserId: idSchema,\n bundleId: idSchema.nullable(),\n contentId: idSchema.nullable(),\n status: entitlementStatusSchema,\n source: z.string(),\n grantedAt: z.coerce.date(),\n expiresAt: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Entitlement = z.output<typeof entitlementSchema>;\nexport type EntitlementInput = z.input<typeof entitlementSchema>;\n\nexport const entitlementsQuerySchema = z\n .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 bundleId: idSchema.optional(),\n type: z.enum(['course', 'download']).optional(),\n })\n .strict();\nexport type EntitlementsQuery = z.infer<typeof entitlementsQuerySchema>;\n\n/** A grant targets exactly one of: a bundle or a single content item. */\nexport const grantEntitlementInputSchema = z\n .object({\n orgUserId: idSchema,\n contentId: idSchema.nullish(),\n bundleId: idSchema.nullish(),\n expiresAt: z.coerce.date().nullable(),\n })\n .strict()\n .refine((v) => (v.contentId != null) !== (v.bundleId != null), {\n message: 'Provide exactly one of contentId or bundleId',\n });\nexport type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;\n\nexport const spaceMemberStatusSchema = z.enum(['requested', 'invited', 'active', 'revoked']);\nexport type SpaceMemberStatus = z.infer<typeof spaceMemberStatusSchema>;\n\nexport const spaceMemberSourceSchema = z.enum(['request', 'invite', 'manual']);\nexport type SpaceMemberSource = z.infer<typeof spaceMemberSourceSchema>;\n\nexport const spaceMemberSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n communityId: idSchema,\n spaceId: idSchema,\n orgUserId: idSchema,\n status: spaceMemberStatusSchema,\n source: spaceMemberSourceSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type SpaceMember = z.output<typeof spaceMemberSchema>;\n"],"mappings":";;;AAGA,MAAa,0BAA0B,EAAE,KAAK,CAAC,UAAU,SAAS,CAAC;AAGnE,MAAa,oBAAoB,EAC9B,OAAO;CACN,OAAO;CACP,IAAI;CACJ,WAAW;CACX,UAAU,SAAS,SAAS;CAC5B,WAAW,SAAS,SAAS;CAC7B,QAAQ;CACR,QAAQ,EAAE,OAAO;CACjB,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;CACpC,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,0BAA0B,EACpC,OAAO;CACN,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,UAAU,SAAS,SAAS;CAC5B,MAAM,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC,CAAC,CAAC,SAAS;AAChD,CAAC,CAAC,CACD,OAAO;;AAIV,MAAa,8BAA8B,EACxC,OAAO;CACN,WAAW;CACX,WAAW,SAAS,QAAQ;CAC5B,UAAU,SAAS,QAAQ;CAC3B,WAAW,EAAE,OAAO,KAAK,CAAC,CAAC,SAAS;AACtC,CAAC,CAAC,CACD,OAAO,CAAC,CACR,QAAQ,MAAO,EAAE,aAAa,UAAW,EAAE,YAAY,OAAO,EAC7D,SAAS,+CACX,CAAC;AAGH,MAAa,0BAA0B,EAAE,KAAK;CAAC;CAAa;CAAW;CAAU;AAAS,CAAC;AAG3F,MAAa,0BAA0B,EAAE,KAAK;CAAC;CAAW;CAAU;AAAQ,CAAC;AAG7E,MAAa,oBAAoB,EAC9B,OAAO;CACN,OAAO;CACP,IAAI;CACJ,aAAa;CACb,SAAS;CACT,WAAW;CACX,QAAQ;CACR,QAAQ;CACR,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JsonValue } from "../shared.js";
|
|
1
2
|
import { z } from "zod";
|
|
2
3
|
//#region src/types/schemas/identity.d.ts
|
|
3
4
|
declare const userSchema: z.ZodObject<{
|
|
@@ -32,6 +33,115 @@ declare const updateUserInputSchema: z.ZodObject<{
|
|
|
32
33
|
email: z.ZodOptional<z.ZodEmail>;
|
|
33
34
|
}, z.core.$strict>;
|
|
34
35
|
type UpdateUserInput = z.infer<typeof updateUserInputSchema>;
|
|
36
|
+
declare const userProfileSchema: z.ZodObject<{
|
|
37
|
+
userId: z.ZodString;
|
|
38
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
39
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
40
|
+
bio: z.ZodNullable<z.ZodString>;
|
|
41
|
+
imageAssetOrgId: z.ZodNullable<z.ZodString>;
|
|
42
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
43
|
+
extra: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
44
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
45
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
type UserProfile = z.output<typeof userProfileSchema>;
|
|
48
|
+
declare const userProfileViewSchema: z.ZodObject<{
|
|
49
|
+
userId: z.ZodString;
|
|
50
|
+
displayName: z.ZodNullable<z.ZodString>;
|
|
51
|
+
headline: z.ZodNullable<z.ZodString>;
|
|
52
|
+
bio: z.ZodNullable<z.ZodString>;
|
|
53
|
+
imageAssetOrgId: z.ZodNullable<z.ZodString>;
|
|
54
|
+
imageAssetId: z.ZodNullable<z.ZodString>;
|
|
55
|
+
extra: z.ZodType<JsonValue, unknown, z.core.$ZodTypeInternals<JsonValue, unknown>>;
|
|
56
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
57
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
58
|
+
imageUrl: z.ZodNullable<z.ZodString>;
|
|
59
|
+
}, z.core.$strict>;
|
|
60
|
+
type UserProfileView = z.output<typeof userProfileViewSchema>;
|
|
61
|
+
declare const notificationKindSchema: z.ZodEnum<{
|
|
62
|
+
welcomeToCommunity: "welcomeToCommunity";
|
|
63
|
+
membershipEndingSoon: "membershipEndingSoon";
|
|
64
|
+
newPostInSpace: "newPostInSpace";
|
|
65
|
+
yourPostWasPublished: "yourPostWasPublished";
|
|
66
|
+
yourPostWasRemoved: "yourPostWasRemoved";
|
|
67
|
+
newCommentOnPost: "newCommentOnPost";
|
|
68
|
+
replyToYourComment: "replyToYourComment";
|
|
69
|
+
yourCommentWasRemoved: "yourCommentWasRemoved";
|
|
70
|
+
requestApproved: "requestApproved";
|
|
71
|
+
requestDeclined: "requestDeclined";
|
|
72
|
+
invitedToSpace: "invitedToSpace";
|
|
73
|
+
messageRequest: "messageRequest";
|
|
74
|
+
newMessage: "newMessage";
|
|
75
|
+
addedToGroupChat: "addedToGroupChat";
|
|
76
|
+
youAreNowAModerator: "youAreNowAModerator";
|
|
77
|
+
postAwaitingReview: "postAwaitingReview";
|
|
78
|
+
joinRequest: "joinRequest";
|
|
79
|
+
somethingWasFlagged: "somethingWasFlagged";
|
|
80
|
+
messageWasFlagged: "messageWasFlagged";
|
|
81
|
+
}>;
|
|
82
|
+
type NotificationKind = z.infer<typeof notificationKindSchema>;
|
|
83
|
+
declare const notificationSchema: z.ZodObject<{
|
|
84
|
+
orgId: z.ZodString;
|
|
85
|
+
id: z.ZodString;
|
|
86
|
+
userId: z.ZodString;
|
|
87
|
+
kind: z.ZodEnum<{
|
|
88
|
+
welcomeToCommunity: "welcomeToCommunity";
|
|
89
|
+
membershipEndingSoon: "membershipEndingSoon";
|
|
90
|
+
newPostInSpace: "newPostInSpace";
|
|
91
|
+
yourPostWasPublished: "yourPostWasPublished";
|
|
92
|
+
yourPostWasRemoved: "yourPostWasRemoved";
|
|
93
|
+
newCommentOnPost: "newCommentOnPost";
|
|
94
|
+
replyToYourComment: "replyToYourComment";
|
|
95
|
+
yourCommentWasRemoved: "yourCommentWasRemoved";
|
|
96
|
+
requestApproved: "requestApproved";
|
|
97
|
+
requestDeclined: "requestDeclined";
|
|
98
|
+
invitedToSpace: "invitedToSpace";
|
|
99
|
+
messageRequest: "messageRequest";
|
|
100
|
+
newMessage: "newMessage";
|
|
101
|
+
addedToGroupChat: "addedToGroupChat";
|
|
102
|
+
youAreNowAModerator: "youAreNowAModerator";
|
|
103
|
+
postAwaitingReview: "postAwaitingReview";
|
|
104
|
+
joinRequest: "joinRequest";
|
|
105
|
+
somethingWasFlagged: "somethingWasFlagged";
|
|
106
|
+
messageWasFlagged: "messageWasFlagged";
|
|
107
|
+
}>;
|
|
108
|
+
actorOrgUserId: z.ZodNullable<z.ZodString>;
|
|
109
|
+
communityId: z.ZodNullable<z.ZodString>;
|
|
110
|
+
spaceId: z.ZodNullable<z.ZodString>;
|
|
111
|
+
postId: z.ZodNullable<z.ZodString>;
|
|
112
|
+
commentId: z.ZodNullable<z.ZodString>;
|
|
113
|
+
chatId: z.ZodNullable<z.ZodString>;
|
|
114
|
+
messageId: z.ZodNullable<z.ZodString>;
|
|
115
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
116
|
+
readAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
type Notification = z.output<typeof notificationSchema>;
|
|
119
|
+
declare const notificationPreferenceSchema: z.ZodObject<{
|
|
120
|
+
kind: z.ZodEnum<{
|
|
121
|
+
welcomeToCommunity: "welcomeToCommunity";
|
|
122
|
+
membershipEndingSoon: "membershipEndingSoon";
|
|
123
|
+
newPostInSpace: "newPostInSpace";
|
|
124
|
+
yourPostWasPublished: "yourPostWasPublished";
|
|
125
|
+
yourPostWasRemoved: "yourPostWasRemoved";
|
|
126
|
+
newCommentOnPost: "newCommentOnPost";
|
|
127
|
+
replyToYourComment: "replyToYourComment";
|
|
128
|
+
yourCommentWasRemoved: "yourCommentWasRemoved";
|
|
129
|
+
requestApproved: "requestApproved";
|
|
130
|
+
requestDeclined: "requestDeclined";
|
|
131
|
+
invitedToSpace: "invitedToSpace";
|
|
132
|
+
messageRequest: "messageRequest";
|
|
133
|
+
newMessage: "newMessage";
|
|
134
|
+
addedToGroupChat: "addedToGroupChat";
|
|
135
|
+
youAreNowAModerator: "youAreNowAModerator";
|
|
136
|
+
postAwaitingReview: "postAwaitingReview";
|
|
137
|
+
joinRequest: "joinRequest";
|
|
138
|
+
somethingWasFlagged: "somethingWasFlagged";
|
|
139
|
+
messageWasFlagged: "messageWasFlagged";
|
|
140
|
+
}>;
|
|
141
|
+
inApp: z.ZodBoolean;
|
|
142
|
+
email: z.ZodBoolean;
|
|
143
|
+
}, z.core.$strict>;
|
|
144
|
+
type NotificationPreference = z.output<typeof notificationPreferenceSchema>;
|
|
35
145
|
//#endregion
|
|
36
|
-
export { CreateUserInput, ProvisionUserInput, UpdateUserInput, User, UserInput, createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema };
|
|
146
|
+
export { CreateUserInput, Notification, NotificationKind, NotificationPreference, ProvisionUserInput, UpdateUserInput, User, UserInput, UserProfile, UserProfileView, createUserInputSchema, notificationKindSchema, notificationPreferenceSchema, notificationSchema, provisionUserInputSchema, updateUserInputSchema, userProfileSchema, userProfileViewSchema, userSchema };
|
|
37
147
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emailSchema, idSchema } from "./shared.js";
|
|
1
|
+
import { emailSchema, idSchema, jsonValueSchema } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/types/schemas/identity.ts
|
|
4
4
|
const userSchema = z.object({
|
|
@@ -28,7 +28,60 @@ const updateUserInputSchema = z.object({
|
|
|
28
28
|
lastName: z.string().optional(),
|
|
29
29
|
email: emailSchema.optional()
|
|
30
30
|
}).strict();
|
|
31
|
+
const userProfileSchema = z.object({
|
|
32
|
+
userId: idSchema,
|
|
33
|
+
displayName: z.string().nullable(),
|
|
34
|
+
headline: z.string().nullable(),
|
|
35
|
+
bio: z.string().nullable(),
|
|
36
|
+
imageAssetOrgId: idSchema.nullable(),
|
|
37
|
+
imageAssetId: idSchema.nullable(),
|
|
38
|
+
extra: jsonValueSchema,
|
|
39
|
+
createdAt: z.coerce.date(),
|
|
40
|
+
updatedAt: z.coerce.date()
|
|
41
|
+
}).strict();
|
|
42
|
+
const userProfileViewSchema = userProfileSchema.extend({ imageUrl: z.string().nullable() }).strict();
|
|
43
|
+
const notificationKindSchema = z.enum([
|
|
44
|
+
"newPostInSpace",
|
|
45
|
+
"newCommentOnPost",
|
|
46
|
+
"replyToYourComment",
|
|
47
|
+
"yourPostWasPublished",
|
|
48
|
+
"yourPostWasRemoved",
|
|
49
|
+
"yourCommentWasRemoved",
|
|
50
|
+
"requestApproved",
|
|
51
|
+
"requestDeclined",
|
|
52
|
+
"invitedToSpace",
|
|
53
|
+
"newMessage",
|
|
54
|
+
"messageRequest",
|
|
55
|
+
"addedToGroupChat",
|
|
56
|
+
"youAreNowAModerator",
|
|
57
|
+
"membershipEndingSoon",
|
|
58
|
+
"welcomeToCommunity",
|
|
59
|
+
"postAwaitingReview",
|
|
60
|
+
"joinRequest",
|
|
61
|
+
"somethingWasFlagged",
|
|
62
|
+
"messageWasFlagged"
|
|
63
|
+
]);
|
|
64
|
+
const notificationSchema = z.object({
|
|
65
|
+
orgId: idSchema,
|
|
66
|
+
id: idSchema,
|
|
67
|
+
userId: idSchema,
|
|
68
|
+
kind: notificationKindSchema,
|
|
69
|
+
actorOrgUserId: idSchema.nullable(),
|
|
70
|
+
communityId: idSchema.nullable(),
|
|
71
|
+
spaceId: idSchema.nullable(),
|
|
72
|
+
postId: idSchema.nullable(),
|
|
73
|
+
commentId: idSchema.nullable(),
|
|
74
|
+
chatId: idSchema.nullable(),
|
|
75
|
+
messageId: idSchema.nullable(),
|
|
76
|
+
createdAt: z.coerce.date(),
|
|
77
|
+
readAt: z.coerce.date().nullable()
|
|
78
|
+
}).strict();
|
|
79
|
+
const notificationPreferenceSchema = z.object({
|
|
80
|
+
kind: notificationKindSchema,
|
|
81
|
+
inApp: z.boolean(),
|
|
82
|
+
email: z.boolean()
|
|
83
|
+
}).strict();
|
|
31
84
|
//#endregion
|
|
32
|
-
export { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema };
|
|
85
|
+
export { createUserInputSchema, notificationKindSchema, notificationPreferenceSchema, notificationSchema, provisionUserInputSchema, updateUserInputSchema, userProfileSchema, userProfileViewSchema, userSchema };
|
|
33
86
|
|
|
34
87
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","names":[],"sources":["../../../src/types/schemas/identity.ts"],"sourcesContent":["import { z } from 'zod';\nimport { idSchema, emailSchema } from './shared.js';\n\nexport const userSchema = z\n .object({\n id: idSchema,\n externalId: idSchema.nullable(),\n email: emailSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type User = z.output<typeof userSchema>;\nexport type UserInput = z.input<typeof userSchema>;\n\nexport const createUserInputSchema = z\n .object({\n id: idSchema.optional(),\n externalId: idSchema.optional(),\n email: emailSchema,\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n })\n .strict();\nexport type CreateUserInput = z.infer<typeof createUserInputSchema>;\n\nexport const provisionUserInputSchema = z\n .object({\n email: emailSchema,\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n })\n .strict();\nexport type ProvisionUserInput = z.infer<typeof provisionUserInputSchema>;\n\nexport const updateUserInputSchema = z\n .object({\n externalId: idSchema.optional(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n email: emailSchema.optional(),\n })\n .strict();\nexport type UpdateUserInput = z.infer<typeof updateUserInputSchema>;\n"],"mappings":";;;AAGA,MAAa,aAAa,EACvB,OAAO;CACN,IAAI;CACJ,YAAY,SAAS,SAAS;CAC9B,OAAO;CACP,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,CACD,OAAO;AAIV,MAAa,wBAAwB,EAClC,OAAO;CACN,IAAI,SAAS,SAAS;CACtB,YAAY,SAAS,SAAS;CAC9B,OAAO;CACP,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,2BAA2B,EACrC,OAAO;CACN,OAAO;CACP,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,wBAAwB,EAClC,OAAO;CACN,YAAY,SAAS,SAAS;CAC9B,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO,YAAY,SAAS;AAC9B,CAAC,CAAC,CACD,OAAO"}
|
|
1
|
+
{"version":3,"file":"identity.js","names":[],"sources":["../../../src/types/schemas/identity.ts"],"sourcesContent":["import { z } from 'zod';\nimport { idSchema, emailSchema, jsonValueSchema } from './shared.js';\n\nexport const userSchema = z\n .object({\n id: idSchema,\n externalId: idSchema.nullable(),\n email: emailSchema,\n firstName: z.string().nullable(),\n lastName: z.string().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type User = z.output<typeof userSchema>;\nexport type UserInput = z.input<typeof userSchema>;\n\nexport const createUserInputSchema = z\n .object({\n id: idSchema.optional(),\n externalId: idSchema.optional(),\n email: emailSchema,\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n })\n .strict();\nexport type CreateUserInput = z.infer<typeof createUserInputSchema>;\n\nexport const provisionUserInputSchema = z\n .object({\n email: emailSchema,\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n })\n .strict();\nexport type ProvisionUserInput = z.infer<typeof provisionUserInputSchema>;\n\nexport const updateUserInputSchema = z\n .object({\n externalId: idSchema.optional(),\n firstName: z.string().optional(),\n lastName: z.string().optional(),\n email: emailSchema.optional(),\n })\n .strict();\nexport type UpdateUserInput = z.infer<typeof updateUserInputSchema>;\n\nexport const userProfileSchema = z\n .object({\n userId: idSchema,\n displayName: z.string().nullable(),\n headline: z.string().nullable(),\n bio: z.string().nullable(),\n imageAssetOrgId: idSchema.nullable(),\n imageAssetId: idSchema.nullable(),\n extra: jsonValueSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type UserProfile = z.output<typeof userProfileSchema>;\n\nexport const userProfileViewSchema = userProfileSchema\n .extend({ imageUrl: z.string().nullable() })\n .strict();\nexport type UserProfileView = z.output<typeof userProfileViewSchema>;\n\nexport const notificationKindSchema = z.enum([\n 'newPostInSpace',\n 'newCommentOnPost',\n 'replyToYourComment',\n 'yourPostWasPublished',\n 'yourPostWasRemoved',\n 'yourCommentWasRemoved',\n 'requestApproved',\n 'requestDeclined',\n 'invitedToSpace',\n 'newMessage',\n 'messageRequest',\n 'addedToGroupChat',\n 'youAreNowAModerator',\n 'membershipEndingSoon',\n 'welcomeToCommunity',\n 'postAwaitingReview',\n 'joinRequest',\n 'somethingWasFlagged',\n 'messageWasFlagged',\n]);\nexport type NotificationKind = z.infer<typeof notificationKindSchema>;\n\nexport const notificationSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n userId: idSchema,\n kind: notificationKindSchema,\n actorOrgUserId: idSchema.nullable(),\n communityId: idSchema.nullable(),\n spaceId: idSchema.nullable(),\n postId: idSchema.nullable(),\n commentId: idSchema.nullable(),\n chatId: idSchema.nullable(),\n messageId: idSchema.nullable(),\n createdAt: z.coerce.date(),\n readAt: z.coerce.date().nullable(),\n })\n .strict();\nexport type Notification = z.output<typeof notificationSchema>;\n\nexport const notificationPreferenceSchema = z\n .object({\n kind: notificationKindSchema,\n inApp: z.boolean(),\n email: z.boolean(),\n })\n .strict();\nexport type NotificationPreference = z.output<typeof notificationPreferenceSchema>;\n"],"mappings":";;;AAGA,MAAa,aAAa,EACvB,OAAO;CACN,IAAI;CACJ,YAAY,SAAS,SAAS;CAC9B,OAAO;CACP,WAAW,EAAE,OAAO,CAAC,CAAC,SAAS;CAC/B,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,WAAW,EAAE,OAAO,KAAK;C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