@twreporter-academy/api-types 0.0.15 → 0.0.17
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/schemas/course.d.ts +72 -15
- package/dist/schemas/course.d.ts.map +1 -1
- package/dist/schemas/course.js +13 -12
- package/dist/schemas/course.js.map +1 -1
- package/dist/schemas/home.d.ts +62 -14
- package/dist/schemas/home.d.ts.map +1 -1
- package/dist/schemas/home.js +8 -7
- package/dist/schemas/home.js.map +1 -1
- package/package.json +1 -1
package/dist/schemas/course.d.ts
CHANGED
|
@@ -20,9 +20,9 @@ export declare const V1CourseLessonSchema: z.ZodObject<{
|
|
|
20
20
|
id: z.ZodString;
|
|
21
21
|
order: z.ZodNumber;
|
|
22
22
|
title: z.ZodString;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
startSeconds: z.ZodNumber;
|
|
24
|
+
endSeconds: z.ZodNumber;
|
|
25
|
+
durationSeconds: z.ZodNumber;
|
|
26
26
|
progress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
27
27
|
watchedSeconds: z.ZodNumber;
|
|
28
28
|
completedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -32,7 +32,7 @@ export declare const V1CourseLessonSchema: z.ZodObject<{
|
|
|
32
32
|
export declare const V1CourseLessonMetaSchema: z.ZodObject<{
|
|
33
33
|
order: z.ZodNullable<z.ZodNumber>;
|
|
34
34
|
title: z.ZodString;
|
|
35
|
-
duration: z.
|
|
35
|
+
duration: z.ZodNumber;
|
|
36
36
|
}, z.core.$strip>;
|
|
37
37
|
export declare const V1CourseInstructorSchema: z.ZodObject<{
|
|
38
38
|
id: z.ZodString;
|
|
@@ -40,7 +40,15 @@ export declare const V1CourseInstructorSchema: z.ZodObject<{
|
|
|
40
40
|
name: z.ZodString;
|
|
41
41
|
title: z.ZodString;
|
|
42
42
|
bio: z.ZodString;
|
|
43
|
-
|
|
43
|
+
avatar: z.ZodNullable<z.ZodObject<{
|
|
44
|
+
title: z.ZodString;
|
|
45
|
+
resized: z.ZodObject<{
|
|
46
|
+
tiny: z.ZodString;
|
|
47
|
+
small: z.ZodString;
|
|
48
|
+
medium: z.ZodString;
|
|
49
|
+
large: z.ZodString;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
}, z.core.$strip>>;
|
|
44
52
|
}, z.core.$strip>;
|
|
45
53
|
export declare const V1CourseResourceSchema: z.ZodObject<{
|
|
46
54
|
id: z.ZodString;
|
|
@@ -52,7 +60,15 @@ export declare const V1CourseFurtherReadingSchema: z.ZodObject<{
|
|
|
52
60
|
id: z.ZodString;
|
|
53
61
|
title: z.ZodString;
|
|
54
62
|
excerpt: z.ZodString;
|
|
55
|
-
|
|
63
|
+
thumbnail: z.ZodNullable<z.ZodObject<{
|
|
64
|
+
title: z.ZodString;
|
|
65
|
+
resized: z.ZodObject<{
|
|
66
|
+
tiny: z.ZodString;
|
|
67
|
+
small: z.ZodString;
|
|
68
|
+
medium: z.ZodString;
|
|
69
|
+
large: z.ZodString;
|
|
70
|
+
}, z.core.$strip>;
|
|
71
|
+
}, z.core.$strip>>;
|
|
56
72
|
url: z.ZodString;
|
|
57
73
|
}, z.core.$strip>;
|
|
58
74
|
export declare const V1CourseStatusSchema: z.ZodEnum<{
|
|
@@ -88,7 +104,15 @@ export declare const V1LearningCourseBadgeSchema: z.ZodLiteral<"new">;
|
|
|
88
104
|
export declare const V1LearningCourseItemSchema: z.ZodObject<{
|
|
89
105
|
slug: z.ZodString;
|
|
90
106
|
title: z.ZodString;
|
|
91
|
-
|
|
107
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
108
|
+
title: z.ZodString;
|
|
109
|
+
resized: z.ZodObject<{
|
|
110
|
+
tiny: z.ZodString;
|
|
111
|
+
small: z.ZodString;
|
|
112
|
+
medium: z.ZodString;
|
|
113
|
+
large: z.ZodString;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
}, z.core.$strip>>;
|
|
92
116
|
badge: z.ZodOptional<z.ZodLiteral<"new">>;
|
|
93
117
|
launchAt: z.ZodNullable<z.ZodISODateTime>;
|
|
94
118
|
completedLessons: z.ZodNumber;
|
|
@@ -100,7 +124,15 @@ export declare const V1CoursesLearningListResponseSchema: z.ZodObject<{
|
|
|
100
124
|
courses: z.ZodArray<z.ZodObject<{
|
|
101
125
|
slug: z.ZodString;
|
|
102
126
|
title: z.ZodString;
|
|
103
|
-
|
|
127
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
128
|
+
title: z.ZodString;
|
|
129
|
+
resized: z.ZodObject<{
|
|
130
|
+
tiny: z.ZodString;
|
|
131
|
+
small: z.ZodString;
|
|
132
|
+
medium: z.ZodString;
|
|
133
|
+
large: z.ZodString;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
}, z.core.$strip>>;
|
|
104
136
|
badge: z.ZodOptional<z.ZodLiteral<"new">>;
|
|
105
137
|
launchAt: z.ZodNullable<z.ZodISODateTime>;
|
|
106
138
|
completedLessons: z.ZodNumber;
|
|
@@ -127,13 +159,14 @@ export declare const V1ClassroomBySlugResponseSchema: z.ZodObject<{
|
|
|
127
159
|
name: z.ZodString;
|
|
128
160
|
}, z.core.$strip>>;
|
|
129
161
|
previewVideoId: z.ZodNullable<z.ZodString>;
|
|
162
|
+
videoId: z.ZodNullable<z.ZodString>;
|
|
130
163
|
lessons: z.ZodArray<z.ZodObject<{
|
|
131
164
|
id: z.ZodString;
|
|
132
165
|
order: z.ZodNumber;
|
|
133
166
|
title: z.ZodString;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
167
|
+
startSeconds: z.ZodNumber;
|
|
168
|
+
endSeconds: z.ZodNumber;
|
|
169
|
+
durationSeconds: z.ZodNumber;
|
|
137
170
|
progress: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
138
171
|
watchedSeconds: z.ZodNumber;
|
|
139
172
|
completedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
@@ -146,7 +179,15 @@ export declare const V1ClassroomBySlugResponseSchema: z.ZodObject<{
|
|
|
146
179
|
name: z.ZodString;
|
|
147
180
|
title: z.ZodString;
|
|
148
181
|
bio: z.ZodString;
|
|
149
|
-
|
|
182
|
+
avatar: z.ZodNullable<z.ZodObject<{
|
|
183
|
+
title: z.ZodString;
|
|
184
|
+
resized: z.ZodObject<{
|
|
185
|
+
tiny: z.ZodString;
|
|
186
|
+
small: z.ZodString;
|
|
187
|
+
medium: z.ZodString;
|
|
188
|
+
large: z.ZodString;
|
|
189
|
+
}, z.core.$strip>;
|
|
190
|
+
}, z.core.$strip>>;
|
|
150
191
|
}, z.core.$strip>>;
|
|
151
192
|
resources: z.ZodArray<z.ZodObject<{
|
|
152
193
|
id: z.ZodString;
|
|
@@ -158,7 +199,15 @@ export declare const V1ClassroomBySlugResponseSchema: z.ZodObject<{
|
|
|
158
199
|
id: z.ZodString;
|
|
159
200
|
title: z.ZodString;
|
|
160
201
|
excerpt: z.ZodString;
|
|
161
|
-
|
|
202
|
+
thumbnail: z.ZodNullable<z.ZodObject<{
|
|
203
|
+
title: z.ZodString;
|
|
204
|
+
resized: z.ZodObject<{
|
|
205
|
+
tiny: z.ZodString;
|
|
206
|
+
small: z.ZodString;
|
|
207
|
+
medium: z.ZodString;
|
|
208
|
+
large: z.ZodString;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
}, z.core.$strip>>;
|
|
162
211
|
url: z.ZodString;
|
|
163
212
|
}, z.core.$strip>>;
|
|
164
213
|
}, z.core.$strip>;
|
|
@@ -184,7 +233,7 @@ export declare const V1CourseBySlugResponseSchema: z.ZodObject<{
|
|
|
184
233
|
lessonsMeta: z.ZodArray<z.ZodObject<{
|
|
185
234
|
order: z.ZodNullable<z.ZodNumber>;
|
|
186
235
|
title: z.ZodString;
|
|
187
|
-
duration: z.
|
|
236
|
+
duration: z.ZodNumber;
|
|
188
237
|
}, z.core.$strip>>;
|
|
189
238
|
instructors: z.ZodArray<z.ZodObject<{
|
|
190
239
|
id: z.ZodString;
|
|
@@ -192,7 +241,15 @@ export declare const V1CourseBySlugResponseSchema: z.ZodObject<{
|
|
|
192
241
|
name: z.ZodString;
|
|
193
242
|
title: z.ZodString;
|
|
194
243
|
bio: z.ZodString;
|
|
195
|
-
|
|
244
|
+
avatar: z.ZodNullable<z.ZodObject<{
|
|
245
|
+
title: z.ZodString;
|
|
246
|
+
resized: z.ZodObject<{
|
|
247
|
+
tiny: z.ZodString;
|
|
248
|
+
small: z.ZodString;
|
|
249
|
+
medium: z.ZodString;
|
|
250
|
+
large: z.ZodString;
|
|
251
|
+
}, z.core.$strip>;
|
|
252
|
+
}, z.core.$strip>>;
|
|
196
253
|
}, z.core.$strip>>;
|
|
197
254
|
heroImageVideo: z.ZodNullable<z.ZodObject<{
|
|
198
255
|
title: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course.d.ts","sourceRoot":"","sources":["../../src/schemas/course.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,OAAO,EAAE,GACT,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAE3B,eAAO,MAAM,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAO/C,CAAA;AAEF,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,eAAO,MAAM,gCAAgC;;;;;;;;;;;iBAI3C,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;iBAcP,CAAA;AAE1B,eAAO,MAAM,wBAAwB;;;;
|
|
1
|
+
{"version":3,"file":"course.d.ts","sourceRoot":"","sources":["../../src/schemas/course.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAUvB,MAAM,MAAM,SAAS,GACjB,MAAM,GACN,MAAM,GACN,OAAO,GACP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
|
20
20
|
order: z.number().int(),
|
|
21
21
|
title: z.string(),
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
|
|
22
|
+
/** Segment start in the course video (seconds) */
|
|
23
|
+
startSeconds: z.number().int(),
|
|
24
|
+
/** Segment end in the course video (seconds) */
|
|
25
|
+
endSeconds: z.number().int(),
|
|
26
|
+
/** Derived segment length: max(0, endSeconds - startSeconds) */
|
|
27
|
+
durationSeconds: z.number().int(),
|
|
28
28
|
/** Present when request includes a valid member JWT; null when no progress record */
|
|
29
29
|
progress: V1LessonProgressSchema.nullable().optional()
|
|
30
30
|
}).openapi('CourseLesson');
|
|
31
31
|
export const V1CourseLessonMetaSchema = z.object({
|
|
32
32
|
order: z.number().int().nullable(),
|
|
33
33
|
title: z.string(),
|
|
34
|
-
/**
|
|
35
|
-
duration: z.number().int()
|
|
36
|
-
/** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */
|
|
34
|
+
/** Derived segment length: max(0, endSeconds - startSeconds) */
|
|
35
|
+
duration: z.number().int()
|
|
37
36
|
}).openapi('CourseLessonMeta');
|
|
38
37
|
export const V1CourseInstructorSchema = z.object({
|
|
39
38
|
id: z.string(),
|
|
@@ -41,7 +40,7 @@ export const V1CourseInstructorSchema = z.object({
|
|
|
41
40
|
name: z.string(),
|
|
42
41
|
title: z.string(),
|
|
43
42
|
bio: z.string(),
|
|
44
|
-
|
|
43
|
+
avatar: PhotoSchema.nullable()
|
|
45
44
|
}).openapi('CourseInstructor');
|
|
46
45
|
export const V1CourseResourceSchema = z.object({
|
|
47
46
|
id: z.string(),
|
|
@@ -54,7 +53,7 @@ export const V1CourseFurtherReadingSchema = z.object({
|
|
|
54
53
|
id: z.string(),
|
|
55
54
|
title: z.string(),
|
|
56
55
|
excerpt: z.string(),
|
|
57
|
-
|
|
56
|
+
thumbnail: PhotoSchema.nullable(),
|
|
58
57
|
url: z.string()
|
|
59
58
|
}).openapi('CourseFurtherReading');
|
|
60
59
|
export const V1CourseStatusSchema = z.enum(['published', 'coming_soon']);
|
|
@@ -74,7 +73,7 @@ export const V1LearningCourseBadgeSchema = z.literal('new');
|
|
|
74
73
|
export const V1LearningCourseItemSchema = z.object({
|
|
75
74
|
slug: z.string(),
|
|
76
75
|
title: z.string(),
|
|
77
|
-
|
|
76
|
+
image: PhotoSchema.nullable(),
|
|
78
77
|
badge: V1LearningCourseBadgeSchema.optional(),
|
|
79
78
|
launchAt: z.iso.datetime().nullable(),
|
|
80
79
|
completedLessons: z.number().int().nonnegative(),
|
|
@@ -100,6 +99,8 @@ export const V1ClassroomBySlugResponseSchema = z.object({
|
|
|
100
99
|
tags: z.array(V1CourseTagSchema),
|
|
101
100
|
/** Trial/preview stream only; null when unconfigured or course is coming_soon */
|
|
102
101
|
previewVideoId: z.string().nullable(),
|
|
102
|
+
/** Course video Cloudflare stream id; null when unpaid or not set */
|
|
103
|
+
videoId: z.string().nullable(),
|
|
103
104
|
lessons: z.array(V1CourseLessonSchema),
|
|
104
105
|
instructors: z.array(V1CourseInstructorSchema),
|
|
105
106
|
resources: z.array(V1CourseResourceSchema),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"course.js","names":["z","internalServerErrorResponse","RestErrorBodySchema","CloudflareStreamVideoSchema","V1LessonProgressSchema","PhotoSchema","registry","CourseThumbnailSchema","JsonValueSchema","union","string","number","boolean","null","array","unknown","record","V1CourseSlugPathParamsSchema","object","slug","min","max","V1CourseBySlugMetaResponseSchema","ogTitle","ogDescription","ogImage","nullable","V1CourseLessonSchema","id","order","int","title","videoId","durationSeconds","isFree","progress","optional","openapi","V1CourseLessonMetaSchema","duration","V1CourseInstructorSchema","name","bio","avatarUrl","V1CourseResourceSchema","description","downloadUrl","V1CourseFurtherReadingSchema","excerpt","thumbnailUrl","url","V1CourseStatusSchema","enum","V1HeaderCourseBadgeSchema","V1HeaderCourseItemSchema","subtitle","badge","V1CoursesListResponseSchema","courses","V1LearningCourseBadgeSchema","literal","V1LearningCourseItemSchema","imageUrl","launchAt","iso","datetime","completedLessons","nonnegative","totalLessons","progressPercent","unitTitle","describe","V1CoursesLearningListResponseSchema","V1CourseTagSchema","V1ClassroomBySlugResponseSchema","summary","status","tags","previewVideoId","lessons","instructors","resources","furtherReading","V1CourseBySlugResponseSchema","trialVideos","lessonsMeta","heroImageVideo","heroImage","registerPath","method","path","responses","content","schema","request","params"],"sources":["../../src/schemas/course.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { CloudflareStreamVideoSchema } from './cloudflare-stream.js'\nimport { V1LessonProgressSchema } from './lesson-progress.js'\nimport { PhotoSchema } from './photo.js'\nimport { registry } from './registry.js'\nimport { CourseThumbnailSchema } from './tag.js'\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | unknown[]\n | Record<string, unknown>\n\nexport const JsonValueSchema: z.ZodType<JsonValue> = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n])\n\nexport const V1CourseSlugPathParamsSchema = z.object({\n slug: z.string().min(1).max(200),\n})\n\nexport const V1CourseBySlugMetaResponseSchema = z.object({\n ogTitle: z.string(),\n ogDescription: z.string(),\n ogImage: CourseThumbnailSchema.nullable(),\n})\n\nexport const V1CourseLessonSchema = z\n .object({\n id: z.string(),\n order: z.number().int(),\n title: z.string(),\n /** Cloudflare stream id for this lesson; null when not yet set */\n videoId: z.string().nullable(),\n /** Video length in seconds (from CMS); null when not yet set */\n durationSeconds: z.number().int().nullable(),\n /** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */\n isFree: z.boolean(),\n /** Present when request includes a valid member JWT; null when no progress record */\n progress: V1LessonProgressSchema.nullable().optional(),\n })\n .openapi('CourseLesson')\n\nexport const V1CourseLessonMetaSchema = z\n .object({\n order: z.number().int().nullable(),\n title: z.string(),\n /** Video length in seconds (from CMS); null when not yet set */\n duration: z.number().int().nullable(),\n /** CMS 免費試看 flag; playback access is decided by user role (out of scope here) */\n })\n .openapi('CourseLessonMeta')\n\nexport const V1CourseInstructorSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n title: z.string(),\n bio: z.string(),\n avatarUrl: z.string().nullable(),\n })\n .openapi('CourseInstructor')\n\nexport const V1CourseResourceSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n /** GCS file URL; empty when no PDF uploaded */\n downloadUrl: z.string(),\n })\n .openapi('CourseResource')\n\nexport const V1CourseFurtherReadingSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n excerpt: z.string(),\n thumbnailUrl: z.string().nullable(),\n url: z.string(),\n })\n .openapi('CourseFurtherReading')\n\nexport const V1CourseStatusSchema = z.enum(['published', 'coming_soon'])\n\nexport const V1HeaderCourseBadgeSchema = z.enum(['new', 'wip'])\n\nexport const V1HeaderCourseItemSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n badge: V1HeaderCourseBadgeSchema.optional(),\n })\n .openapi('HeaderCourseItem')\n\nexport const V1CoursesListResponseSchema = z\n .object({\n courses: z.array(V1HeaderCourseItemSchema),\n })\n .openapi('CoursesListResponse')\n\n/** Learning badge is only `new`; `wip` / coming_soon courses are excluded from this list. */\nexport const V1LearningCourseBadgeSchema = z.literal('new')\n\nexport const V1LearningCourseItemSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n imageUrl: z.string().nullable(),\n badge: V1LearningCourseBadgeSchema.optional(),\n launchAt: z.iso.datetime().nullable(),\n completedLessons: z.number().int().nonnegative(),\n totalLessons: z.number().int().nonnegative(),\n progressPercent: z.number().int().min(0).max(100),\n /** Title of the next incomplete lesson; last lesson title when every lesson is complete. */\n unitTitle: z\n .string()\n .describe(\n 'Title of the next incomplete lesson; last lesson title when every lesson is complete.'\n ),\n })\n .openapi('LearningCourseItem')\n\nexport const V1CoursesLearningListResponseSchema = z\n .object({\n courses: z.array(V1LearningCourseItemSchema),\n })\n .openapi('CoursesLearningListResponse')\n\nexport const V1CourseTagSchema = z.object({\n slug: z.string(),\n name: z.string(),\n})\n\nexport const V1ClassroomBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n previewVideoId: z.string().nullable(),\n lessons: z.array(V1CourseLessonSchema),\n instructors: z.array(V1CourseInstructorSchema),\n resources: z.array(V1CourseResourceSchema),\n furtherReading: z.array(V1CourseFurtherReadingSchema),\n })\n .openapi('ClassroomDetail')\n\nexport const V1CourseBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n launchAt: z.iso.datetime().nullable(),\n description: JsonValueSchema.nullable(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n trialVideos: z.array(CloudflareStreamVideoSchema).nullable(),\n lessonsMeta: z.array(V1CourseLessonMetaSchema),\n instructors: z.array(V1CourseInstructorSchema),\n heroImageVideo: CloudflareStreamVideoSchema.nullable(),\n heroImage: PhotoSchema.nullable(),\n })\n .openapi('CourseDetail')\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses',\n tags: ['Courses'],\n description: 'Header course list.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CoursesListResponseSchema },\n },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}/meta',\n tags: ['Courses'],\n description: 'OG metadata for a course page.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugMetaResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}',\n tags: ['Courses'],\n description:\n 'Full course detail for the classroom page. When status is coming_soon, lessons, resources, furtherReading, and previewVideoId are empty/null while title, description, tags, and instructors remain visible.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,2BAA2B,QAAQ,wBAAwB;AACpE,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,qBAAqB,QAAQ,UAAU;AAUhD,OAAO,MAAMC,eAAqC,GAAGR,CAAC,CAACS,KAAK,CAAC,CAC3DT,CAAC,CAACU,MAAM,CAAC,CAAC,EACVV,CAAC,CAACW,MAAM,CAAC,CAAC,EACVX,CAAC,CAACY,OAAO,CAAC,CAAC,EACXZ,CAAC,CAACa,IAAI,CAAC,CAAC,EACRb,CAAC,CAACc,KAAK,CAACd,CAAC,CAACe,OAAO,CAAC,CAAC,CAAC,EACpBf,CAAC,CAACgB,MAAM,CAAChB,CAAC,CAACU,MAAM,CAAC,CAAC,EAAEV,CAAC,CAAC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EAAE,CAAC,SAAS,CAAC;EACjBhC,WAAW,EACT,8MAA8M;EAChNiD,OAAO,EAAE;IAAEC,MAAM,EAAE9E;EAA6B,CAAC;EACjD0E,SAAS,EAAE;IACT,GAAG,EAAE;MACH9C,WAAW,EAAE,SAAS;MACtB+C,OAAO,EAAE;QACP,kBAAkB,EAAE;UAAEC,MAAM,EAAEV;QAA6B;MAC7D;IACF,CAAC;IACD,GAAG,EAAE;MACHtC,WAAW,EAAE,aAAa;MAC1B+C,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAE3F;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG,EAAE;MACH2C,WAAW,EAAE,kBAAkB;MAC/B+C,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAE3F;QAAoB;MAAE;IACjE,CAAC;IACD,GAAGD;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"course.js","names":["z","internalServerErrorResponse","RestErrorBodySchema","CloudflareStreamVideoSchema","V1LessonProgressSchema","PhotoSchema","registry","CourseThumbnailSchema","JsonValueSchema","union","string","number","boolean","null","array","unknown","record","V1CourseSlugPathParamsSchema","object","slug","min","max","V1CourseBySlugMetaResponseSchema","ogTitle","ogDescription","ogImage","nullable","V1CourseLessonSchema","id","order","int","title","startSeconds","endSeconds","durationSeconds","progress","optional","openapi","V1CourseLessonMetaSchema","duration","V1CourseInstructorSchema","name","bio","avatar","V1CourseResourceSchema","description","downloadUrl","V1CourseFurtherReadingSchema","excerpt","thumbnail","url","V1CourseStatusSchema","enum","V1HeaderCourseBadgeSchema","V1HeaderCourseItemSchema","subtitle","badge","V1CoursesListResponseSchema","courses","V1LearningCourseBadgeSchema","literal","V1LearningCourseItemSchema","image","launchAt","iso","datetime","completedLessons","nonnegative","totalLessons","progressPercent","unitTitle","describe","V1CoursesLearningListResponseSchema","V1CourseTagSchema","V1ClassroomBySlugResponseSchema","summary","status","tags","previewVideoId","videoId","lessons","instructors","resources","furtherReading","V1CourseBySlugResponseSchema","trialVideos","lessonsMeta","heroImageVideo","heroImage","registerPath","method","path","responses","content","schema","request","params"],"sources":["../../src/schemas/course.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { RestErrorBodySchema } from '../rest.js'\nimport { CloudflareStreamVideoSchema } from './cloudflare-stream.js'\nimport { V1LessonProgressSchema } from './lesson-progress.js'\nimport { PhotoSchema } from './photo.js'\nimport { registry } from './registry.js'\nimport { CourseThumbnailSchema } from './tag.js'\n\nexport type JsonValue =\n | string\n | number\n | boolean\n | null\n | unknown[]\n | Record<string, unknown>\n\nexport const JsonValueSchema: z.ZodType<JsonValue> = z.union([\n z.string(),\n z.number(),\n z.boolean(),\n z.null(),\n z.array(z.unknown()),\n z.record(z.string(), z.unknown()),\n])\n\nexport const V1CourseSlugPathParamsSchema = z.object({\n slug: z.string().min(1).max(200),\n})\n\nexport const V1CourseBySlugMetaResponseSchema = z.object({\n ogTitle: z.string(),\n ogDescription: z.string(),\n ogImage: CourseThumbnailSchema.nullable(),\n})\n\nexport const V1CourseLessonSchema = z\n .object({\n id: z.string(),\n order: z.number().int(),\n title: z.string(),\n /** Segment start in the course video (seconds) */\n startSeconds: z.number().int(),\n /** Segment end in the course video (seconds) */\n endSeconds: z.number().int(),\n /** Derived segment length: max(0, endSeconds - startSeconds) */\n durationSeconds: z.number().int(),\n /** Present when request includes a valid member JWT; null when no progress record */\n progress: V1LessonProgressSchema.nullable().optional(),\n })\n .openapi('CourseLesson')\n\nexport const V1CourseLessonMetaSchema = z\n .object({\n order: z.number().int().nullable(),\n title: z.string(),\n /** Derived segment length: max(0, endSeconds - startSeconds) */\n duration: z.number().int(),\n })\n .openapi('CourseLessonMeta')\n\nexport const V1CourseInstructorSchema = z\n .object({\n id: z.string(),\n slug: z.string(),\n name: z.string(),\n title: z.string(),\n bio: z.string(),\n avatar: PhotoSchema.nullable(),\n })\n .openapi('CourseInstructor')\n\nexport const V1CourseResourceSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n description: z.string(),\n /** GCS file URL; empty when no PDF uploaded */\n downloadUrl: z.string(),\n })\n .openapi('CourseResource')\n\nexport const V1CourseFurtherReadingSchema = z\n .object({\n id: z.string(),\n title: z.string(),\n excerpt: z.string(),\n thumbnail: PhotoSchema.nullable(),\n url: z.string(),\n })\n .openapi('CourseFurtherReading')\n\nexport const V1CourseStatusSchema = z.enum(['published', 'coming_soon'])\n\nexport const V1HeaderCourseBadgeSchema = z.enum(['new', 'wip'])\n\nexport const V1HeaderCourseItemSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n badge: V1HeaderCourseBadgeSchema.optional(),\n })\n .openapi('HeaderCourseItem')\n\nexport const V1CoursesListResponseSchema = z\n .object({\n courses: z.array(V1HeaderCourseItemSchema),\n })\n .openapi('CoursesListResponse')\n\n/** Learning badge is only `new`; `wip` / coming_soon courses are excluded from this list. */\nexport const V1LearningCourseBadgeSchema = z.literal('new')\n\nexport const V1LearningCourseItemSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n image: PhotoSchema.nullable(),\n badge: V1LearningCourseBadgeSchema.optional(),\n launchAt: z.iso.datetime().nullable(),\n completedLessons: z.number().int().nonnegative(),\n totalLessons: z.number().int().nonnegative(),\n progressPercent: z.number().int().min(0).max(100),\n /** Title of the next incomplete lesson; last lesson title when every lesson is complete. */\n unitTitle: z\n .string()\n .describe(\n 'Title of the next incomplete lesson; last lesson title when every lesson is complete.'\n ),\n })\n .openapi('LearningCourseItem')\n\nexport const V1CoursesLearningListResponseSchema = z\n .object({\n courses: z.array(V1LearningCourseItemSchema),\n })\n .openapi('CoursesLearningListResponse')\n\nexport const V1CourseTagSchema = z.object({\n slug: z.string(),\n name: z.string(),\n})\n\nexport const V1ClassroomBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n previewVideoId: z.string().nullable(),\n /** Course video Cloudflare stream id; null when unpaid or not set */\n videoId: z.string().nullable(),\n lessons: z.array(V1CourseLessonSchema),\n instructors: z.array(V1CourseInstructorSchema),\n resources: z.array(V1CourseResourceSchema),\n furtherReading: z.array(V1CourseFurtherReadingSchema),\n })\n .openapi('ClassroomDetail')\n\nexport const V1CourseBySlugResponseSchema = z\n .object({\n slug: z.string(),\n title: z.string(),\n subtitle: z.string(),\n summary: z.string(),\n launchAt: z.iso.datetime().nullable(),\n description: JsonValueSchema.nullable(),\n /** published: full payload; coming_soon: lessons/resources/furtherReading/previewVideoId stripped */\n status: V1CourseStatusSchema,\n tags: z.array(V1CourseTagSchema),\n /** Trial/preview stream only; null when unconfigured or course is coming_soon */\n trialVideos: z.array(CloudflareStreamVideoSchema).nullable(),\n lessonsMeta: z.array(V1CourseLessonMetaSchema),\n instructors: z.array(V1CourseInstructorSchema),\n heroImageVideo: CloudflareStreamVideoSchema.nullable(),\n heroImage: PhotoSchema.nullable(),\n })\n .openapi('CourseDetail')\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses',\n tags: ['Courses'],\n description: 'Header course list.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CoursesListResponseSchema },\n },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}/meta',\n tags: ['Courses'],\n description: 'OG metadata for a course page.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugMetaResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/courses/{slug}',\n tags: ['Courses'],\n description:\n 'Full course detail for the classroom page. When status is coming_soon, lessons, resources, furtherReading, and previewVideoId are empty/null while title, description, tags, and instructors remain visible.',\n request: { params: V1CourseSlugPathParamsSchema },\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1CourseBySlugResponseSchema },\n },\n },\n 400: {\n description: 'Bad request',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n 404: {\n description: 'Course not found',\n content: { 'application/json': { schema: RestErrorBodySchema } },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,mBAAmB,QAAQ,YAAY;AAChD,SAASC,2BAA2B,QAAQ,wBAAwB;AACpE,SAASC,sBAAsB,QAAQ,sBAAsB;AAC7D,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,QAAQ,QAAQ,eAAe;AACxC,SAASC,qBAAqB,QAAQ,UAAU;AAUhD,OAAO,MAAMC,eAAqC,GAAGR,CAAC,CAACS,KAAK,CAAC,CAC3DT,CAAC,CAACU,MAAM,CAAC,CAAC,EACVV,CAAC,CAACW,MAAM,CAAC,CAAC,EACVX,CAAC,CAACY,OAAO,CAAC,CAAC,EACXZ,CAAC,CAACa,IAAI,CAAC,CAAC,EACRb,CAAC,CAACc,KAAK,CAACd,CAAC,CAACe,OAAO,CAAC,CAAC,CAAC,EACpBf,CAAC,CAACgB,MAAM,CAAChB,CAAC,CAACU,MAAM,CAAC,CAAC,EAAEV,CAAC,CAACe,OAAO,CAAC,CAAC,CAAC,CAClC,CAAC;AAEF,OAAO,MAAME,4BAA4B,GAAGjB,CAAC,CAACkB,MAAM,CAAC;EACnDC,IAAI,EAAEnB,CAAC,CAACU,MAAM,CAAC,CAAC,CAACU,GAAG,CAAC,CAAC,CAAC,CAAC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E;UAAEC,MAAM,EAAEV;QAA6B;MAC7D;IACF,CAAC;IACD,GAAG,EAAE;MACHvC,WAAW,EAAE,aAAa;MAC1BgD,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAE5F;QAAoB;MAAE;IACjE,CAAC;IACD,GAAG,EAAE;MACH2C,WAAW,EAAE,kBAAkB;MAC/BgD,OAAO,EAAE;QAAE,kBAAkB,EAAE;UAAEC,MAAM,EAAE5F;QAAoB;MAAE;IACjE,CAAC;IACD,GAAGD;EACL;AACF,CAAC,CAAC","ignoreList":[]}
|
package/dist/schemas/home.d.ts
CHANGED
|
@@ -3,13 +3,29 @@ export declare const V1HomePostCardSchema: z.ZodObject<{
|
|
|
3
3
|
title: z.ZodString;
|
|
4
4
|
description: z.ZodString;
|
|
5
5
|
link: z.ZodString;
|
|
6
|
-
|
|
6
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
resized: z.ZodObject<{
|
|
9
|
+
tiny: z.ZodString;
|
|
10
|
+
small: z.ZodString;
|
|
11
|
+
medium: z.ZodString;
|
|
12
|
+
large: z.ZodString;
|
|
13
|
+
}, z.core.$strip>;
|
|
14
|
+
}, z.core.$strip>>;
|
|
7
15
|
}, z.core.$strip>;
|
|
8
16
|
export declare const V1HomeActivityCardSchema: z.ZodObject<{
|
|
9
17
|
title: z.ZodString;
|
|
10
18
|
description: z.ZodString;
|
|
11
19
|
link: z.ZodString;
|
|
12
|
-
|
|
20
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
21
|
+
title: z.ZodString;
|
|
22
|
+
resized: z.ZodObject<{
|
|
23
|
+
tiny: z.ZodString;
|
|
24
|
+
small: z.ZodString;
|
|
25
|
+
medium: z.ZodString;
|
|
26
|
+
large: z.ZodString;
|
|
27
|
+
}, z.core.$strip>;
|
|
28
|
+
}, z.core.$strip>>;
|
|
13
29
|
badgeText: z.ZodString;
|
|
14
30
|
buttonText: z.ZodString;
|
|
15
31
|
}, z.core.$strip>;
|
|
@@ -17,7 +33,15 @@ export declare const V1HomeCourseCardSchema: z.ZodObject<{
|
|
|
17
33
|
title: z.ZodString;
|
|
18
34
|
description: z.ZodString;
|
|
19
35
|
slug: z.ZodString;
|
|
20
|
-
|
|
36
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
37
|
+
title: z.ZodString;
|
|
38
|
+
resized: z.ZodObject<{
|
|
39
|
+
tiny: z.ZodString;
|
|
40
|
+
small: z.ZodString;
|
|
41
|
+
medium: z.ZodString;
|
|
42
|
+
large: z.ZodString;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
}, z.core.$strip>>;
|
|
21
45
|
instructors: z.ZodArray<z.ZodObject<{
|
|
22
46
|
name: z.ZodString;
|
|
23
47
|
}, z.core.$strip>>;
|
|
@@ -26,10 +50,10 @@ export declare const V1HomeCourseCardSchema: z.ZodObject<{
|
|
|
26
50
|
name: z.ZodString;
|
|
27
51
|
ogTitle: z.ZodString;
|
|
28
52
|
ogDescription: z.ZodString;
|
|
29
|
-
homePageImageXL: z.ZodString
|
|
30
|
-
homePageImageL: z.ZodString
|
|
31
|
-
homePageImageM: z.ZodString
|
|
32
|
-
homePageImageS: z.ZodString
|
|
53
|
+
homePageImageXL: z.ZodNullable<z.ZodString>;
|
|
54
|
+
homePageImageL: z.ZodNullable<z.ZodString>;
|
|
55
|
+
homePageImageM: z.ZodNullable<z.ZodString>;
|
|
56
|
+
homePageImageS: z.ZodNullable<z.ZodString>;
|
|
33
57
|
}, z.core.$strip>>;
|
|
34
58
|
status: z.ZodEnum<{
|
|
35
59
|
published: "published";
|
|
@@ -42,13 +66,29 @@ export declare const V1HomePageResponseSchema: z.ZodObject<{
|
|
|
42
66
|
title: z.ZodString;
|
|
43
67
|
description: z.ZodString;
|
|
44
68
|
link: z.ZodString;
|
|
45
|
-
|
|
69
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
70
|
+
title: z.ZodString;
|
|
71
|
+
resized: z.ZodObject<{
|
|
72
|
+
tiny: z.ZodString;
|
|
73
|
+
small: z.ZodString;
|
|
74
|
+
medium: z.ZodString;
|
|
75
|
+
large: z.ZodString;
|
|
76
|
+
}, z.core.$strip>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
46
78
|
}, z.core.$strip>>;
|
|
47
79
|
activities: z.ZodArray<z.ZodObject<{
|
|
48
80
|
title: z.ZodString;
|
|
49
81
|
description: z.ZodString;
|
|
50
82
|
link: z.ZodString;
|
|
51
|
-
|
|
83
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
84
|
+
title: z.ZodString;
|
|
85
|
+
resized: z.ZodObject<{
|
|
86
|
+
tiny: z.ZodString;
|
|
87
|
+
small: z.ZodString;
|
|
88
|
+
medium: z.ZodString;
|
|
89
|
+
large: z.ZodString;
|
|
90
|
+
}, z.core.$strip>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
52
92
|
badgeText: z.ZodString;
|
|
53
93
|
buttonText: z.ZodString;
|
|
54
94
|
}, z.core.$strip>>;
|
|
@@ -56,7 +96,15 @@ export declare const V1HomePageResponseSchema: z.ZodObject<{
|
|
|
56
96
|
title: z.ZodString;
|
|
57
97
|
description: z.ZodString;
|
|
58
98
|
slug: z.ZodString;
|
|
59
|
-
|
|
99
|
+
image: z.ZodNullable<z.ZodObject<{
|
|
100
|
+
title: z.ZodString;
|
|
101
|
+
resized: z.ZodObject<{
|
|
102
|
+
tiny: z.ZodString;
|
|
103
|
+
small: z.ZodString;
|
|
104
|
+
medium: z.ZodString;
|
|
105
|
+
large: z.ZodString;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
}, z.core.$strip>>;
|
|
60
108
|
instructors: z.ZodArray<z.ZodObject<{
|
|
61
109
|
name: z.ZodString;
|
|
62
110
|
}, z.core.$strip>>;
|
|
@@ -65,10 +113,10 @@ export declare const V1HomePageResponseSchema: z.ZodObject<{
|
|
|
65
113
|
name: z.ZodString;
|
|
66
114
|
ogTitle: z.ZodString;
|
|
67
115
|
ogDescription: z.ZodString;
|
|
68
|
-
homePageImageXL: z.ZodString
|
|
69
|
-
homePageImageL: z.ZodString
|
|
70
|
-
homePageImageM: z.ZodString
|
|
71
|
-
homePageImageS: z.ZodString
|
|
116
|
+
homePageImageXL: z.ZodNullable<z.ZodString>;
|
|
117
|
+
homePageImageL: z.ZodNullable<z.ZodString>;
|
|
118
|
+
homePageImageM: z.ZodNullable<z.ZodString>;
|
|
119
|
+
homePageImageS: z.ZodNullable<z.ZodString>;
|
|
72
120
|
}, z.core.$strip>>;
|
|
73
121
|
status: z.ZodEnum<{
|
|
74
122
|
published: "published";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/schemas/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/schemas/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAOX,CAAA;AAEtB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;iBASX,CAAA;AAE1B,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsBX,CAAA;AAExB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMP,CAAA"}
|
package/dist/schemas/home.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { internalServerErrorResponse } from '../responses.js';
|
|
3
3
|
import { V1CourseStatusSchema } from './course.js';
|
|
4
|
+
import { PhotoSchema } from './photo.js';
|
|
4
5
|
// TODO: import registry from global registry file instead of from tag.js
|
|
5
6
|
import { registry } from './registry.js';
|
|
6
7
|
export const V1HomePostCardSchema = z.object({
|
|
7
8
|
title: z.string(),
|
|
8
9
|
description: z.string(),
|
|
9
10
|
link: z.string(),
|
|
10
|
-
|
|
11
|
+
image: PhotoSchema.nullable()
|
|
11
12
|
}).openapi('PostCard');
|
|
12
13
|
export const V1HomeActivityCardSchema = z.object({
|
|
13
14
|
title: z.string(),
|
|
14
15
|
description: z.string(),
|
|
15
16
|
link: z.string(),
|
|
16
|
-
|
|
17
|
+
image: PhotoSchema.nullable(),
|
|
17
18
|
badgeText: z.string(),
|
|
18
19
|
buttonText: z.string()
|
|
19
20
|
}).openapi('ActivityCard');
|
|
@@ -21,7 +22,7 @@ export const V1HomeCourseCardSchema = z.object({
|
|
|
21
22
|
title: z.string(),
|
|
22
23
|
description: z.string(),
|
|
23
24
|
slug: z.string(),
|
|
24
|
-
|
|
25
|
+
image: PhotoSchema.nullable(),
|
|
25
26
|
instructors: z.array(z.object({
|
|
26
27
|
name: z.string()
|
|
27
28
|
})),
|
|
@@ -30,10 +31,10 @@ export const V1HomeCourseCardSchema = z.object({
|
|
|
30
31
|
name: z.string(),
|
|
31
32
|
ogTitle: z.string(),
|
|
32
33
|
ogDescription: z.string(),
|
|
33
|
-
homePageImageXL: z.string(),
|
|
34
|
-
homePageImageL: z.string(),
|
|
35
|
-
homePageImageM: z.string(),
|
|
36
|
-
homePageImageS: z.string()
|
|
34
|
+
homePageImageXL: z.string().nullable(),
|
|
35
|
+
homePageImageL: z.string().nullable(),
|
|
36
|
+
homePageImageM: z.string().nullable(),
|
|
37
|
+
homePageImageS: z.string().nullable()
|
|
37
38
|
})),
|
|
38
39
|
status: V1CourseStatusSchema,
|
|
39
40
|
launchAt: z.union([z.iso.datetime(), z.null()])
|
package/dist/schemas/home.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.js","names":["z","internalServerErrorResponse","V1CourseStatusSchema","registry","V1HomePostCardSchema","object","title","string","description","link","
|
|
1
|
+
{"version":3,"file":"home.js","names":["z","internalServerErrorResponse","V1CourseStatusSchema","PhotoSchema","registry","V1HomePostCardSchema","object","title","string","description","link","image","nullable","openapi","V1HomeActivityCardSchema","badgeText","buttonText","V1HomeCourseCardSchema","slug","instructors","array","name","tags","ogTitle","ogDescription","homePageImageXL","homePageImageL","homePageImageM","homePageImageS","status","launchAt","union","iso","datetime","null","V1HomePageResponseSchema","posts","activities","courses","registerPath","method","path","responses","content","schema"],"sources":["../../src/schemas/home.ts"],"sourcesContent":["import { z } from 'zod'\n\nimport { internalServerErrorResponse } from '../responses.js'\nimport { V1CourseStatusSchema } from './course.js'\nimport { PhotoSchema } from './photo.js'\n// TODO: import registry from global registry file instead of from tag.js\nimport { registry } from './registry.js'\n\nexport const V1HomePostCardSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n link: z.string(),\n image: PhotoSchema.nullable(),\n })\n .openapi('PostCard')\n\nexport const V1HomeActivityCardSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n link: z.string(),\n image: PhotoSchema.nullable(),\n badgeText: z.string(),\n buttonText: z.string(),\n })\n .openapi('ActivityCard')\n\nexport const V1HomeCourseCardSchema = z\n .object({\n title: z.string(),\n description: z.string(),\n slug: z.string(),\n image: PhotoSchema.nullable(),\n instructors: z.array(z.object({ name: z.string() })),\n tags: z.array(\n z.object({\n slug: z.string(),\n name: z.string(),\n ogTitle: z.string(),\n ogDescription: z.string(),\n homePageImageXL: z.string().nullable(),\n homePageImageL: z.string().nullable(),\n homePageImageM: z.string().nullable(),\n homePageImageS: z.string().nullable(),\n })\n ),\n status: V1CourseStatusSchema,\n launchAt: z.union([z.iso.datetime(), z.null()]),\n })\n .openapi('CourseCard')\n\nexport const V1HomePageResponseSchema = z\n .object({\n posts: z.array(V1HomePostCardSchema),\n activities: z.array(V1HomeActivityCardSchema),\n courses: z.array(V1HomeCourseCardSchema),\n })\n .openapi('HomePageResponse')\n\n// --- OpenAPI path registration ---\n\nregistry.registerPath({\n method: 'get',\n path: '/v1/home',\n tags: ['Home'],\n description: 'Get home page data.',\n responses: {\n 200: {\n description: 'Success',\n content: {\n 'application/json': { schema: V1HomePageResponseSchema },\n },\n },\n ...internalServerErrorResponse,\n },\n})\n"],"mappings":"AAAA,SAASA,CAAC,QAAQ,KAAK;AAEvB,SAASC,2BAA2B,QAAQ,iBAAiB;AAC7D,SAASC,oBAAoB,QAAQ,aAAa;AAClD,SAASC,WAAW,QAAQ,YAAY;AACxC;AACA,SAASC,QAAQ,QAAQ,eAAe;AAExC,OAAO,MAAMC,oBAAoB,GAAGL,CAAC,CAClCM,MAAM,CAAC;EACNC,KAAK,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;EACjBC,WAAW,EAAET,CAAC,CAACQ,MAAM,CAAC,CAAC;EACvBE,IAAI,EAAEV,CAAC,CAACQ,MAAM,CAAC,CAAC;EAChBG,KAAK,EAAER,WAAW,CAACS,QAAQ,CAAC;AAC9B,CAAC,CAAC,CACDC,OAAO,CAAC,UAAU,CAAC;AAEtB,OAAO,MAAMC,wBAAwB,GAAGd,CAAC,CACtCM,MAAM,CAAC;EACNC,KAAK,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;EACjBC,WAAW,EAAET,CAAC,CAACQ,MAAM,CAAC,CAAC;EACvBE,IAAI,EAAEV,CAAC,CAACQ,MAAM,CAAC,CAAC;EAChBG,KAAK,EAAER,WAAW,CAACS,QAAQ,CAAC,CAAC;EAC7BG,SAAS,EAAEf,CAAC,CAACQ,MAAM,CAAC,CAAC;EACrBQ,UAAU,EAAEhB,CAAC,CAACQ,MAAM,CAAC;AACvB,CAAC,CAAC,CACDK,OAAO,CAAC,cAAc,CAAC;AAE1B,OAAO,MAAMI,sBAAsB,GAAGjB,CAAC,CACpCM,MAAM,CAAC;EACNC,KAAK,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;EACjBC,WAAW,EAAET,CAAC,CAACQ,MAAM,CAAC,CAAC;EACvBU,IAAI,EAAElB,CAAC,CAACQ,MAAM,CAAC,CAAC;EAChBG,K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