@headless-lms/core 0.1.0 → 0.2.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 +66 -3
- package/dist/assets/events.js +19 -3
- package/dist/assets/events.js.map +1 -1
- package/dist/assets/service.js +5 -3
- package/dist/assets/service.js.map +1 -1
- package/dist/automations/actions.d.ts +11 -3
- package/dist/automations/actions.js +38 -5
- package/dist/automations/actions.js.map +1 -1
- package/dist/automations/catalog.d.ts +4 -1
- package/dist/automations/catalog.js +289 -188
- package/dist/automations/catalog.js.map +1 -1
- package/dist/automations/events.d.ts +46 -24
- package/dist/automations/events.js +5 -5
- package/dist/automations/events.js.map +1 -1
- package/dist/automations/index.d.ts +5 -5
- package/dist/automations/index.js +2 -2
- package/dist/automations/model.d.ts +13 -3
- package/dist/automations/model.js +23 -3
- package/dist/automations/model.js.map +1 -1
- package/dist/automations/ports.d.ts +23 -8
- package/dist/automations/service.d.ts +21 -5
- package/dist/automations/service.js +267 -47
- package/dist/automations/service.js.map +1 -1
- package/dist/automations/types.d.ts +2 -2
- package/dist/automations/webhook-signing.d.ts +7 -0
- package/dist/automations/webhook-signing.js +22 -0
- package/dist/automations/webhook-signing.js.map +1 -0
- package/dist/content/events.d.ts +401 -25
- package/dist/content/events.js +125 -19
- package/dist/content/events.js.map +1 -1
- package/dist/content/index.d.ts +5 -5
- package/dist/content/index.js +2 -2
- package/dist/content/model.d.ts +2 -2
- package/dist/content/ports.d.ts +42 -11
- package/dist/content/service.d.ts +15 -9
- package/dist/content/service.js +153 -45
- package/dist/content/service.js.map +1 -1
- package/dist/content/types.d.ts +2 -2
- package/dist/discussion/events.d.ts +60 -4
- package/dist/discussion/events.js +30 -4
- package/dist/discussion/events.js.map +1 -1
- package/dist/discussion/model.d.ts +1 -2
- package/dist/discussion/ports.d.ts +1 -1
- package/dist/discussion/service.d.ts +1 -1
- package/dist/discussion/service.js +11 -10
- package/dist/discussion/service.js.map +1 -1
- package/dist/entitlements/events.d.ts +96 -12
- package/dist/entitlements/events.js +21 -4
- package/dist/entitlements/events.js.map +1 -1
- package/dist/entitlements/service.js +1 -0
- package/dist/entitlements/service.js.map +1 -1
- package/dist/identity/events.d.ts +17 -3
- package/dist/identity/events.js +12 -2
- package/dist/identity/events.js.map +1 -1
- package/dist/identity/ports.d.ts +3 -0
- package/dist/identity/service.d.ts +3 -0
- package/dist/identity/service.js +12 -1
- package/dist/identity/service.js.map +1 -1
- package/dist/integrations/events.d.ts +27 -3
- package/dist/integrations/events.js +15 -3
- package/dist/integrations/events.js.map +1 -1
- package/dist/integrations/service.js +1 -1
- package/dist/integrations/service.js.map +1 -1
- package/dist/organizations/events.d.ts +178 -11
- package/dist/organizations/events.js +52 -9
- package/dist/organizations/events.js.map +1 -1
- package/dist/organizations/index.d.ts +3 -3
- package/dist/organizations/members.js.map +1 -1
- package/dist/organizations/ports.d.ts +6 -10
- package/dist/organizations/roles.js.map +1 -1
- package/dist/organizations/service.d.ts +9 -4
- package/dist/organizations/service.js +131 -72
- package/dist/organizations/service.js.map +1 -1
- package/dist/organizations/types.d.ts +2 -2
- package/dist/progress/events.d.ts +34 -2
- package/dist/progress/events.js +15 -2
- package/dist/progress/events.js.map +1 -1
- package/dist/progress/service.d.ts +2 -2
- package/dist/progress/service.js +4 -2
- package/dist/progress/service.js.map +1 -1
- package/dist/reporting/courses/index.d.ts +4 -0
- package/dist/reporting/courses/index.js +2 -0
- package/dist/reporting/courses/model.d.ts +24 -0
- package/dist/reporting/courses/model.js +1 -0
- package/dist/reporting/courses/ports.d.ts +13 -0
- package/dist/reporting/courses/ports.js +1 -0
- package/dist/reporting/courses/service.d.ts +19 -0
- package/dist/reporting/courses/service.js +20 -0
- package/dist/reporting/courses/service.js.map +1 -0
- package/dist/reporting/learn/model.d.ts +2 -2
- package/dist/reporting/learn/ports.d.ts +2 -1
- package/dist/reporting/learn/service.d.ts +2 -1
- package/dist/reporting/learn/service.js +5 -0
- package/dist/reporting/learn/service.js.map +1 -1
- package/dist/reporting/students/index.d.ts +2 -2
- package/dist/reporting/students/model.d.ts +21 -1
- package/dist/reporting/students/ports.d.ts +3 -1
- package/dist/reporting/students/service.d.ts +2 -1
- package/dist/reporting/students/service.js +3 -0
- package/dist/reporting/students/service.js.map +1 -1
- package/dist/shared/events.d.ts +5 -3
- package/dist/shared/events.js +1 -0
- package/dist/shared/events.js.map +1 -1
- package/dist/shared/id.d.ts +1 -0
- package/dist/shared/id.js +1 -0
- package/dist/shared/id.js.map +1 -1
- package/dist/shared/mailer.d.ts +2 -0
- package/dist/shared/mailer.js.map +1 -1
- package/dist/shared/settings.js.map +1 -1
- package/dist/types/automations.d.ts +13 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/discussion.d.ts +3 -2
- package/dist/types/email-templates.d.ts +3 -1
- package/dist/types/events.d.ts +3 -3
- package/dist/types/index.d.ts +6 -6
- package/dist/types/organizations.d.ts +2 -2
- package/dist/types/ports.d.ts +1 -1
- package/dist/types/schemas/assets.d.ts +3 -0
- package/dist/types/schemas/assets.js +2 -1
- package/dist/types/schemas/assets.js.map +1 -1
- package/dist/types/schemas/automations.d.ts +71 -4
- package/dist/types/schemas/automations.js +35 -4
- package/dist/types/schemas/automations.js.map +1 -1
- package/dist/types/schemas/content.d.ts +51 -18
- package/dist/types/schemas/content.js +40 -13
- package/dist/types/schemas/content.js.map +1 -1
- package/dist/types/schemas/credentials.js.map +1 -1
- package/dist/types/schemas/discussion.d.ts +10 -2
- package/dist/types/schemas/discussion.js +12 -5
- package/dist/types/schemas/discussion.js.map +1 -1
- package/dist/types/schemas/entitlements.d.ts +8 -2
- package/dist/types/schemas/entitlements.js +10 -4
- package/dist/types/schemas/entitlements.js.map +1 -1
- package/dist/types/schemas/identity.d.ts +4 -4
- package/dist/types/schemas/identity.js +5 -5
- package/dist/types/schemas/identity.js.map +1 -1
- package/dist/types/schemas/index.d.ts +6 -6
- package/dist/types/schemas/index.js +6 -6
- package/dist/types/schemas/integrations.js.map +1 -1
- package/dist/types/schemas/organizations.d.ts +19 -5
- package/dist/types/schemas/organizations.js +12 -7
- package/dist/types/schemas/organizations.js.map +1 -1
- package/dist/types/schemas/outbox.d.ts +1 -0
- package/dist/types/schemas/outbox.js +1 -0
- package/dist/types/schemas/outbox.js.map +1 -1
- package/dist/types/schemas/progress.d.ts +1 -0
- package/dist/types/schemas/progress.js +1 -0
- package/dist/types/schemas/progress.js.map +1 -1
- package/dist/types/schemas/settings.js.map +1 -1
- package/dist/types/schemas/shared.d.ts +2 -1
- package/dist/types/schemas/shared.js +3 -1
- package/dist/types/schemas/shared.js.map +1 -1
- package/dist/types/shared.d.ts +1 -1
- package/package.json +1 -1
|
@@ -21,12 +21,8 @@ declare const courseSettingsSchema: z.ZodObject<{
|
|
|
21
21
|
}, z.core.$strict>>;
|
|
22
22
|
}, z.core.$strict>;
|
|
23
23
|
type CourseSettings = z.infer<typeof courseSettingsSchema>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
inherit: "inherit";
|
|
27
|
-
always: "always";
|
|
28
|
-
}>;
|
|
29
|
-
type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;
|
|
24
|
+
/** Defaults for keys a stored settings row doesn't carry (or no row at all). */
|
|
25
|
+
declare const courseSettingsDefaults: CourseSettings;
|
|
30
26
|
declare const activitySettingsSchema: z.ZodObject<{
|
|
31
27
|
comments: z.ZodOptional<z.ZodEnum<{
|
|
32
28
|
never: "never";
|
|
@@ -35,6 +31,40 @@ declare const activitySettingsSchema: z.ZodObject<{
|
|
|
35
31
|
}>>;
|
|
36
32
|
}, z.core.$strict>;
|
|
37
33
|
type ActivitySettings = z.infer<typeof activitySettingsSchema>;
|
|
34
|
+
declare const bundleSchema: z.ZodObject<{
|
|
35
|
+
orgId: z.ZodString;
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
name: z.ZodString;
|
|
38
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
39
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
40
|
+
}, z.core.$strict>;
|
|
41
|
+
type Bundle = z.output<typeof bundleSchema>;
|
|
42
|
+
type BundleInput = z.input<typeof bundleSchema>;
|
|
43
|
+
declare const bundleItemSchema: z.ZodObject<{
|
|
44
|
+
orgId: z.ZodString;
|
|
45
|
+
bundleId: z.ZodString;
|
|
46
|
+
contentId: z.ZodString;
|
|
47
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
48
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
49
|
+
}, z.core.$strict>;
|
|
50
|
+
type BundleItem = z.output<typeof bundleItemSchema>;
|
|
51
|
+
type BundleItemInput = z.input<typeof bundleItemSchema>;
|
|
52
|
+
declare const listBundlesQuerySchema: z.ZodObject<{
|
|
53
|
+
page: z.ZodNumber;
|
|
54
|
+
pageSize: z.ZodNumber;
|
|
55
|
+
search: z.ZodOptional<z.ZodString>;
|
|
56
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
57
|
+
}, z.core.$strict>;
|
|
58
|
+
type ListBundlesQuery = z.infer<typeof listBundlesQuerySchema>;
|
|
59
|
+
declare const createBundleInputSchema: z.ZodObject<{
|
|
60
|
+
name: z.ZodString;
|
|
61
|
+
contentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
type CreateBundleInput = z.infer<typeof createBundleInputSchema>;
|
|
64
|
+
declare const updateBundleInputSchema: z.ZodObject<{
|
|
65
|
+
name: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
type UpdateBundleInput = z.infer<typeof updateBundleInputSchema>;
|
|
38
68
|
declare const contentItemSchema: z.ZodObject<{
|
|
39
69
|
orgId: z.ZodString;
|
|
40
70
|
id: z.ZodString;
|
|
@@ -43,6 +73,7 @@ declare const contentItemSchema: z.ZodObject<{
|
|
|
43
73
|
course: "course";
|
|
44
74
|
}>;
|
|
45
75
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
76
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
46
77
|
}, z.core.$strict>;
|
|
47
78
|
type ContentItem = z.output<typeof contentItemSchema>;
|
|
48
79
|
type ContentItemInput = z.input<typeof contentItemSchema>;
|
|
@@ -59,12 +90,19 @@ declare const courseSchema: z.ZodObject<{
|
|
|
59
90
|
}>;
|
|
60
91
|
category: z.ZodString;
|
|
61
92
|
thumbnailAssetId: z.ZodNullable<z.ZodString>;
|
|
62
|
-
settings: z.
|
|
93
|
+
settings: z.ZodObject<{
|
|
94
|
+
transcriptDownloads: z.ZodBoolean;
|
|
95
|
+
comments: z.ZodOptional<z.ZodObject<{
|
|
96
|
+
enabled: z.ZodBoolean;
|
|
97
|
+
threaded: z.ZodBoolean;
|
|
98
|
+
requireReview: z.ZodBoolean;
|
|
99
|
+
reactions: z.ZodBoolean;
|
|
100
|
+
}, z.core.$strict>>;
|
|
101
|
+
}, z.core.$strict>;
|
|
63
102
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
64
103
|
updatedAt: z.ZodCoercedDate<unknown>;
|
|
65
104
|
}, z.core.$strict>;
|
|
66
105
|
type Course = z.output<typeof courseSchema>;
|
|
67
|
-
type CourseInput = z.input<typeof courseSchema>;
|
|
68
106
|
declare const activitySchema: z.ZodObject<{
|
|
69
107
|
orgId: z.ZodString;
|
|
70
108
|
id: z.ZodString;
|
|
@@ -94,6 +132,8 @@ declare const activityAssetSchema: z.ZodObject<{
|
|
|
94
132
|
activityId: z.ZodString;
|
|
95
133
|
assetId: z.ZodString;
|
|
96
134
|
seq: z.ZodNumber;
|
|
135
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
136
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
97
137
|
}, z.core.$strict>;
|
|
98
138
|
type ActivityAsset = z.output<typeof activityAssetSchema>;
|
|
99
139
|
type ActivityAssetInput = z.input<typeof activityAssetSchema>;
|
|
@@ -129,15 +169,6 @@ declare const updateCourseInputSchema: z.ZodObject<{
|
|
|
129
169
|
published: "published";
|
|
130
170
|
}>>;
|
|
131
171
|
thumbnailAssetId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
-
settings: z.ZodOptional<z.ZodObject<{
|
|
133
|
-
transcriptDownloads: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
-
comments: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
135
|
-
enabled: z.ZodBoolean;
|
|
136
|
-
threaded: z.ZodBoolean;
|
|
137
|
-
requireReview: z.ZodBoolean;
|
|
138
|
-
reactions: z.ZodBoolean;
|
|
139
|
-
}, z.core.$strict>>>;
|
|
140
|
-
}, z.core.$strict>>;
|
|
141
172
|
}, z.core.$strict>;
|
|
142
173
|
type UpdateCourseInput = z.infer<typeof updateCourseInputSchema>;
|
|
143
174
|
declare const downloadStatusSchema: z.ZodEnum<{
|
|
@@ -170,6 +201,8 @@ declare const downloadAssetSchema: z.ZodObject<{
|
|
|
170
201
|
assetId: z.ZodString;
|
|
171
202
|
seq: z.ZodNumber;
|
|
172
203
|
displayName: z.ZodNullable<z.ZodString>;
|
|
204
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
205
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
173
206
|
}, z.core.$strict>;
|
|
174
207
|
type DownloadAsset = z.output<typeof downloadAssetSchema>;
|
|
175
208
|
type DownloadAssetInput = z.input<typeof downloadAssetSchema>;
|
|
@@ -212,5 +245,5 @@ declare const reorderDownloadAssetsInputSchema: z.ZodObject<{
|
|
|
212
245
|
}, z.core.$strict>;
|
|
213
246
|
type ReorderDownloadAssetsInput = z.infer<typeof reorderDownloadAssetsInputSchema>;
|
|
214
247
|
//#endregion
|
|
215
|
-
export { Activity, ActivityAsset, ActivityAssetInput,
|
|
248
|
+
export { Activity, ActivityAsset, ActivityAssetInput, ActivityInput, ActivitySettings, AddDownloadAssetInput, Bundle, BundleInput, BundleItem, BundleItemInput, ContentItem, ContentItemInput, ContentType, Course, CourseSettings, CourseStatus, CreateBundleInput, CreateCourseInput, CreateDownloadInput, Download, DownloadAsset, DownloadAssetInput, DownloadInput, DownloadStatus, ListBundlesQuery, ListCoursesQuery, ListDownloadsQuery, Module, ModuleInput, ReorderDownloadAssetsInput, SaveActivityInput, UpdateBundleInput, UpdateCourseInput, UpdateDownloadInput, activityAssetSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, bundleItemSchema, bundleSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, createBundleInputSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listBundlesQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateBundleInputSchema, updateCourseInputSchema, updateDownloadInputSchema };
|
|
216
249
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { idSchema, jsonValueSchema } from "./shared.js";
|
|
2
|
-
import { commentSettingsSchema } from "./discussion.js";
|
|
2
|
+
import { activityCommentsRuleSchema, commentSettingsSchema } from "./discussion.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/types/schemas/content.ts
|
|
5
5
|
const contentTypeSchema = z.enum(["course", "download"]);
|
|
@@ -8,17 +8,41 @@ const courseSettingsSchema = z.object({
|
|
|
8
8
|
transcriptDownloads: z.boolean(),
|
|
9
9
|
comments: commentSettingsSchema.optional()
|
|
10
10
|
}).strict();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"always",
|
|
14
|
-
"never"
|
|
15
|
-
]);
|
|
11
|
+
/** Defaults for keys a stored settings row doesn't carry (or no row at all). */
|
|
12
|
+
const courseSettingsDefaults = { transcriptDownloads: false };
|
|
16
13
|
const activitySettingsSchema = z.object({ comments: activityCommentsRuleSchema.optional() }).strict();
|
|
14
|
+
const bundleSchema = z.object({
|
|
15
|
+
orgId: idSchema,
|
|
16
|
+
id: idSchema,
|
|
17
|
+
name: z.string(),
|
|
18
|
+
createdAt: z.coerce.date(),
|
|
19
|
+
updatedAt: z.coerce.date()
|
|
20
|
+
}).strict();
|
|
21
|
+
const bundleItemSchema = z.object({
|
|
22
|
+
orgId: idSchema,
|
|
23
|
+
bundleId: idSchema,
|
|
24
|
+
contentId: idSchema,
|
|
25
|
+
createdAt: z.coerce.date(),
|
|
26
|
+
updatedAt: z.coerce.date()
|
|
27
|
+
}).strict();
|
|
28
|
+
const listBundlesQuerySchema = z.object({
|
|
29
|
+
page: z.number().int().min(1),
|
|
30
|
+
pageSize: z.number().int().min(1),
|
|
31
|
+
search: z.string().optional(),
|
|
32
|
+
sort: z.string().optional()
|
|
33
|
+
}).strict();
|
|
34
|
+
const createBundleInputSchema = z.object({
|
|
35
|
+
name: z.string(),
|
|
36
|
+
/** Content to put in the bundle at creation — bundle and items land together. */
|
|
37
|
+
contentIds: z.array(idSchema).optional()
|
|
38
|
+
}).strict();
|
|
39
|
+
const updateBundleInputSchema = z.object({ name: z.string().optional() }).strict();
|
|
17
40
|
const contentItemSchema = z.object({
|
|
18
41
|
orgId: idSchema,
|
|
19
42
|
id: idSchema,
|
|
20
43
|
type: contentTypeSchema,
|
|
21
|
-
createdAt: z.coerce.date()
|
|
44
|
+
createdAt: z.coerce.date(),
|
|
45
|
+
updatedAt: z.coerce.date()
|
|
22
46
|
}).strict();
|
|
23
47
|
const courseSchema = z.object({
|
|
24
48
|
orgId: idSchema,
|
|
@@ -30,7 +54,7 @@ const courseSchema = z.object({
|
|
|
30
54
|
status: courseStatusSchema,
|
|
31
55
|
category: z.string(),
|
|
32
56
|
thumbnailAssetId: idSchema.nullable(),
|
|
33
|
-
settings:
|
|
57
|
+
settings: courseSettingsSchema,
|
|
34
58
|
createdAt: z.coerce.date(),
|
|
35
59
|
updatedAt: z.coerce.date()
|
|
36
60
|
}).strict();
|
|
@@ -58,7 +82,9 @@ const activityAssetSchema = z.object({
|
|
|
58
82
|
id: idSchema,
|
|
59
83
|
activityId: idSchema,
|
|
60
84
|
assetId: idSchema,
|
|
61
|
-
seq: z.number().int()
|
|
85
|
+
seq: z.number().int(),
|
|
86
|
+
createdAt: z.coerce.date(),
|
|
87
|
+
updatedAt: z.coerce.date()
|
|
62
88
|
}).strict();
|
|
63
89
|
const saveActivityInputSchema = z.object({
|
|
64
90
|
settings: jsonValueSchema.optional(),
|
|
@@ -82,8 +108,7 @@ const updateCourseInputSchema = z.object({
|
|
|
82
108
|
description: z.string().optional(),
|
|
83
109
|
category: z.string().optional(),
|
|
84
110
|
status: courseStatusSchema.optional(),
|
|
85
|
-
thumbnailAssetId: idSchema.nullable().optional()
|
|
86
|
-
settings: courseSettingsSchema.partial().optional()
|
|
111
|
+
thumbnailAssetId: idSchema.nullable().optional()
|
|
87
112
|
}).strict();
|
|
88
113
|
const downloadStatusSchema = z.enum(["draft", "published"]);
|
|
89
114
|
const downloadSchema = z.object({
|
|
@@ -105,7 +130,9 @@ const downloadAssetSchema = z.object({
|
|
|
105
130
|
downloadId: idSchema,
|
|
106
131
|
assetId: idSchema,
|
|
107
132
|
seq: z.number().int(),
|
|
108
|
-
displayName: z.string().nullable()
|
|
133
|
+
displayName: z.string().nullable(),
|
|
134
|
+
createdAt: z.coerce.date(),
|
|
135
|
+
updatedAt: z.coerce.date()
|
|
109
136
|
}).strict();
|
|
110
137
|
const listDownloadsQuerySchema = z.object({
|
|
111
138
|
page: z.number().int().min(1),
|
|
@@ -133,6 +160,6 @@ const addDownloadAssetInputSchema = z.object({
|
|
|
133
160
|
}).strict();
|
|
134
161
|
const reorderDownloadAssetsInputSchema = z.object({ assetIds: z.array(idSchema) }).strict();
|
|
135
162
|
//#endregion
|
|
136
|
-
export { activityAssetSchema,
|
|
163
|
+
export { activityAssetSchema, activitySchema, activitySettingsSchema, addDownloadAssetInputSchema, bundleItemSchema, bundleSchema, contentItemSchema, contentTypeSchema, courseSchema, courseSettingsDefaults, courseSettingsSchema, courseStatusSchema, createBundleInputSchema, createCourseInputSchema, createDownloadInputSchema, downloadAssetSchema, downloadSchema, downloadStatusSchema, listBundlesQuerySchema, listCoursesQuerySchema, listDownloadsQuerySchema, moduleSchema, reorderDownloadAssetsInputSchema, saveActivityInputSchema, updateBundleInputSchema, updateCourseInputSchema, updateDownloadInputSchema };
|
|
137
164
|
|
|
138
165
|
//# sourceMappingURL=content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","names":[],"sources":["../../../src/types/schemas/content.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { commentSettingsSchema } from \"./discussion.js\";\nimport { idSchema, jsonValueSchema } from \"./shared.js\";\n\nexport const contentTypeSchema = z.enum([\"course\", \"download\"]);\nexport type ContentType = z.infer<typeof contentTypeSchema>;\n\nexport const courseStatusSchema = z.enum([\"draft\", \"published\"]);\nexport type CourseStatus = z.infer<typeof courseStatusSchema>;\n\nexport const courseSettingsSchema = z.object({\n transcriptDownloads: z.boolean(),\n comments: commentSettingsSchema.optional(),\n}).strict();\nexport type CourseSettings = z.infer<typeof courseSettingsSchema>;\n\nexport const activityCommentsRuleSchema = z.enum([\"inherit\", \"always\", \"never\"]);\nexport type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;\n\nexport const activitySettingsSchema = z.object({\n comments: activityCommentsRuleSchema.optional(),\n}).strict();\nexport type ActivitySettings = z.infer<typeof activitySettingsSchema>;\n\nexport const contentItemSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n type: contentTypeSchema,\n createdAt: z.coerce.date(),\n}).strict();\nexport type ContentItem = z.output<typeof contentItemSchema>;\nexport type ContentItemInput = z.input<typeof contentItemSchema>;\n\nexport const courseSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n type: z.literal(\"course\"),\n title: z.string(),\n slug: z.string(),\n description: z.string(),\n status: courseStatusSchema,\n category: z.string(),\n thumbnailAssetId: idSchema.nullable(),\n settings: jsonValueSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Course = z.output<typeof courseSchema>;\nexport type CourseInput = z.input<typeof courseSchema>;\n\nexport const activitySchema = z.object({\n orgId: idSchema,\n id: idSchema,\n moduleId: idSchema,\n courseId: idSchema,\n seq: z.number().int().min(0),\n settings: jsonValueSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Activity = z.output<typeof activitySchema>;\nexport type ActivityInput = z.input<typeof activitySchema>;\n\nexport const moduleSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n courseId: idSchema,\n title: z.string(),\n seq: z.number().int().min(0),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Module = z.output<typeof moduleSchema>;\nexport type ModuleInput = z.input<typeof moduleSchema>;\n\nexport const activityAssetSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n activityId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n}).strict();\nexport type ActivityAsset = z.output<typeof activityAssetSchema>;\nexport type ActivityAssetInput = z.input<typeof activityAssetSchema>;\n\nexport const saveActivityInputSchema = z.object({\n settings: jsonValueSchema.optional(),\n assetIds: z.array(idSchema).optional(),\n}).strict();\nexport type SaveActivityInput = z.infer<typeof saveActivityInputSchema>;\n\nexport const listCoursesQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n status: courseStatusSchema.optional(),\n category: z.string().optional(),\n}).strict();\nexport type ListCoursesQuery = z.infer<typeof listCoursesQuerySchema>;\n\nexport const createCourseInputSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n category: z.string().optional(),\n}).strict();\nexport type CreateCourseInput = z.infer<typeof createCourseInputSchema>;\n\nexport const updateCourseInputSchema = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n status: courseStatusSchema.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n settings: courseSettingsSchema.partial().optional(),\n}).strict();\nexport type UpdateCourseInput = z.infer<typeof updateCourseInputSchema>;\n\nexport const downloadStatusSchema = z.enum([\"draft\", \"published\"]);\nexport type DownloadStatus = z.infer<typeof downloadStatusSchema>;\n\nexport const downloadSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n type: z.literal(\"download\"),\n title: z.string(),\n slug: z.string(),\n description: z.string(),\n status: downloadStatusSchema,\n category: z.string(),\n thumbnailAssetId: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n}).strict();\nexport type Download = z.output<typeof downloadSchema>;\nexport type DownloadInput = z.input<typeof downloadSchema>;\n\nexport const downloadAssetSchema = z.object({\n orgId: idSchema,\n id: idSchema,\n downloadId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n displayName: z.string().nullable(),\n}).strict();\nexport type DownloadAsset = z.output<typeof downloadAssetSchema>;\nexport type DownloadAssetInput = z.input<typeof downloadAssetSchema>;\n\nexport const listDownloadsQuerySchema = z.object({\n page: z.number().int().min(1),\n pageSize: z.number().int().min(1),\n search: z.string().optional(),\n sort: z.string().optional(),\n status: downloadStatusSchema.optional(),\n category: z.string().optional(),\n}).strict();\nexport type ListDownloadsQuery = z.infer<typeof listDownloadsQuerySchema>;\n\nexport const createDownloadInputSchema = z.object({\n title: z.string(),\n description: z.string().optional(),\n category: z.string().optional(),\n}).strict();\nexport type CreateDownloadInput = z.infer<typeof createDownloadInputSchema>;\n\nexport const updateDownloadInputSchema = z.object({\n title: z.string().optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n status: downloadStatusSchema.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n}).strict();\nexport type UpdateDownloadInput = z.infer<typeof updateDownloadInputSchema>;\n\nexport const addDownloadAssetInputSchema = z.object({\n assetId: idSchema,\n displayName: z.string().optional(),\n}).strict();\nexport type AddDownloadAssetInput = z.infer<typeof addDownloadAssetInputSchema>;\n\nexport const reorderDownloadAssetsInputSchema = z.object({\n assetIds: z.array(idSch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AE,OAAO,CAAC,CAAC,SAAS;CAC3B,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,QAAQ,qBAAqB,SAAS;CACtC,kBAAkB,SAAS,SAAS,CAAC,CAAC,SAAS;AACjD,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,8BAA8B,EAAE,OAAO;CAClD,SAAS;CACT,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;AACnC,CAAC,CAAC,CAAC,OAAO;AAGV,MAAa,mCAAmC,EAAE,OAAO,EACvD,UAAU,EAAE,MAAM,QAAQ,EAC5B,CAAC,CAAC,CAAC,OAAO"}
|
|
1
|
+
{"version":3,"file":"content.js","names":[],"sources":["../../../src/types/schemas/content.ts"],"sourcesContent":["import { z } from 'zod';\nimport { activityCommentsRuleSchema, commentSettingsSchema } from './discussion.js';\nimport { idSchema, jsonValueSchema } from './shared.js';\n\nexport const contentTypeSchema = z.enum(['course', 'download']);\nexport type ContentType = z.infer<typeof contentTypeSchema>;\n\nexport const courseStatusSchema = z.enum(['draft', 'published']);\nexport type CourseStatus = z.infer<typeof courseStatusSchema>;\n\nexport const courseSettingsSchema = z\n .object({\n transcriptDownloads: z.boolean(),\n comments: commentSettingsSchema.optional(),\n })\n .strict();\nexport type CourseSettings = z.infer<typeof courseSettingsSchema>;\n\n/** Defaults for keys a stored settings row doesn't carry (or no row at all). */\nexport const courseSettingsDefaults: CourseSettings = { transcriptDownloads: false };\n\nexport const activitySettingsSchema = z\n .object({\n comments: activityCommentsRuleSchema.optional(),\n })\n .strict();\nexport type ActivitySettings = z.infer<typeof activitySettingsSchema>;\n\nexport const bundleSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n name: z.string(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Bundle = z.output<typeof bundleSchema>;\nexport type BundleInput = z.input<typeof bundleSchema>;\n\nexport const bundleItemSchema = z\n .object({\n orgId: idSchema,\n bundleId: idSchema,\n contentId: idSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type BundleItem = z.output<typeof bundleItemSchema>;\nexport type BundleItemInput = z.input<typeof bundleItemSchema>;\n\nexport const listBundlesQuerySchema = 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 })\n .strict();\nexport type ListBundlesQuery = z.infer<typeof listBundlesQuerySchema>;\n\nexport const createBundleInputSchema = z\n .object({\n name: z.string(),\n /** Content to put in the bundle at creation — bundle and items land together. */\n contentIds: z.array(idSchema).optional(),\n })\n .strict();\nexport type CreateBundleInput = z.infer<typeof createBundleInputSchema>;\n\nexport const updateBundleInputSchema = z\n .object({\n name: z.string().optional(),\n })\n .strict();\nexport type UpdateBundleInput = z.infer<typeof updateBundleInputSchema>;\n\nexport const contentItemSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n type: contentTypeSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type ContentItem = z.output<typeof contentItemSchema>;\nexport type ContentItemInput = z.input<typeof contentItemSchema>;\n\nexport const courseSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n type: z.literal('course'),\n title: z.string(),\n slug: z.string(),\n description: z.string(),\n status: courseStatusSchema,\n category: z.string(),\n thumbnailAssetId: idSchema.nullable(),\n settings: courseSettingsSchema,\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Course = z.output<typeof courseSchema>;\n\nexport const activitySchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n moduleId: idSchema,\n courseId: idSchema,\n seq: z.number().int().min(0),\n settings: jsonValueSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Activity = z.output<typeof activitySchema>;\nexport type ActivityInput = z.input<typeof activitySchema>;\n\nexport const moduleSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n courseId: idSchema,\n title: z.string(),\n seq: z.number().int().min(0),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Module = z.output<typeof moduleSchema>;\nexport type ModuleInput = z.input<typeof moduleSchema>;\n\nexport const activityAssetSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n activityId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type ActivityAsset = z.output<typeof activityAssetSchema>;\nexport type ActivityAssetInput = z.input<typeof activityAssetSchema>;\n\nexport const saveActivityInputSchema = z\n .object({\n settings: jsonValueSchema.optional(),\n assetIds: z.array(idSchema).optional(),\n })\n .strict();\nexport type SaveActivityInput = z.infer<typeof saveActivityInputSchema>;\n\nexport const listCoursesQuerySchema = 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: courseStatusSchema.optional(),\n category: z.string().optional(),\n })\n .strict();\nexport type ListCoursesQuery = z.infer<typeof listCoursesQuerySchema>;\n\nexport const createCourseInputSchema = z\n .object({\n title: z.string(),\n description: z.string().optional(),\n category: z.string().optional(),\n })\n .strict();\nexport type CreateCourseInput = z.infer<typeof createCourseInputSchema>;\n\nexport const updateCourseInputSchema = z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n status: courseStatusSchema.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n })\n .strict();\nexport type UpdateCourseInput = z.infer<typeof updateCourseInputSchema>;\n\nexport const downloadStatusSchema = z.enum(['draft', 'published']);\nexport type DownloadStatus = z.infer<typeof downloadStatusSchema>;\n\nexport const downloadSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n type: z.literal('download'),\n title: z.string(),\n slug: z.string(),\n description: z.string(),\n status: downloadStatusSchema,\n category: z.string(),\n thumbnailAssetId: idSchema.nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Download = z.output<typeof downloadSchema>;\nexport type DownloadInput = z.input<typeof downloadSchema>;\n\nexport const downloadAssetSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n downloadId: idSchema,\n assetId: idSchema,\n seq: z.number().int(),\n displayName: z.string().nullable(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type DownloadAsset = z.output<typeof downloadAssetSchema>;\nexport type DownloadAssetInput = z.input<typeof downloadAssetSchema>;\n\nexport const listDownloadsQuerySchema = 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: downloadStatusSchema.optional(),\n category: z.string().optional(),\n })\n .strict();\nexport type ListDownloadsQuery = z.infer<typeof listDownloadsQuerySchema>;\n\nexport const createDownloadInputSchema = z\n .object({\n title: z.string(),\n description: z.string().optional(),\n category: z.string().optional(),\n })\n .strict();\nexport type CreateDownloadInput = z.infer<typeof createDownloadInputSchema>;\n\nexport const updateDownloadInputSchema = z\n .object({\n title: z.string().optional(),\n description: z.string().optional(),\n category: z.string().optional(),\n status: downloadStatusSchema.optional(),\n thumbnailAssetId: idSchema.nullable().optional(),\n })\n .strict();\nexport type UpdateDownloadInput = z.infer<typeof updateDownloadInputSchema>;\n\nexport const addDownloadAssetInputSchema = z\n .object({\n assetId: idSchema,\n displayName: z.string().optional(),\n })\n .strict();\nexport type AddDownloadAssetInput = z.infer<typeof addDownloadAssetInputSchema>;\n\nexport const reorderDownloadAssetsInputSchema = z\n .object({\n assetIds: z.array(idSchema),\n })\n .strict();\nexport type ReorderDownloadAssetsInput = z.infer<typeof reorderDownloadAssetsInputSchema>;\n"],"mappings":";;;;AAIA,MAAa,oBAAoB,EAAE,KAAK,CAAC,UAAU,UAAU,CAAC;AAG9D,MAAa,qBAAqB,EAAE,KAAK,CAAC,SAAS,WAAW,CAAC;AAG/D,MAAa,uBAAuB,EACjC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S;CACjC,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAIV,MAAa,2BAA2B,EACrC,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,qBAAqB,SAAS;CACtC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,4BAA4B,EACtC,OAAO;CACN,OAAO,EAAE,OAAO;CAChB,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;AAChC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,4BAA4B,EACtC,OAAO;CACN,OAAO,EAAE,OAAO,CAAC,CAAC,SAAS;CAC3B,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;CACjC,UAAU,EAAE,OAAO,CAAC,CAAC,SAAS;CAC9B,QAAQ,qBAAqB,SAAS;CACtC,kBAAkB,SAAS,SAAS,CAAC,CAAC,SAAS;AACjD,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,8BAA8B,EACxC,OAAO;CACN,SAAS;CACT,aAAa,EAAE,OAAO,CAAC,CAAC,SAAS;AACnC,CAAC,CAAC,CACD,OAAO;AAGV,MAAa,mCAAmC,EAC7C,OAAO,EACN,UAAU,EAAE,MAAM,QAAQ,EAC5B,CAAC,CAAC,CACD,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","names":[],"sources":["../../../src/types/schemas/credentials.ts"],"sourcesContent":["import { z } from
|
|
1
|
+
{"version":3,"file":"credentials.js","names":[],"sources":["../../../src/types/schemas/credentials.ts"],"sourcesContent":["import { z } from 'zod';\nimport { idSchema } from './shared.js';\n\nexport const credentialSchema = z\n .object({\n orgId: idSchema,\n id: idSchema,\n ciphertext: z.string(),\n keyVersion: z.number().int(),\n createdAt: z.coerce.date(),\n updatedAt: z.coerce.date(),\n })\n .strict();\nexport type Credential = z.output<typeof credentialSchema>;\nexport type CredentialInput = z.input<typeof credentialSchema>;\n"],"mappings":";;;AAGA,MAAa,mBAAmB,EAC7B,OAAO;CACN,OAAO;CACP,IAAI;CACJ,YAAY,EAAE,OAAO;CACrB,YAAY,EAAE,OAAO,CAAC,CAAC,IAAI;CAC3B,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO"}
|
|
@@ -18,6 +18,12 @@ declare const commentSettingsSchema: z.ZodObject<{
|
|
|
18
18
|
}, z.core.$strict>;
|
|
19
19
|
type CommentSettings = z.infer<typeof commentSettingsSchema>;
|
|
20
20
|
type CommentsConfig = CommentSettings;
|
|
21
|
+
declare const activityCommentsRuleSchema: z.ZodEnum<{
|
|
22
|
+
never: "never";
|
|
23
|
+
inherit: "inherit";
|
|
24
|
+
always: "always";
|
|
25
|
+
}>;
|
|
26
|
+
type ActivityCommentsRule = z.infer<typeof activityCommentsRuleSchema>;
|
|
21
27
|
declare const commentSchema: z.ZodObject<{
|
|
22
28
|
id: z.ZodString;
|
|
23
29
|
orgId: z.ZodString;
|
|
@@ -55,6 +61,7 @@ declare const commentReactionSchema: z.ZodObject<{
|
|
|
55
61
|
orgUserId: z.ZodString;
|
|
56
62
|
emoji: z.ZodString;
|
|
57
63
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
64
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
58
65
|
}, z.core.$strict>;
|
|
59
66
|
type CommentReaction = z.output<typeof commentReactionSchema>;
|
|
60
67
|
declare const commentReportSchema: z.ZodObject<{
|
|
@@ -65,6 +72,7 @@ declare const commentReportSchema: z.ZodObject<{
|
|
|
65
72
|
reason: z.ZodString;
|
|
66
73
|
resolvedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
67
74
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
75
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
68
76
|
}, z.core.$strict>;
|
|
69
77
|
type CommentReport = z.output<typeof commentReportSchema>;
|
|
70
78
|
type CommentReportInput = z.input<typeof commentReportSchema>;
|
|
@@ -149,7 +157,7 @@ declare const commentListItemSchema: z.ZodObject<{
|
|
|
149
157
|
student: "student";
|
|
150
158
|
}>;
|
|
151
159
|
}, z.core.$strict>;
|
|
152
|
-
authorEmail: z.
|
|
160
|
+
authorEmail: z.ZodEmail;
|
|
153
161
|
removedBy: z.ZodNullable<z.ZodString>;
|
|
154
162
|
reports: z.ZodArray<z.ZodObject<{
|
|
155
163
|
reporter: z.ZodObject<{
|
|
@@ -188,5 +196,5 @@ declare const listCommentsQuerySchema: z.ZodObject<{
|
|
|
188
196
|
}, z.core.$strict>;
|
|
189
197
|
type ListCommentsQuery = z.infer<typeof listCommentsQuerySchema>;
|
|
190
198
|
//#endregion
|
|
191
|
-
export { Comment, CommentAuthor, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
|
|
199
|
+
export { ActivityCommentsRule, Comment, CommentAuthor, CommentInput, CommentListItem, CommentReaction, CommentReport, CommentReportInput, CommentReportSummary, CommentSettings, CommentStatus, CommentView, CommentsConfig, ListCommentsQuery, ReactionCounts, ReactionEmoji, activityCommentsRuleSchema, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
|
|
192
200
|
//# sourceMappingURL=discussion.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { idSchema } from "./shared.js";
|
|
1
|
+
import { emailSchema, idSchema } from "./shared.js";
|
|
2
2
|
import { roleSchema } from "./organizations.js";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
//#region src/types/schemas/discussion.ts
|
|
@@ -15,6 +15,11 @@ const commentSettingsSchema = z.object({
|
|
|
15
15
|
requireReview: z.boolean(),
|
|
16
16
|
reactions: z.boolean()
|
|
17
17
|
}).strict();
|
|
18
|
+
const activityCommentsRuleSchema = z.enum([
|
|
19
|
+
"inherit",
|
|
20
|
+
"always",
|
|
21
|
+
"never"
|
|
22
|
+
]);
|
|
18
23
|
const commentSchema = z.object({
|
|
19
24
|
id: idSchema,
|
|
20
25
|
orgId: idSchema,
|
|
@@ -39,7 +44,8 @@ const commentReactionSchema = z.object({
|
|
|
39
44
|
commentId: idSchema,
|
|
40
45
|
orgUserId: idSchema,
|
|
41
46
|
emoji: reactionEmojiSchema,
|
|
42
|
-
createdAt: z.coerce.date()
|
|
47
|
+
createdAt: z.coerce.date(),
|
|
48
|
+
updatedAt: z.coerce.date()
|
|
43
49
|
}).strict();
|
|
44
50
|
const commentReportSchema = z.object({
|
|
45
51
|
id: idSchema,
|
|
@@ -48,7 +54,8 @@ const commentReportSchema = z.object({
|
|
|
48
54
|
orgUserId: idSchema,
|
|
49
55
|
reason: z.string(),
|
|
50
56
|
resolvedAt: z.coerce.date().nullable(),
|
|
51
|
-
createdAt: z.coerce.date()
|
|
57
|
+
createdAt: z.coerce.date(),
|
|
58
|
+
updatedAt: z.coerce.date()
|
|
52
59
|
}).strict();
|
|
53
60
|
const commentViewSchema = z.object({
|
|
54
61
|
id: idSchema,
|
|
@@ -77,7 +84,7 @@ const commentListItemSchema = z.object({
|
|
|
77
84
|
body: z.string(),
|
|
78
85
|
status: commentStatusSchema,
|
|
79
86
|
author: commentAuthorSchema,
|
|
80
|
-
authorEmail:
|
|
87
|
+
authorEmail: emailSchema,
|
|
81
88
|
removedBy: idSchema.nullable(),
|
|
82
89
|
reports: z.array(commentReportSummarySchema),
|
|
83
90
|
createdAt: z.coerce.date(),
|
|
@@ -95,6 +102,6 @@ const listCommentsQuerySchema = z.object({
|
|
|
95
102
|
orgUserId: idSchema.optional()
|
|
96
103
|
}).strict();
|
|
97
104
|
//#endregion
|
|
98
|
-
export { commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
|
|
105
|
+
export { activityCommentsRuleSchema, commentAuthorSchema, commentListItemSchema, commentReactionSchema, commentReportSchema, commentReportSummarySchema, commentSchema, commentSettingsSchema, commentStatusSchema, commentViewSchema, listCommentsQuerySchema, reactionCountsSchema, reactionEmojiSchema };
|
|
99
106
|
|
|
100
107
|
//# sourceMappingURL=discussion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"discussion.js","names":[],"sources":["../../../src/types/schemas/discussion.ts"],"sourcesContent":["import { z } from
|
|
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,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;CACZ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;AAGV,MAAa,wBAAwB,EAClC,OAAO;CACN,IAAI;CACJ,UAAU,SAAS,SAAS;CAC5B,YAAY;CACZ,eAAe,EAAE,OAAO;CACxB,UAAU;CACV,MAAM,EAAE,OAAO;CACf,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,WAAW,SAAS,SAAS;CAC7B,SAAS,EAAE,MAAM,0BAA0B;CAC3C,WAAW,EAAE,OAAO,KAAK;CACzB,WAAW,EAAE,OAAO,KAAK;AAC3B,CAAC,CAAC,CACD,OAAO;AAGV,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,oBAAoB,SAAS;CACrC,UAAU,EAAE,QAAQ,CAAC,CAAC,SAAS;CAC/B,UAAU,SAAS,SAAS;CAC5B,YAAY,SAAS,SAAS;CAC9B,WAAW,SAAS,SAAS;AAC/B,CAAC,CAAC,CACD,OAAO"}
|
|
@@ -9,7 +9,8 @@ declare const entitlementSchema: z.ZodObject<{
|
|
|
9
9
|
orgId: z.ZodString;
|
|
10
10
|
id: z.ZodString;
|
|
11
11
|
orgUserId: z.ZodString;
|
|
12
|
-
|
|
12
|
+
bundleId: z.ZodNullable<z.ZodString>;
|
|
13
|
+
contentId: z.ZodNullable<z.ZodString>;
|
|
13
14
|
status: z.ZodEnum<{
|
|
14
15
|
active: "active";
|
|
15
16
|
revoked: "revoked";
|
|
@@ -17,6 +18,8 @@ declare const entitlementSchema: z.ZodObject<{
|
|
|
17
18
|
source: z.ZodString;
|
|
18
19
|
grantedAt: z.ZodCoercedDate<unknown>;
|
|
19
20
|
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
21
|
+
createdAt: z.ZodCoercedDate<unknown>;
|
|
22
|
+
updatedAt: z.ZodCoercedDate<unknown>;
|
|
20
23
|
}, z.core.$strict>;
|
|
21
24
|
type Entitlement = z.output<typeof entitlementSchema>;
|
|
22
25
|
type EntitlementInput = z.input<typeof entitlementSchema>;
|
|
@@ -33,15 +36,18 @@ declare const entitlementsQuerySchema: z.ZodObject<{
|
|
|
33
36
|
source: z.ZodOptional<z.ZodString>;
|
|
34
37
|
orgUserId: z.ZodOptional<z.ZodString>;
|
|
35
38
|
contentId: z.ZodOptional<z.ZodString>;
|
|
39
|
+
bundleId: z.ZodOptional<z.ZodString>;
|
|
36
40
|
type: z.ZodOptional<z.ZodEnum<{
|
|
37
41
|
download: "download";
|
|
38
42
|
course: "course";
|
|
39
43
|
}>>;
|
|
40
44
|
}, z.core.$strict>;
|
|
41
45
|
type EntitlementsQuery = z.infer<typeof entitlementsQuerySchema>;
|
|
46
|
+
/** A grant targets exactly one of: a bundle or a single content item. */
|
|
42
47
|
declare const grantEntitlementInputSchema: z.ZodObject<{
|
|
43
48
|
orgUserId: z.ZodString;
|
|
44
|
-
contentId: z.ZodString
|
|
49
|
+
contentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
50
|
+
bundleId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
51
|
expiresAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
46
52
|
}, z.core.$strict>;
|
|
47
53
|
type GrantEntitlementInput = z.output<typeof grantEntitlementInputSchema>;
|
|
@@ -6,11 +6,14 @@ const entitlementSchema = z.object({
|
|
|
6
6
|
orgId: idSchema,
|
|
7
7
|
id: idSchema,
|
|
8
8
|
orgUserId: idSchema,
|
|
9
|
-
|
|
9
|
+
bundleId: idSchema.nullable(),
|
|
10
|
+
contentId: idSchema.nullable(),
|
|
10
11
|
status: entitlementStatusSchema,
|
|
11
12
|
source: z.string(),
|
|
12
13
|
grantedAt: z.coerce.date(),
|
|
13
|
-
expiresAt: z.coerce.date().nullable()
|
|
14
|
+
expiresAt: z.coerce.date().nullable(),
|
|
15
|
+
createdAt: z.coerce.date(),
|
|
16
|
+
updatedAt: z.coerce.date()
|
|
14
17
|
}).strict();
|
|
15
18
|
const entitlementsQuerySchema = z.object({
|
|
16
19
|
page: z.number().int().min(1),
|
|
@@ -25,13 +28,16 @@ const entitlementsQuerySchema = z.object({
|
|
|
25
28
|
source: z.string().optional(),
|
|
26
29
|
orgUserId: idSchema.optional(),
|
|
27
30
|
contentId: idSchema.optional(),
|
|
31
|
+
bundleId: idSchema.optional(),
|
|
28
32
|
type: z.enum(["course", "download"]).optional()
|
|
29
33
|
}).strict();
|
|
34
|
+
/** A grant targets exactly one of: a bundle or a single content item. */
|
|
30
35
|
const grantEntitlementInputSchema = z.object({
|
|
31
36
|
orgUserId: idSchema,
|
|
32
|
-
contentId: idSchema,
|
|
37
|
+
contentId: idSchema.nullish(),
|
|
38
|
+
bundleId: idSchema.nullish(),
|
|
33
39
|
expiresAt: z.coerce.date().nullable()
|
|
34
|
-
}).strict();
|
|
40
|
+
}).strict().refine((v) => v.contentId != null !== (v.bundleId != null), { message: "Provide exactly one of contentId or bundleId" });
|
|
35
41
|
//#endregion
|
|
36
42
|
export { entitlementSchema, entitlementStatusSchema, entitlementsQuerySchema, grantEntitlementInputSchema };
|
|
37
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entitlements.js","names":[],"sources":["../../../src/types/schemas/entitlements.ts"],"sourcesContent":["import { z } from
|
|
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"}
|
|
@@ -3,7 +3,7 @@ import { z } from "zod";
|
|
|
3
3
|
declare const userSchema: z.ZodObject<{
|
|
4
4
|
id: z.ZodString;
|
|
5
5
|
externalId: z.ZodNullable<z.ZodString>;
|
|
6
|
-
email: z.
|
|
6
|
+
email: z.ZodEmail;
|
|
7
7
|
firstName: z.ZodNullable<z.ZodString>;
|
|
8
8
|
lastName: z.ZodNullable<z.ZodString>;
|
|
9
9
|
createdAt: z.ZodCoercedDate<unknown>;
|
|
@@ -14,13 +14,13 @@ type UserInput = z.input<typeof userSchema>;
|
|
|
14
14
|
declare const createUserInputSchema: z.ZodObject<{
|
|
15
15
|
id: z.ZodOptional<z.ZodString>;
|
|
16
16
|
externalId: z.ZodOptional<z.ZodString>;
|
|
17
|
-
email: z.
|
|
17
|
+
email: z.ZodEmail;
|
|
18
18
|
firstName: z.ZodOptional<z.ZodString>;
|
|
19
19
|
lastName: z.ZodOptional<z.ZodString>;
|
|
20
20
|
}, z.core.$strict>;
|
|
21
21
|
type CreateUserInput = z.infer<typeof createUserInputSchema>;
|
|
22
22
|
declare const provisionUserInputSchema: z.ZodObject<{
|
|
23
|
-
email: z.
|
|
23
|
+
email: z.ZodEmail;
|
|
24
24
|
firstName: z.ZodOptional<z.ZodString>;
|
|
25
25
|
lastName: z.ZodOptional<z.ZodString>;
|
|
26
26
|
}, z.core.$strict>;
|
|
@@ -29,7 +29,7 @@ declare const updateUserInputSchema: z.ZodObject<{
|
|
|
29
29
|
externalId: z.ZodOptional<z.ZodString>;
|
|
30
30
|
firstName: z.ZodOptional<z.ZodString>;
|
|
31
31
|
lastName: z.ZodOptional<z.ZodString>;
|
|
32
|
-
email: z.ZodOptional<z.
|
|
32
|
+
email: z.ZodOptional<z.ZodEmail>;
|
|
33
33
|
}, z.core.$strict>;
|
|
34
34
|
type UpdateUserInput = z.infer<typeof updateUserInputSchema>;
|
|
35
35
|
//#endregion
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { idSchema } from "./shared.js";
|
|
1
|
+
import { emailSchema, idSchema } from "./shared.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
//#region src/types/schemas/identity.ts
|
|
4
4
|
const userSchema = z.object({
|
|
5
5
|
id: idSchema,
|
|
6
6
|
externalId: idSchema.nullable(),
|
|
7
|
-
email:
|
|
7
|
+
email: emailSchema,
|
|
8
8
|
firstName: z.string().nullable(),
|
|
9
9
|
lastName: z.string().nullable(),
|
|
10
10
|
createdAt: z.coerce.date(),
|
|
@@ -13,12 +13,12 @@ const userSchema = z.object({
|
|
|
13
13
|
const createUserInputSchema = z.object({
|
|
14
14
|
id: idSchema.optional(),
|
|
15
15
|
externalId: idSchema.optional(),
|
|
16
|
-
email:
|
|
16
|
+
email: emailSchema,
|
|
17
17
|
firstName: z.string().optional(),
|
|
18
18
|
lastName: z.string().optional()
|
|
19
19
|
}).strict();
|
|
20
20
|
const provisionUserInputSchema = z.object({
|
|
21
|
-
email:
|
|
21
|
+
email: emailSchema,
|
|
22
22
|
firstName: z.string().optional(),
|
|
23
23
|
lastName: z.string().optional()
|
|
24
24
|
}).strict();
|
|
@@ -26,7 +26,7 @@ const updateUserInputSchema = z.object({
|
|
|
26
26
|
externalId: idSchema.optional(),
|
|
27
27
|
firstName: z.string().optional(),
|
|
28
28
|
lastName: z.string().optional(),
|
|
29
|
-
email:
|
|
29
|
+
email: emailSchema.optional()
|
|
30
30
|
}).strict();
|
|
31
31
|
//#endregion
|
|
32
32
|
export { createUserInputSchema, provisionUserInputSchema, updateUserInputSchema, userSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","names":[],"sources":["../../../src/types/schemas/identity.ts"],"sourcesContent":["import { z } from
|
|
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"}
|