@headless-lms/core 0.3.0 → 0.5.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 +24 -18
- package/dist/assets/file-urls.d.ts +11 -7
- package/dist/assets/file-urls.js +14 -4
- package/dist/assets/file-urls.js.map +1 -1
- package/dist/assets/index.d.ts +5 -4
- package/dist/assets/index.js +4 -3
- package/dist/assets/jobs.d.ts +15 -0
- package/dist/assets/jobs.js +30 -0
- package/dist/assets/jobs.js.map +1 -0
- package/dist/assets/ports.d.ts +37 -17
- package/dist/assets/service.d.ts +30 -15
- package/dist/assets/service.js +229 -59
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.js +2 -63
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.d.ts +1 -2
- package/dist/automations/catalog.js +137 -65
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/community-derivations.js +20 -20
- package/dist/automations/community-derivations.js.map +1 -1
- package/dist/automations/community-mail.d.ts +36 -20
- package/dist/automations/community-mail.js +32 -24
- package/dist/automations/community-mail.js.map +1 -1
- package/dist/automations/event-permissions.d.ts +12 -0
- package/dist/automations/event-permissions.js +38 -0
- package/dist/automations/event-permissions.js.map +1 -0
- package/dist/automations/events.d.ts +0 -10
- package/dist/automations/index.d.ts +12 -4
- package/dist/automations/index.js +9 -1
- package/dist/automations/notifications/applicable.d.ts +8 -0
- package/dist/automations/notifications/applicable.js +12 -0
- package/dist/automations/notifications/applicable.js.map +1 -0
- package/dist/automations/notifications/debounce.d.ts +25 -0
- package/dist/automations/notifications/debounce.js +93 -0
- package/dist/automations/notifications/debounce.js.map +1 -0
- package/dist/automations/notifications/defaults.d.ts +8 -0
- package/dist/automations/notifications/defaults.js +346 -0
- package/dist/automations/notifications/defaults.js.map +1 -0
- package/dist/automations/notifications/delivery.d.ts +28 -0
- package/dist/automations/notifications/delivery.js +88 -0
- package/dist/automations/notifications/delivery.js.map +1 -0
- package/dist/automations/notifications/processor.d.ts +64 -0
- package/dist/automations/notifications/processor.js +270 -0
- package/dist/automations/notifications/processor.js.map +1 -0
- package/dist/automations/notifications/rules/content.d.ts +6 -0
- package/dist/automations/notifications/rules/content.js +96 -0
- package/dist/automations/notifications/rules/content.js.map +1 -0
- package/dist/automations/notifications/rules/discussion.d.ts +7 -0
- package/dist/automations/notifications/rules/discussion.js +678 -0
- package/dist/automations/notifications/rules/discussion.js.map +1 -0
- package/dist/automations/notifications/rules/entitlements.d.ts +6 -0
- package/dist/automations/notifications/rules/entitlements.js +276 -0
- package/dist/automations/notifications/rules/entitlements.js.map +1 -0
- package/dist/automations/notifications/rules/events.d.ts +9 -0
- package/dist/automations/notifications/rules/events.js +27 -0
- package/dist/automations/notifications/rules/events.js.map +1 -0
- package/dist/automations/notifications/rules/index.d.ts +6 -0
- package/dist/automations/notifications/rules/index.js +15 -0
- package/dist/automations/notifications/rules/index.js.map +1 -0
- package/dist/automations/notifications/rules/organizations.d.ts +6 -0
- package/dist/automations/notifications/rules/organizations.js +35 -0
- package/dist/automations/notifications/rules/organizations.js.map +1 -0
- package/dist/automations/notifications/rules/recipients.d.ts +32 -0
- package/dist/automations/notifications/rules/recipients.js +98 -0
- package/dist/automations/notifications/rules/recipients.js.map +1 -0
- package/dist/automations/notifications/service.d.ts +29 -0
- package/dist/automations/notifications/service.js +45 -0
- package/dist/automations/notifications/service.js.map +1 -0
- package/dist/automations/notifications/types.d.ts +7 -0
- package/dist/automations/notifications/types.js +560 -0
- package/dist/automations/notifications/types.js.map +1 -0
- package/dist/automations/ports.d.ts +134 -21
- package/dist/automations/service.d.ts +30 -30
- package/dist/automations/service.js +111 -144
- package/dist/automations/service.js.map +1 -1
- package/dist/content/event-sight.d.ts +11 -0
- package/dist/content/event-sight.js +11 -0
- package/dist/content/event-sight.js.map +1 -0
- package/dist/content/events.d.ts +437 -46
- package/dist/content/events.js +45 -1
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +8 -4
- package/dist/content/index.js +5 -1
- package/dist/content/jobs.d.ts +16 -0
- package/dist/content/jobs.js +37 -0
- package/dist/content/jobs.js.map +1 -0
- package/dist/content/model.d.ts +2 -2
- package/dist/content/notification-categories.d.ts +37 -0
- package/dist/content/notification-categories.js +73 -0
- package/dist/content/notification-categories.js.map +1 -0
- package/dist/content/ports.d.ts +132 -68
- package/dist/content/service.d.ts +100 -68
- package/dist/content/service.js +703 -146
- package/dist/content/service.js.map +1 -1
- package/dist/content/titles.d.ts +25 -0
- package/dist/content/titles.js +82 -0
- package/dist/content/titles.js.map +1 -0
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/authors.d.ts +4 -2
- package/dist/discussion/authors.js +9 -5
- package/dist/discussion/authors.js.map +1 -1
- package/dist/discussion/chats.d.ts +63 -39
- package/dist/discussion/chats.js +455 -190
- package/dist/discussion/chats.js.map +1 -1
- package/dist/discussion/digests.d.ts +24 -0
- package/dist/discussion/digests.js +104 -0
- package/dist/discussion/digests.js.map +1 -0
- package/dist/discussion/events.d.ts +227 -23
- package/dist/discussion/events.js +114 -19
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/index.d.ts +12 -4
- package/dist/discussion/index.js +9 -2
- package/dist/discussion/jobs.d.ts +16 -0
- package/dist/discussion/jobs.js +40 -0
- package/dist/discussion/jobs.js.map +1 -0
- package/dist/discussion/live.d.ts +106 -0
- package/dist/discussion/live.js +642 -0
- package/dist/discussion/live.js.map +1 -0
- package/dist/discussion/mentions.d.ts +11 -0
- package/dist/discussion/mentions.js +35 -0
- package/dist/discussion/mentions.js.map +1 -0
- package/dist/discussion/ports.d.ts +279 -114
- package/dist/discussion/ports.js.map +1 -1
- package/dist/discussion/posts.d.ts +60 -44
- package/dist/discussion/posts.js +453 -287
- package/dist/discussion/posts.js.map +1 -1
- package/dist/discussion/rules.d.ts +18 -0
- package/dist/discussion/rules.js +22 -0
- package/dist/discussion/rules.js.map +1 -0
- package/dist/discussion/service.d.ts +50 -35
- package/dist/discussion/service.js +333 -205
- package/dist/discussion/service.js.map +1 -1
- package/dist/discussion/subscriptions.d.ts +37 -0
- package/dist/discussion/subscriptions.js +115 -0
- package/dist/discussion/subscriptions.js.map +1 -0
- package/dist/discussion/titles.d.ts +28 -0
- package/dist/discussion/titles.js +98 -0
- package/dist/discussion/titles.js.map +1 -0
- package/dist/entitlements/events.d.ts +20 -20
- package/dist/entitlements/index.d.ts +5 -4
- package/dist/entitlements/index.js +3 -2
- package/dist/entitlements/jobs.d.ts +12 -0
- package/dist/entitlements/jobs.js +18 -0
- package/dist/entitlements/jobs.js.map +1 -0
- package/dist/entitlements/model.d.ts +2 -2
- package/dist/entitlements/ports.d.ts +68 -38
- package/dist/entitlements/rules.d.ts +3 -6
- package/dist/entitlements/rules.js +5 -10
- package/dist/entitlements/rules.js.map +1 -1
- package/dist/entitlements/service.d.ts +43 -28
- package/dist/entitlements/service.js +387 -160
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/devices.d.ts +30 -0
- package/dist/identity/devices.js +109 -0
- package/dist/identity/devices.js.map +1 -0
- package/dist/identity/index.d.ts +6 -5
- package/dist/identity/index.js +4 -3
- package/dist/identity/model.d.ts +2 -2
- package/dist/identity/notification-settings.d.ts +28 -0
- package/dist/identity/notification-settings.js +114 -0
- package/dist/identity/notification-settings.js.map +1 -0
- package/dist/identity/ports.d.ts +80 -56
- package/dist/identity/service.d.ts +8 -7
- package/dist/identity/service.js +17 -13
- package/dist/identity/service.js.map +1 -1
- package/dist/integrations/ports.d.ts +9 -8
- package/dist/integrations/service.d.ts +9 -8
- package/dist/integrations/service.js +33 -16
- package/dist/integrations/service.js.map +1 -1
- package/dist/organizations/default-roles.d.ts +22 -0
- package/dist/organizations/default-roles.js +89 -0
- package/dist/organizations/default-roles.js.map +1 -0
- package/dist/organizations/effective-permissions.d.ts +45 -0
- package/dist/organizations/effective-permissions.js +113 -0
- package/dist/organizations/effective-permissions.js.map +1 -0
- package/dist/organizations/events.d.ts +320 -181
- package/dist/organizations/events.js +90 -18
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +15 -10
- package/dist/organizations/index.js +8 -3
- package/dist/organizations/members.d.ts +66 -8
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/notification-catalog.d.ts +31 -0
- package/dist/organizations/notification-catalog.js +32 -0
- package/dist/organizations/notification-catalog.js.map +1 -0
- package/dist/organizations/notification-categories.d.ts +34 -0
- package/dist/organizations/notification-categories.js +66 -0
- package/dist/organizations/notification-categories.js.map +1 -0
- package/dist/organizations/org-roles.d.ts +33 -0
- package/dist/organizations/org-roles.js +49 -0
- package/dist/organizations/org-roles.js.map +1 -0
- package/dist/organizations/permissions.d.ts +311 -0
- package/dist/organizations/permissions.js +327 -0
- package/dist/organizations/permissions.js.map +1 -0
- package/dist/organizations/ports.d.ts +187 -65
- package/dist/organizations/service.d.ts +104 -35
- package/dist/organizations/service.js +1247 -323
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/testing.d.ts +18 -0
- package/dist/organizations/testing.js +37 -0
- package/dist/organizations/testing.js.map +1 -0
- package/dist/organizations/types.d.ts +5 -16
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/ports.d.ts +11 -3
- package/dist/progress/service.d.ts +6 -5
- package/dist/progress/service.js +23 -8
- package/dist/progress/service.js.map +1 -1
- package/dist/reporting/admin/index.d.ts +6 -4
- package/dist/reporting/admin/model.d.ts +36 -3
- package/dist/reporting/admin/ports.d.ts +39 -14
- package/dist/reporting/admin/service.d.ts +32 -11
- package/dist/reporting/admin/service.js +102 -18
- package/dist/reporting/admin/service.js.map +1 -1
- package/dist/reporting/events/index.d.ts +27 -0
- package/dist/reporting/events/index.js +20 -0
- package/dist/reporting/events/index.js.map +1 -0
- package/dist/reporting/member/calendar.d.ts +11 -0
- package/dist/reporting/member/calendar.js +75 -0
- package/dist/reporting/member/calendar.js.map +1 -0
- package/dist/reporting/member/index.d.ts +3 -2
- package/dist/reporting/member/model.d.ts +80 -26
- package/dist/reporting/member/ports.d.ts +50 -28
- package/dist/reporting/member/service.d.ts +81 -35
- package/dist/reporting/member/service.js +438 -145
- package/dist/reporting/member/service.js.map +1 -1
- package/dist/shared/actor.d.ts +22 -3
- package/dist/shared/errors.d.ts +15 -2
- package/dist/shared/errors.js +21 -2
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/id.d.ts +7 -0
- package/dist/shared/id.js +8 -1
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/logger.d.ts +2 -1
- package/dist/shared/logger.js +10 -1
- package/dist/shared/logger.js.map +1 -1
- package/dist/shared/mailer.d.ts +11 -1
- package/dist/shared/mailer.js +32 -5
- package/dist/shared/mailer.js.map +1 -1
- package/dist/shared/notification-categories.d.ts +16 -0
- package/dist/shared/notification-categories.js +94 -0
- package/dist/shared/notification-categories.js.map +1 -0
- package/dist/shared/notification-settings.d.ts +14 -0
- package/dist/shared/notification-settings.js +61 -0
- package/dist/shared/notification-settings.js.map +1 -0
- package/dist/shared/ports.d.ts +68 -2
- package/dist/shared/settings.d.ts +2 -1
- package/dist/shared/settings.js +1 -0
- package/dist/shared/settings.js.map +1 -1
- package/dist/types/automations.d.ts +8 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +4 -5
- package/dist/types/email-templates.d.ts +119 -6
- package/dist/types/entitlements.d.ts +2 -2
- package/dist/types/identity.d.ts +14 -17
- package/dist/types/index.d.ts +13 -12
- package/dist/types/index.js +2 -1
- package/dist/types/notifications.d.ts +157 -0
- package/dist/types/notifications.js +1 -0
- package/dist/types/organizations.d.ts +3 -2
- package/dist/types/ports.d.ts +8 -1
- package/dist/types/ports.js +7 -1
- package/dist/types/ports.js.map +1 -0
- package/dist/types/schemas/assets.d.ts +5 -5
- package/dist/types/schemas/assets.js +4 -3
- package/dist/types/schemas/assets.js.map +1 -1
- package/dist/types/schemas/automations.d.ts +1 -10
- package/dist/types/schemas/automations.js +1 -3
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +596 -11
- package/dist/types/schemas/content.js +225 -9
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +362 -66
- package/dist/types/schemas/discussion.js +123 -15
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/entitlements.d.ts +14 -1
- package/dist/types/schemas/entitlements.js +11 -4
- package/dist/types/schemas/entitlements.js.map +1 -1
- package/dist/types/schemas/identity.d.ts +1 -85
- package/dist/types/schemas/identity.js +1 -42
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +8 -7
- package/dist/types/schemas/index.js +8 -7
- package/dist/types/schemas/notifications.d.ts +96 -0
- package/dist/types/schemas/notifications.js +57 -0
- package/dist/types/schemas/notifications.js.map +1 -0
- package/dist/types/schemas/organizations.d.ts +96 -60
- package/dist/types/schemas/organizations.js +78 -27
- package/dist/types/schemas/organizations.js.map +1 -1
- package/dist/types/schemas/progress.d.ts +0 -1
- package/dist/types/schemas/progress.js +0 -1
- package/dist/types/schemas/progress.js.map +1 -1
- package/package.json +1 -1
- package/dist/automations/community-notifications.d.ts +0 -16
- package/dist/automations/community-notifications.js +0 -84
- package/dist/automations/community-notifications.js.map +0 -1
- package/dist/automations/seeds.d.ts +0 -17
- package/dist/automations/seeds.js +0 -235
- package/dist/automations/seeds.js.map +0 -1
- package/dist/identity/notifications.d.ts +0 -27
- package/dist/identity/notifications.js +0 -101
- package/dist/identity/notifications.js.map +0 -1
- package/dist/organizations/access-scopes.d.ts +0 -19
- package/dist/organizations/access-scopes.js +0 -89
- package/dist/organizations/access-scopes.js.map +0 -1
- package/dist/organizations/roles.d.ts +0 -19
- package/dist/organizations/roles.js +0 -82
- package/dist/organizations/roles.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { emailSchema, idSchema, jsonValueSchema } from "./shared.js";
|
|
2
|
-
import {
|
|
2
|
+
import { assetKindSchema } from "./assets.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/types/schemas/discussion.ts
|
|
5
5
|
const commentStatusSchema = z.enum([
|
|
@@ -43,7 +43,8 @@ const commentAuthorSchema = z.object({
|
|
|
43
43
|
image: z.string().nullable(),
|
|
44
44
|
imageAssetId: idSchema.nullable(),
|
|
45
45
|
imageUrl: z.string().nullable(),
|
|
46
|
-
|
|
46
|
+
team: z.boolean(),
|
|
47
|
+
roleName: z.string().nullable()
|
|
47
48
|
}).strict();
|
|
48
49
|
const commentReactionSchema = z.object({
|
|
49
50
|
orgId: idSchema,
|
|
@@ -66,6 +67,22 @@ const commentReportSchema = z.object({
|
|
|
66
67
|
createdAt: z.coerce.date(),
|
|
67
68
|
updatedAt: z.coerce.date()
|
|
68
69
|
}).strict();
|
|
70
|
+
const mentionItemTypeSchema = z.enum([
|
|
71
|
+
"post",
|
|
72
|
+
"comment",
|
|
73
|
+
"message"
|
|
74
|
+
]);
|
|
75
|
+
const mentionSchema = z.object({
|
|
76
|
+
orgId: idSchema,
|
|
77
|
+
itemType: mentionItemTypeSchema,
|
|
78
|
+
itemId: idSchema,
|
|
79
|
+
orgUserId: idSchema,
|
|
80
|
+
createdAt: z.coerce.date()
|
|
81
|
+
}).strict();
|
|
82
|
+
const mentionViewSchema = z.object({
|
|
83
|
+
orgUserId: idSchema,
|
|
84
|
+
name: z.string()
|
|
85
|
+
}).strict();
|
|
69
86
|
const commentViewSchema = z.object({
|
|
70
87
|
id: idSchema,
|
|
71
88
|
activityId: idSchema.nullable(),
|
|
@@ -78,6 +95,7 @@ const commentViewSchema = z.object({
|
|
|
78
95
|
removedBy: commentAuthorSchema.nullable(),
|
|
79
96
|
reactions: reactionCountsSchema,
|
|
80
97
|
viewerReaction: reactionEmojiSchema.optional(),
|
|
98
|
+
mentions: z.array(mentionViewSchema),
|
|
81
99
|
createdAt: z.coerce.date(),
|
|
82
100
|
updatedAt: z.coerce.date()
|
|
83
101
|
}).strict();
|
|
@@ -112,6 +130,25 @@ const listCommentsQuerySchema = z.object({
|
|
|
112
130
|
activityId: idSchema.optional(),
|
|
113
131
|
orgUserId: idSchema.optional()
|
|
114
132
|
}).strict();
|
|
133
|
+
const subscriptionItemTypeSchema = z.enum([
|
|
134
|
+
"post",
|
|
135
|
+
"space",
|
|
136
|
+
"chat"
|
|
137
|
+
]);
|
|
138
|
+
const subscriptionStateSchema = z.enum(["following", "muted"]);
|
|
139
|
+
const subscriptionSchema = z.object({
|
|
140
|
+
orgId: idSchema,
|
|
141
|
+
orgUserId: idSchema,
|
|
142
|
+
itemType: subscriptionItemTypeSchema,
|
|
143
|
+
itemId: idSchema,
|
|
144
|
+
state: subscriptionStateSchema,
|
|
145
|
+
mutedUntil: z.coerce.date().nullable(),
|
|
146
|
+
createdAt: z.coerce.date()
|
|
147
|
+
}).strict();
|
|
148
|
+
const subscriptionViewSchema = z.object({
|
|
149
|
+
state: subscriptionStateSchema,
|
|
150
|
+
mutedUntil: z.coerce.date().nullable()
|
|
151
|
+
}).strict();
|
|
115
152
|
const postStatusSchema = z.enum([
|
|
116
153
|
"draft",
|
|
117
154
|
"scheduled",
|
|
@@ -140,14 +177,22 @@ const postSchema = z.object({
|
|
|
140
177
|
createdAt: z.coerce.date(),
|
|
141
178
|
updatedAt: z.coerce.date()
|
|
142
179
|
}).strict();
|
|
180
|
+
const postAssetSchema = z.object({
|
|
181
|
+
url: z.string(),
|
|
182
|
+
kind: assetKindSchema,
|
|
183
|
+
filename: z.string(),
|
|
184
|
+
size: z.number().int().min(0)
|
|
185
|
+
}).strict();
|
|
143
186
|
const postViewSchema = postSchema.extend({
|
|
144
187
|
coverUrl: z.string().nullable(),
|
|
188
|
+
assets: z.record(idSchema, postAssetSchema),
|
|
145
189
|
author: commentAuthorSchema,
|
|
146
190
|
reactions: reactionCountsSchema,
|
|
147
191
|
viewerReaction: reactionEmojiSchema.nullable(),
|
|
148
192
|
commentCount: z.number().int().min(0),
|
|
149
|
-
|
|
150
|
-
bookmarked: z.boolean()
|
|
193
|
+
subscription: subscriptionViewSchema.nullable(),
|
|
194
|
+
bookmarked: z.boolean(),
|
|
195
|
+
mentions: z.array(mentionViewSchema)
|
|
151
196
|
}).strict();
|
|
152
197
|
const flaggedCommentSchema = commentReportSchema.extend({ comment: z.object({
|
|
153
198
|
id: idSchema,
|
|
@@ -156,6 +201,7 @@ const flaggedCommentSchema = commentReportSchema.extend({ comment: z.object({
|
|
|
156
201
|
orgUserId: idSchema,
|
|
157
202
|
status: commentStatusSchema
|
|
158
203
|
}).strict() }).strict();
|
|
204
|
+
const flaggedCommentViewSchema = commentReportSchema.extend({ comment: flaggedCommentSchema.shape.comment.extend({ author: commentAuthorSchema }).strict() }).strict();
|
|
159
205
|
const postReactionSchema = z.object({
|
|
160
206
|
orgId: idSchema,
|
|
161
207
|
postId: idSchema,
|
|
@@ -164,13 +210,6 @@ const postReactionSchema = z.object({
|
|
|
164
210
|
createdAt: z.coerce.date(),
|
|
165
211
|
updatedAt: z.coerce.date()
|
|
166
212
|
}).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
213
|
const postBookmarkSchema = z.object({
|
|
175
214
|
orgId: idSchema,
|
|
176
215
|
postId: idSchema,
|
|
@@ -217,8 +256,6 @@ const chatUserSchema = z.object({
|
|
|
217
256
|
joinedAt: z.coerce.date(),
|
|
218
257
|
leftAt: z.coerce.date().nullable(),
|
|
219
258
|
lastReadMessageId: idSchema.nullable(),
|
|
220
|
-
muted: z.boolean(),
|
|
221
|
-
mutedUntil: z.coerce.date().nullable(),
|
|
222
259
|
createdAt: z.coerce.date(),
|
|
223
260
|
updatedAt: z.coerce.date()
|
|
224
261
|
}).strict();
|
|
@@ -230,6 +267,7 @@ const messageSchema = z.object({
|
|
|
230
267
|
orgUserId: idSchema,
|
|
231
268
|
body: z.string(),
|
|
232
269
|
replyToId: idSchema.nullable(),
|
|
270
|
+
clientId: z.uuid().nullable(),
|
|
233
271
|
editedAt: z.coerce.date().nullable(),
|
|
234
272
|
deletedAt: z.coerce.date().nullable(),
|
|
235
273
|
createdAt: z.coerce.date(),
|
|
@@ -243,7 +281,13 @@ const messageViewSchema = messageSchema.extend({
|
|
|
243
281
|
sender: commentAuthorSchema,
|
|
244
282
|
attachments: z.array(messageFileSchema),
|
|
245
283
|
reactions: reactionCountsSchema,
|
|
246
|
-
viewerReaction: reactionEmojiSchema.nullable()
|
|
284
|
+
viewerReaction: reactionEmojiSchema.nullable(),
|
|
285
|
+
mentions: z.array(mentionViewSchema)
|
|
286
|
+
}).strict();
|
|
287
|
+
const liveMessageSchema = messageViewSchema.omit({ viewerReaction: true });
|
|
288
|
+
const chatUnreadSummarySchema = z.object({
|
|
289
|
+
unread: z.number().int().min(0),
|
|
290
|
+
requests: z.number().int().min(0)
|
|
247
291
|
}).strict();
|
|
248
292
|
const chatLastMessageSchema = z.object({
|
|
249
293
|
id: idSchema,
|
|
@@ -296,7 +340,71 @@ const blockedUserSchema = z.object({
|
|
|
296
340
|
createdAt: z.coerce.date(),
|
|
297
341
|
updatedAt: z.coerce.date()
|
|
298
342
|
}).strict();
|
|
343
|
+
const digestRunSchema = z.object({
|
|
344
|
+
orgId: idSchema,
|
|
345
|
+
communityId: idSchema,
|
|
346
|
+
lastDueAt: z.coerce.date()
|
|
347
|
+
}).strict();
|
|
348
|
+
const chatLiveEventSchema = z.discriminatedUnion("type", [
|
|
349
|
+
z.object({
|
|
350
|
+
type: z.literal("ready"),
|
|
351
|
+
heartbeatMs: z.number().int()
|
|
352
|
+
}).strict(),
|
|
353
|
+
z.object({
|
|
354
|
+
type: z.literal("message.created"),
|
|
355
|
+
chatId: idSchema,
|
|
356
|
+
message: liveMessageSchema
|
|
357
|
+
}).strict(),
|
|
358
|
+
z.object({
|
|
359
|
+
type: z.literal("message.updated"),
|
|
360
|
+
chatId: idSchema,
|
|
361
|
+
message: liveMessageSchema
|
|
362
|
+
}).strict(),
|
|
363
|
+
z.object({
|
|
364
|
+
type: z.literal("message.deleted"),
|
|
365
|
+
chatId: idSchema,
|
|
366
|
+
messageId: idSchema,
|
|
367
|
+
deletedAt: z.coerce.date()
|
|
368
|
+
}).strict(),
|
|
369
|
+
z.object({
|
|
370
|
+
type: z.literal("message.reactions"),
|
|
371
|
+
chatId: idSchema,
|
|
372
|
+
messageId: idSchema,
|
|
373
|
+
reactions: reactionCountsSchema,
|
|
374
|
+
orgUserId: idSchema,
|
|
375
|
+
reaction: reactionEmojiSchema.nullable()
|
|
376
|
+
}).strict(),
|
|
377
|
+
z.object({
|
|
378
|
+
type: z.literal("chat.updated"),
|
|
379
|
+
chatId: idSchema,
|
|
380
|
+
chat: chatSchema,
|
|
381
|
+
participants: z.array(commentAuthorSchema)
|
|
382
|
+
}).strict(),
|
|
383
|
+
z.object({
|
|
384
|
+
type: z.literal("chat.removed"),
|
|
385
|
+
chatId: idSchema
|
|
386
|
+
}).strict(),
|
|
387
|
+
z.object({
|
|
388
|
+
type: z.literal("chat.state"),
|
|
389
|
+
chatId: idSchema,
|
|
390
|
+
unread: z.number().int().min(0),
|
|
391
|
+
lastReadMessageId: idSchema.nullable(),
|
|
392
|
+
subscription: subscriptionViewSchema.nullable()
|
|
393
|
+
}).strict(),
|
|
394
|
+
chatUnreadSummarySchema.extend({ type: z.literal("unread") }).strict(),
|
|
395
|
+
z.object({
|
|
396
|
+
type: z.literal("typing"),
|
|
397
|
+
chatId: idSchema,
|
|
398
|
+
orgUserId: idSchema,
|
|
399
|
+
until: z.coerce.date()
|
|
400
|
+
}).strict(),
|
|
401
|
+
z.object({ type: z.literal("resync") }).strict(),
|
|
402
|
+
z.object({
|
|
403
|
+
type: z.literal("closed"),
|
|
404
|
+
reason: z.enum(["shutdown"])
|
|
405
|
+
}).strict()
|
|
406
|
+
]);
|
|
299
407
|
//#endregion
|
|
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,
|
|
408
|
+
export { activityCommentsRuleSchema, blockedUserSchema, chatKindSchema, chatLastMessageSchema, chatLiveEventSchema, chatSchema, chatStatusSchema, chatUnreadSummarySchema, chatUserSchema, commentAuthorSchema, commentFlagResolutionSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, digestRunSchema, flaggedCommentSchema, flaggedCommentViewSchema, listCommentsQuerySchema, liveMessageSchema, mentionItemTypeSchema, mentionSchema, mentionViewSchema, messageAttachmentSchema, messageFileSchema, messageFlagResolutionSchema, messageFlagSchema, messageReactionSchema, messageSchema, messageViewSchema, postAssetSchema, postBookmarkSchema, postFlagResolutionSchema, postFlagSchema, postReactionSchema, postSchema, postStatusSchema, postViewSchema, reactionCountsSchema, reactionEmojiSchema, subscriptionItemTypeSchema, subscriptionSchema, subscriptionStateSchema, subscriptionViewSchema };
|
|
301
409
|
|
|
302
410
|
//# 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, 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,CAAC,SAAS;CAC9B,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,cAAc,SAAS,SAAS;CAChC,UAAU,EAAE,OAAO,CA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":3,"file":"discussion.js","names":[],"sources":["../../../src/types/schemas/discussion.ts"],"sourcesContent":["import { z } from 'zod';\nimport { assetKindSchema } from './assets.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 team: z.boolean(),\n roleName: z.string().nullable(),\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 mentionItemTypeSchema = z.enum(['post', 'comment', 'message']);\nexport type MentionItemType = z.infer<typeof mentionItemTypeSchema>;\n\nexport const mentionSchema = z\n .object({\n orgId: idSchema,\n itemType: mentionItemTypeSchema,\n itemId: idSchema,\n orgUserId: idSchema,\n createdAt: z.coerce.date(),\n })\n .strict();\nexport type Mention = z.output<typeof mentionSchema>;\n\nexport const mentionViewSchema = z\n .object({\n orgUserId: idSchema,\n name: z.string(),\n })\n .strict();\nexport type MentionView = z.output<typeof mentionViewSchema>;\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 mentions: z.array(mentionViewSchema),\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 subscriptionItemTypeSchema = z.enum(['post', 'space', 'chat']);\nexport type SubscriptionItemType = z.infer<typeof subscriptionItemTypeSchema>;\n\nexport const subscriptionStateSchema = z.enum(['following', 'muted']);\nexport type SubscriptionState = z.infer<typeof subscriptionStateSchema>;\n\nexport const subscriptionSchema = z\n .object({\n orgId: idSchema,\n orgUserId: idSchema,\n itemType: subscriptionItemTypeSchema,\n itemId: idSchema,\n state: subscriptionStateSchema,\n mutedUntil: z.coerce.date().nullable(),\n createdAt: z.coerce.date(),\n })\n .strict();\nexport type Subscription = z.output<typeof subscriptionSchema>;\n\nexport const subscriptionViewSchema = z\n .object({\n state: subscriptionStateSchema,\n mutedUntil: z.coerce.date().nullable(),\n })\n .strict();\nexport type SubscriptionView = z.output<typeof subscriptionViewSchema>;\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 postAssetSchema = z\n .object({\n url: z.string(),\n kind: assetKindSchema,\n filename: z.string(),\n size: z.number().int().min(0),\n })\n .strict();\nexport type PostAsset = z.output<typeof postAssetSchema>;\n\nexport const postViewSchema = postSchema\n .extend({\n coverUrl: z.string().nullable(),\n assets: z.record(idSchema, postAssetSchema),\n author: commentAuthorSchema,\n reactions: reactionCountsSchema,\n viewerReaction: reactionEmojiSchema.nullable(),\n commentCount: z.number().int().min(0),\n subscription: subscriptionViewSchema.nullable(),\n bookmarked: z.boolean(),\n mentions: z.array(mentionViewSchema),\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 flaggedCommentViewSchema = commentReportSchema\n .extend({\n comment: flaggedCommentSchema.shape.comment.extend({ author: commentAuthorSchema }).strict(),\n })\n .strict();\nexport type FlaggedCommentView = z.output<typeof flaggedCommentViewSchema>;\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 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 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 clientId: z.uuid().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 mentions: z.array(mentionViewSchema),\n })\n .strict();\nexport type MessageView = z.output<typeof messageViewSchema>;\n\nexport const liveMessageSchema = messageViewSchema.omit({ viewerReaction: true });\nexport type LiveMessage = z.output<typeof liveMessageSchema>;\n\nexport const chatUnreadSummarySchema = z\n .object({\n unread: z.number().int().min(0),\n requests: z.number().int().min(0),\n })\n .strict();\nexport type ChatUnreadSummary = z.output<typeof chatUnreadSummarySchema>;\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\nexport const digestRunSchema = z\n .object({\n orgId: idSchema,\n communityId: idSchema,\n lastDueAt: z.coerce.date(),\n })\n .strict();\nexport type DigestRun = z.output<typeof digestRunSchema>;\n\nexport const chatLiveEventSchema = z.discriminatedUnion('type', [\n z.object({ type: z.literal('ready'), heartbeatMs: z.number().int() }).strict(),\n z\n .object({ type: z.literal('message.created'), chatId: idSchema, message: liveMessageSchema })\n .strict(),\n z\n .object({ type: z.literal('message.updated'), chatId: idSchema, message: liveMessageSchema })\n .strict(),\n z\n .object({\n type: z.literal('message.deleted'),\n chatId: idSchema,\n messageId: idSchema,\n deletedAt: z.coerce.date(),\n })\n .strict(),\n z\n .object({\n type: z.literal('message.reactions'),\n chatId: idSchema,\n messageId: idSchema,\n reactions: reactionCountsSchema,\n orgUserId: idSchema,\n reaction: reactionEmojiSchema.nullable(),\n })\n .strict(),\n z\n .object({\n type: z.literal('chat.updated'),\n chatId: idSchema,\n chat: chatSchema,\n participants: z.array(commentAuthorSchema),\n })\n .strict(),\n z.object({ type: z.literal('chat.removed'), chatId: idSchema }).strict(),\n z\n .object({\n type: z.literal('chat.state'),\n chatId: idSchema,\n unread: z.number().int().min(0),\n lastReadMessageId: idSchema.nullable(),\n subscription: subscriptionViewSchema.nullable(),\n })\n .strict(),\n chatUnreadSummarySchema.extend({ type: z.literal('unread') }).strict(),\n z\n .object({\n type: z.literal('typing'),\n chatId: idSchema,\n orgUserId: idSchema,\n until: z.coerce.date(),\n })\n .strict(),\n z.object({ type: z.literal('resync') }).strict(),\n z.object({ type: z.literal('closed'), reason: z.enum(['shutdown']) }).strict(),\n]);\nexport type ChatLiveEvent = z.output<typeof chatLiveEventSchema>;\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,CAAC,SAAS;CAC9B,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,OAA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ACR,QAAQ,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;EAC9B,mBAAmB,SAAS,SAAS;EACrC,cAAc,uBAAuB,SAAS;CAChD,CAAC,CAAC,CACD,OAAO;CACV,wBAAwB,OAAO,EAAE,MAAM,EAAE,QAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO;CACrE,EACG,OAAO;EACN,MAAM,EAAE,QAAQ,QAAQ;EACxB,QAAQ;EACR,WAAW;EACX,OAAO,EAAE,OAAO,KAAK;CACvB,CAAC,CAAC,CACD,OAAO;CACV,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,QAAQ,EAAE,CAAC,CAAC,CAAC,OAAO;CAC/C,EAAE,OAAO;EAAE,MAAM,EAAE,QAAQ,QAAQ;EAAG,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC;CAAE,CAAC,CAAC,CAAC,OAAO;AAC/E,CAAC"}
|
|
@@ -38,6 +38,7 @@ 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
|
+
event: "event";
|
|
41
42
|
course: "course";
|
|
42
43
|
download: "download";
|
|
43
44
|
}>>;
|
|
@@ -49,8 +50,20 @@ declare const grantEntitlementInputSchema: z.ZodObject<{
|
|
|
49
50
|
contentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
51
|
bundleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
51
52
|
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
53
|
+
contentType: z.ZodOptional<z.ZodEnum<{
|
|
54
|
+
event: "event";
|
|
55
|
+
course: "course";
|
|
56
|
+
download: "download";
|
|
57
|
+
community: "community";
|
|
58
|
+
}>>;
|
|
52
59
|
}, z.core.$strict>;
|
|
53
60
|
type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;
|
|
61
|
+
declare const grantSourceSchema: z.ZodEnum<{
|
|
62
|
+
manual: "manual";
|
|
63
|
+
self: "self";
|
|
64
|
+
automation: "automation";
|
|
65
|
+
}>;
|
|
66
|
+
type GrantSource = z.infer<typeof grantSourceSchema>;
|
|
54
67
|
declare const spaceMemberStatusSchema: z.ZodEnum<{
|
|
55
68
|
active: "active";
|
|
56
69
|
revoked: "revoked";
|
|
@@ -86,5 +99,5 @@ declare const spaceMemberSchema: z.ZodObject<{
|
|
|
86
99
|
}, z.core.$strict>;
|
|
87
100
|
type SpaceMember = z.output<typeof spaceMemberSchema>;
|
|
88
101
|
//#endregion
|
|
89
|
-
export { Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, SpaceMember, SpaceMemberSource, SpaceMemberStatus, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema };
|
|
102
|
+
export { Entitlement, EntitlementInput, EntitlementStatus, EntitlementsQuery, GrantEntitlementInput, GrantSource, SpaceMember, SpaceMemberSource, SpaceMemberStatus, entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, grantSourceSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema };
|
|
90
103
|
//# sourceMappingURL=entitlements.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { idSchema } from "./shared.js";
|
|
2
|
+
import { contentTypeSchema, eventAttendeeSourceSchema } from "./content.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
//#region src/types/schemas/entitlements.ts
|
|
4
5
|
const entitlementStatusSchema = z.enum(["active", "revoked"]);
|
|
@@ -29,15 +30,21 @@ const entitlementsQuerySchema = z.object({
|
|
|
29
30
|
orgUserId: idSchema.optional(),
|
|
30
31
|
contentId: idSchema.optional(),
|
|
31
32
|
bundleId: idSchema.optional(),
|
|
32
|
-
type: z.enum([
|
|
33
|
+
type: z.enum([
|
|
34
|
+
"course",
|
|
35
|
+
"download",
|
|
36
|
+
"event"
|
|
37
|
+
]).optional()
|
|
33
38
|
}).strict();
|
|
34
39
|
/** A grant targets exactly one of: a bundle or a single content item. */
|
|
35
40
|
const grantEntitlementInputSchema = z.object({
|
|
36
41
|
orgUserId: idSchema,
|
|
37
42
|
contentId: idSchema.nullish(),
|
|
38
43
|
bundleId: idSchema.nullish(),
|
|
39
|
-
expiresAt: z.coerce.date().nullable()
|
|
40
|
-
|
|
44
|
+
expiresAt: z.coerce.date().nullable(),
|
|
45
|
+
contentType: contentTypeSchema.optional().describe("When set, a contentId of another type is not found")
|
|
46
|
+
}).strict().refine((v) => v.contentId != null !== (v.bundleId != null), { message: "Provide exactly one of contentId or bundleId" }).refine((v) => v.contentType === void 0 || v.contentId != null, { message: "contentType applies to a contentId only" });
|
|
47
|
+
const grantSourceSchema = eventAttendeeSourceSchema.exclude(["bundle"]);
|
|
41
48
|
const spaceMemberStatusSchema = z.enum([
|
|
42
49
|
"requested",
|
|
43
50
|
"invited",
|
|
@@ -61,6 +68,6 @@ const spaceMemberSchema = z.object({
|
|
|
61
68
|
updatedAt: z.coerce.date()
|
|
62
69
|
}).strict();
|
|
63
70
|
//#endregion
|
|
64
|
-
export { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema };
|
|
71
|
+
export { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema, grantSourceSchema, spaceMemberSchema, spaceMemberSourceSchema, spaceMemberStatusSchema };
|
|
65
72
|
|
|
66
73
|
//# 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\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":"
|
|
1
|
+
{"version":3,"file":"entitlements.js","names":[],"sources":["../../../src/types/schemas/entitlements.ts"],"sourcesContent":["import { z } from 'zod';\nimport { contentTypeSchema, eventAttendeeSourceSchema } from './content.js';\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', 'event']).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 contentType: contentTypeSchema\n .optional()\n .describe('When set, a contentId of another type is not found'),\n })\n .strict()\n .refine((v) => (v.contentId != null) !== (v.bundleId != null), {\n message: 'Provide exactly one of contentId or bundleId',\n })\n .refine((v) => v.contentType === undefined || v.contentId != null, {\n message: 'contentType applies to a contentId only',\n });\nexport type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;\n\nexport const grantSourceSchema = eventAttendeeSourceSchema.exclude(['bundle']);\nexport type GrantSource = z.infer<typeof grantSourceSchema>;\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":";;;;AAIA,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;EAAC;EAAU;EAAY;CAAO,CAAC,CAAC,CAAC,SAAS;AACzD,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;CACpC,aAAa,kBACV,SAAS,CAAC,CACV,SAAS,oDAAoD;AAClE,CAAC,CAAC,CACD,OAAO,CAAC,CACR,QAAQ,MAAO,EAAE,aAAa,UAAW,EAAE,YAAY,OAAO,EAC7D,SAAS,+CACX,CAAC,CAAC,CACD,QAAQ,MAAM,EAAE,gBAAgB,KAAA,KAAa,EAAE,aAAa,MAAM,EACjE,SAAS,0CACX,CAAC;AAGH,MAAa,oBAAoB,0BAA0B,QAAQ,CAAC,QAAQ,CAAC;AAG7E,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"}
|
|
@@ -58,90 +58,6 @@ declare const userProfileViewSchema: z.ZodObject<{
|
|
|
58
58
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
59
59
|
}, z.core.$strict>;
|
|
60
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>;
|
|
145
61
|
//#endregion
|
|
146
|
-
export { CreateUserInput,
|
|
62
|
+
export { CreateUserInput, ProvisionUserInput, UpdateUserInput, User, UserInput, UserProfile, UserProfileView, createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userProfileSchema, userProfileViewSchema, userSchema };
|
|
147
63
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -40,48 +40,7 @@ const userProfileSchema = z.object({
|
|
|
40
40
|
updatedAt: z.coerce.date()
|
|
41
41
|
}).strict();
|
|
42
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();
|
|
84
43
|
//#endregion
|
|
85
|
-
export { createUserInputSchema,
|
|
44
|
+
export { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userProfileSchema, userProfileViewSchema, userSchema };
|
|
86
45
|
|
|
87
46
|
//# 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, 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
|
|
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"],"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,O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