@classroomio/mcp 0.0.4 → 0.0.5
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/README.md +7 -5
- package/dist/index.js +543 -277
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ ClassroomIO DB
|
|
|
41
41
|
|
|
42
42
|
Current tools:
|
|
43
43
|
|
|
44
|
+
- `list_org_courses`
|
|
44
45
|
- `get_course_structure`
|
|
45
46
|
- `create_course_draft`
|
|
46
47
|
- `create_course_draft_from_course`
|
|
@@ -267,11 +268,12 @@ Take my existing Algebra course, reorganize it, and rewrite the lesson content f
|
|
|
267
268
|
|
|
268
269
|
Expected tool sequence:
|
|
269
270
|
|
|
270
|
-
1. Agent calls `
|
|
271
|
-
2. Agent
|
|
272
|
-
3. Agent
|
|
273
|
-
4.
|
|
274
|
-
5.
|
|
271
|
+
1. Agent calls `list_org_courses` if it needs to resolve the course ID from the course name first.
|
|
272
|
+
2. Agent calls `get_course_structure` with the existing `courseId`.
|
|
273
|
+
3. Agent optionally calls `create_course_draft_from_course` to persist a seeded draft.
|
|
274
|
+
4. Agent updates the draft with the new structure and content using `update_course_draft`.
|
|
275
|
+
5. User reviews the changes.
|
|
276
|
+
6. Agent calls `publish_course_draft_to_existing_course`.
|
|
275
277
|
|
|
276
278
|
What this publish does today:
|
|
277
279
|
|
package/dist/index.js
CHANGED
|
@@ -40,6 +40,14 @@ var ClassroomIoApiClient = class {
|
|
|
40
40
|
method: "GET"
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
async listOrganizationCourses(query = {}) {
|
|
44
|
+
const searchParams = new URLSearchParams();
|
|
45
|
+
if (query.tags) searchParams.set("tags", query.tags);
|
|
46
|
+
const querySuffix = searchParams.toString() ? `?${searchParams.toString()}` : "";
|
|
47
|
+
return this.request(`/organization/courses${querySuffix}`, {
|
|
48
|
+
method: "GET"
|
|
49
|
+
});
|
|
50
|
+
}
|
|
43
51
|
async listCourseExercises(courseId, query = {}) {
|
|
44
52
|
const searchParams = new URLSearchParams();
|
|
45
53
|
if (query.lessonId) searchParams.set("lessonId", query.lessonId);
|
|
@@ -209,9 +217,256 @@ var ZAutomationCourseTagAssignment = ZAutomationDraftTagAssignment.extend({
|
|
|
209
217
|
courseIds: z2.array(z2.string().uuid()).min(1).max(100)
|
|
210
218
|
});
|
|
211
219
|
|
|
212
|
-
// ../utils/dist/validation/
|
|
220
|
+
// ../utils/dist/validation/organization/organization.js
|
|
213
221
|
import * as z3 from "zod";
|
|
214
222
|
|
|
223
|
+
// ../utils/dist/constants/org.js
|
|
224
|
+
var blockedSubdomain = [
|
|
225
|
+
"academy",
|
|
226
|
+
"app",
|
|
227
|
+
"apps",
|
|
228
|
+
"blog",
|
|
229
|
+
"build",
|
|
230
|
+
"campaign",
|
|
231
|
+
"church",
|
|
232
|
+
"cloud",
|
|
233
|
+
"community",
|
|
234
|
+
"conference",
|
|
235
|
+
"course",
|
|
236
|
+
"courses",
|
|
237
|
+
"demo",
|
|
238
|
+
"dev",
|
|
239
|
+
"forum",
|
|
240
|
+
"group",
|
|
241
|
+
"groups",
|
|
242
|
+
"help",
|
|
243
|
+
"launch",
|
|
244
|
+
"launchweek",
|
|
245
|
+
"mobile",
|
|
246
|
+
"play",
|
|
247
|
+
"prod",
|
|
248
|
+
"production",
|
|
249
|
+
"schools",
|
|
250
|
+
"stage",
|
|
251
|
+
"staging",
|
|
252
|
+
"support",
|
|
253
|
+
"teacher",
|
|
254
|
+
"teachers",
|
|
255
|
+
"tech",
|
|
256
|
+
"training"
|
|
257
|
+
];
|
|
258
|
+
|
|
259
|
+
// ../utils/dist/constants/content.js
|
|
260
|
+
var ContentType;
|
|
261
|
+
(function(ContentType2) {
|
|
262
|
+
ContentType2["Section"] = "SECTION";
|
|
263
|
+
ContentType2["Lesson"] = "LESSON";
|
|
264
|
+
ContentType2["Exercise"] = "EXERCISE";
|
|
265
|
+
})(ContentType || (ContentType = {}));
|
|
266
|
+
|
|
267
|
+
// ../utils/dist/validation/organization/organization.js
|
|
268
|
+
var ZGetOrganizations = z3.object({
|
|
269
|
+
siteName: z3.string().min(1).optional(),
|
|
270
|
+
customDomain: z3.string().min(1).optional(),
|
|
271
|
+
isCustomDomainVerified: z3.boolean().optional()
|
|
272
|
+
});
|
|
273
|
+
var ZGetCoursesBySiteName = z3.object({
|
|
274
|
+
siteName: z3.string().min(1),
|
|
275
|
+
tags: z3.string().optional()
|
|
276
|
+
});
|
|
277
|
+
var ZGetOrganizationCoursesQuery = z3.object({
|
|
278
|
+
tags: z3.string().optional()
|
|
279
|
+
});
|
|
280
|
+
var ZGetOrgSetup = z3.object({
|
|
281
|
+
siteName: z3.string().min(1)
|
|
282
|
+
});
|
|
283
|
+
var ZCreateOrgPlan = z3.object({
|
|
284
|
+
orgId: z3.uuid(),
|
|
285
|
+
planName: z3.enum(["EARLY_ADOPTER", "ENTERPRISE", "BASIC"]),
|
|
286
|
+
subscriptionId: z3.string().min(1),
|
|
287
|
+
triggeredBy: z3.number().int().positive(),
|
|
288
|
+
payload: z3.record(z3.string(), z3.unknown())
|
|
289
|
+
});
|
|
290
|
+
var ZUpdateOrgPlan = z3.object({
|
|
291
|
+
subscriptionId: z3.string().min(1),
|
|
292
|
+
payload: z3.record(z3.string(), z3.unknown())
|
|
293
|
+
});
|
|
294
|
+
var ZCancelOrgPlan = z3.object({
|
|
295
|
+
subscriptionId: z3.string().min(1),
|
|
296
|
+
payload: z3.record(z3.string(), z3.unknown())
|
|
297
|
+
});
|
|
298
|
+
var ZCreateOrganization = z3.object({
|
|
299
|
+
name: z3.string().min(5).refine((val) => !/^[-]|[-]$/.test(val), {
|
|
300
|
+
message: "Organization name cannot start or end with a hyphen"
|
|
301
|
+
}),
|
|
302
|
+
siteName: z3.string().min(5).refine((val) => !/^[-]|[-]$/.test(val), {
|
|
303
|
+
message: "Site name cannot start or end with a hyphen"
|
|
304
|
+
}).refine((val) => !blockedSubdomain.includes(val), {
|
|
305
|
+
message: "Sitename already exists."
|
|
306
|
+
})
|
|
307
|
+
});
|
|
308
|
+
var ZUpdateOrganization = z3.object({
|
|
309
|
+
name: z3.string().min(5).refine((val) => !/^[-]|[-]$/.test(val), {
|
|
310
|
+
message: "Organization name cannot start or end with a hyphen"
|
|
311
|
+
}).optional(),
|
|
312
|
+
avatarUrl: z3.url().optional(),
|
|
313
|
+
theme: z3.string().optional(),
|
|
314
|
+
landingpage: z3.record(z3.string(), z3.unknown()).optional(),
|
|
315
|
+
siteName: z3.string().min(1).optional(),
|
|
316
|
+
customDomain: z3.string().nullable().optional(),
|
|
317
|
+
isCustomDomainVerified: z3.boolean().optional(),
|
|
318
|
+
customization: z3.record(z3.string(), z3.unknown()).optional(),
|
|
319
|
+
disableSignup: z3.boolean().optional(),
|
|
320
|
+
disableSignupMessage: z3.string().optional(),
|
|
321
|
+
disableEmailPassword: z3.boolean().optional(),
|
|
322
|
+
disableGoogleAuth: z3.boolean().optional(),
|
|
323
|
+
/** Nested settings (stored in organization.settings JSONB). signup.inviteOnly = true means invite-only signup. */
|
|
324
|
+
settings: z3.object({
|
|
325
|
+
signup: z3.object({
|
|
326
|
+
inviteOnly: z3.boolean().optional()
|
|
327
|
+
}).optional()
|
|
328
|
+
}).optional()
|
|
329
|
+
});
|
|
330
|
+
var ZInviteTeamMembers = z3.object({
|
|
331
|
+
emails: z3.array(z3.string().email()).min(1).max(50),
|
|
332
|
+
roleId: z3.number().int().positive()
|
|
333
|
+
});
|
|
334
|
+
var ZRemoveTeamMember = z3.object({
|
|
335
|
+
memberId: z3.coerce.number().int().positive()
|
|
336
|
+
});
|
|
337
|
+
var ZGetUserAnalytics = z3.object({
|
|
338
|
+
userId: z3.uuid()
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
// ../utils/dist/validation/organization/quiz.js
|
|
342
|
+
import * as z4 from "zod";
|
|
343
|
+
var ZQuizGetParam = z4.object({
|
|
344
|
+
orgId: z4.uuid(),
|
|
345
|
+
quizId: z4.uuid()
|
|
346
|
+
});
|
|
347
|
+
var ZQuizListParam = z4.object({
|
|
348
|
+
orgId: z4.uuid()
|
|
349
|
+
});
|
|
350
|
+
var ZQuizCreate = z4.object({
|
|
351
|
+
title: z4.string().min(1),
|
|
352
|
+
questions: z4.array(z4.any()).optional(),
|
|
353
|
+
timelimit: z4.string().optional(),
|
|
354
|
+
theme: z4.string().optional()
|
|
355
|
+
});
|
|
356
|
+
var ZQuizUpdate = z4.object({
|
|
357
|
+
title: z4.string().min(1).optional(),
|
|
358
|
+
questions: z4.array(z4.any()).optional(),
|
|
359
|
+
timelimit: z4.string().optional(),
|
|
360
|
+
theme: z4.string().optional()
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
// ../utils/dist/validation/organization/exercise.js
|
|
364
|
+
import * as z5 from "zod";
|
|
365
|
+
var ZLMSExercisesParam = z5.object({
|
|
366
|
+
orgId: z5.uuid()
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
// ../utils/dist/validation/organization/invite.js
|
|
370
|
+
import * as z6 from "zod";
|
|
371
|
+
var ZOrganizationInviteTokenParam = z6.object({
|
|
372
|
+
token: z6.string().min(10).max(512)
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
// ../utils/dist/validation/organization/sso.js
|
|
376
|
+
import * as z7 from "zod";
|
|
377
|
+
var SSO_PROVIDERS = ["OKTA", "GOOGLE_WORKSPACE", "AUTH0"];
|
|
378
|
+
var ZCreateSsoConnection = z7.object({
|
|
379
|
+
provider: z7.enum(SSO_PROVIDERS),
|
|
380
|
+
displayName: z7.string().min(1, "Display name is required"),
|
|
381
|
+
issuer: z7.url("Must be a valid URL"),
|
|
382
|
+
domain: z7.string().min(1, "Domain is required").regex(/^[a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\.[a-zA-Z]{2,}$/, "Invalid domain format"),
|
|
383
|
+
clientId: z7.string().min(1, "Client ID is required"),
|
|
384
|
+
clientSecret: z7.string().min(1, "Client secret is required"),
|
|
385
|
+
scopes: z7.string().default("openid profile email")
|
|
386
|
+
});
|
|
387
|
+
var ZUpdateSsoConnection = z7.object({
|
|
388
|
+
displayName: z7.string().min(1).optional(),
|
|
389
|
+
issuer: z7.url().optional(),
|
|
390
|
+
domain: z7.string().optional(),
|
|
391
|
+
clientId: z7.string().optional(),
|
|
392
|
+
clientSecret: z7.string().optional(),
|
|
393
|
+
scopes: z7.string().optional(),
|
|
394
|
+
isActive: z7.boolean().optional()
|
|
395
|
+
});
|
|
396
|
+
var ZUpdateSsoPolicy = z7.object({
|
|
397
|
+
forceSso: z7.boolean().optional(),
|
|
398
|
+
autoJoinSsoDomains: z7.boolean().optional(),
|
|
399
|
+
breakGlassEnabled: z7.boolean().optional(),
|
|
400
|
+
defaultRoleId: z7.number().int().positive().optional(),
|
|
401
|
+
roleMapping: z7.record(z7.string(), z7.number()).optional()
|
|
402
|
+
});
|
|
403
|
+
var ZSsoDiscoveryQuery = z7.object({
|
|
404
|
+
email: z7.email("Valid email is required")
|
|
405
|
+
});
|
|
406
|
+
var ZGetSsoConfig = z7.object({
|
|
407
|
+
orgId: z7.uuid()
|
|
408
|
+
});
|
|
409
|
+
|
|
410
|
+
// ../utils/dist/validation/organization/login-link.js
|
|
411
|
+
import { z as z8 } from "zod";
|
|
412
|
+
var ZLoginLinkQuery = z8.object({
|
|
413
|
+
token: z8.string().min(1),
|
|
414
|
+
redirect: z8.string().optional()
|
|
415
|
+
});
|
|
416
|
+
var ZLoginLinkPayload = z8.object({
|
|
417
|
+
sub: z8.uuid(),
|
|
418
|
+
email: z8.email(),
|
|
419
|
+
type: z8.literal("login-link")
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
// ../utils/dist/validation/organization/token-auth.js
|
|
423
|
+
import { z as z9 } from "zod";
|
|
424
|
+
var ZTokenExchangeQuery = z9.object({
|
|
425
|
+
token: z9.string().min(1),
|
|
426
|
+
redirect: z9.string().optional()
|
|
427
|
+
});
|
|
428
|
+
var ZTokenExchangePayload = z9.object({
|
|
429
|
+
sub: z9.string(),
|
|
430
|
+
email: z9.email(),
|
|
431
|
+
name: z9.string().optional(),
|
|
432
|
+
avatar: z9.url().optional(),
|
|
433
|
+
iat: z9.number(),
|
|
434
|
+
exp: z9.number()
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
// ../utils/dist/validation/organization/automation-key.js
|
|
438
|
+
import { z as z10 } from "zod";
|
|
439
|
+
var ZOrganizationApiKeyType = z10.enum(["mcp", "api", "zapier"]);
|
|
440
|
+
var ZOrganizationApiKeyScope = z10.enum([
|
|
441
|
+
"course_import:draft:create",
|
|
442
|
+
"course_import:draft:read",
|
|
443
|
+
"course_import:draft:update",
|
|
444
|
+
"course_import:draft:publish",
|
|
445
|
+
"course:read",
|
|
446
|
+
"course:tag:write",
|
|
447
|
+
"course:exercise:read",
|
|
448
|
+
"course:exercise:write",
|
|
449
|
+
"public_api:*"
|
|
450
|
+
]);
|
|
451
|
+
var ZListOrganizationApiKeysQuery = z10.object({
|
|
452
|
+
type: ZOrganizationApiKeyType.optional()
|
|
453
|
+
});
|
|
454
|
+
var ZOrganizationAutomationUsageQuery = z10.object({
|
|
455
|
+
type: ZOrganizationApiKeyType.default("mcp")
|
|
456
|
+
});
|
|
457
|
+
var ZCreateOrganizationApiKey = z10.object({
|
|
458
|
+
type: ZOrganizationApiKeyType,
|
|
459
|
+
label: z10.string().min(1).max(120).optional(),
|
|
460
|
+
expiresAt: z10.string().datetime().optional(),
|
|
461
|
+
scopes: z10.array(ZOrganizationApiKeyScope).min(1).optional()
|
|
462
|
+
});
|
|
463
|
+
var ZOrganizationApiKeyParam = z10.object({
|
|
464
|
+
keyId: z10.string().uuid()
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
// ../utils/dist/validation/exercise/exercise.js
|
|
468
|
+
import * as z11 from "zod";
|
|
469
|
+
|
|
215
470
|
// ../question-types/dist/question-type-keys.js
|
|
216
471
|
var QUESTION_TYPE_KEY = {
|
|
217
472
|
RADIO: "RADIO",
|
|
@@ -608,22 +863,22 @@ var QUESTION_VALIDATION_RULES = {
|
|
|
608
863
|
],
|
|
609
864
|
[QUESTION_TYPE.TEXTAREA]: []
|
|
610
865
|
};
|
|
611
|
-
var ZExerciseUpdateQuestionBase =
|
|
612
|
-
id:
|
|
613
|
-
question:
|
|
614
|
-
questionTypeId:
|
|
866
|
+
var ZExerciseUpdateQuestionBase = z11.object({
|
|
867
|
+
id: z11.number().int().optional(),
|
|
868
|
+
question: z11.string().min(1),
|
|
869
|
+
questionTypeId: z11.number().int().min(1).optional(),
|
|
615
870
|
// Added to support question type updates
|
|
616
|
-
points:
|
|
617
|
-
order:
|
|
618
|
-
settings:
|
|
619
|
-
deletedAt:
|
|
871
|
+
points: z11.number().int().min(0).optional(),
|
|
872
|
+
order: z11.number().int().min(0).optional(),
|
|
873
|
+
settings: z11.record(z11.string(), z11.unknown()).optional(),
|
|
874
|
+
deletedAt: z11.string().optional(),
|
|
620
875
|
// Marks question as deleted
|
|
621
|
-
options:
|
|
622
|
-
id:
|
|
623
|
-
label:
|
|
624
|
-
isCorrect:
|
|
625
|
-
settings:
|
|
626
|
-
deletedAt:
|
|
876
|
+
options: z11.array(z11.object({
|
|
877
|
+
id: z11.number().int().optional(),
|
|
878
|
+
label: z11.string().min(1),
|
|
879
|
+
isCorrect: z11.boolean(),
|
|
880
|
+
settings: z11.record(z11.string(), z11.unknown()).optional(),
|
|
881
|
+
deletedAt: z11.string().optional()
|
|
627
882
|
// Marks option as deleted
|
|
628
883
|
})).optional()
|
|
629
884
|
});
|
|
@@ -643,284 +898,284 @@ function validateQuestionOptions(question, ctx) {
|
|
|
643
898
|
}
|
|
644
899
|
}
|
|
645
900
|
var ZExerciseUpdateQuestion = ZExerciseUpdateQuestionBase.superRefine(validateQuestionOptions);
|
|
646
|
-
var ZExerciseCreate =
|
|
647
|
-
title:
|
|
648
|
-
description:
|
|
649
|
-
lessonId:
|
|
650
|
-
sectionId:
|
|
651
|
-
order:
|
|
652
|
-
courseId:
|
|
653
|
-
dueBy:
|
|
654
|
-
questions:
|
|
655
|
-
question:
|
|
656
|
-
questionTypeId:
|
|
657
|
-
points:
|
|
658
|
-
settings:
|
|
659
|
-
options:
|
|
660
|
-
label:
|
|
661
|
-
isCorrect:
|
|
662
|
-
settings:
|
|
901
|
+
var ZExerciseCreate = z11.object({
|
|
902
|
+
title: z11.string().min(1),
|
|
903
|
+
description: z11.string().optional(),
|
|
904
|
+
lessonId: z11.string().optional(),
|
|
905
|
+
sectionId: z11.string().optional(),
|
|
906
|
+
order: z11.number().int().optional(),
|
|
907
|
+
courseId: z11.string().min(1),
|
|
908
|
+
dueBy: z11.string().optional(),
|
|
909
|
+
questions: z11.array(z11.object({
|
|
910
|
+
question: z11.string().min(1),
|
|
911
|
+
questionTypeId: z11.number().int().min(1).optional(),
|
|
912
|
+
points: z11.number().int().min(0).optional(),
|
|
913
|
+
settings: z11.record(z11.string(), z11.unknown()).optional(),
|
|
914
|
+
options: z11.array(z11.object({
|
|
915
|
+
label: z11.string().min(1),
|
|
916
|
+
isCorrect: z11.boolean(),
|
|
917
|
+
settings: z11.record(z11.string(), z11.unknown()).optional()
|
|
663
918
|
})).min(2)
|
|
664
919
|
})).optional()
|
|
665
920
|
});
|
|
666
|
-
var ZExerciseUpdate =
|
|
667
|
-
title:
|
|
668
|
-
description:
|
|
669
|
-
lessonId:
|
|
670
|
-
sectionId:
|
|
671
|
-
order:
|
|
672
|
-
isUnlocked:
|
|
673
|
-
dueBy:
|
|
921
|
+
var ZExerciseUpdate = z11.object({
|
|
922
|
+
title: z11.string().min(1).optional(),
|
|
923
|
+
description: z11.string().optional(),
|
|
924
|
+
lessonId: z11.string().optional(),
|
|
925
|
+
sectionId: z11.string().optional(),
|
|
926
|
+
order: z11.number().int().optional(),
|
|
927
|
+
isUnlocked: z11.boolean().optional(),
|
|
928
|
+
dueBy: z11.string().optional(),
|
|
674
929
|
// Changed from iso.datetime() to string to match frontend format
|
|
675
|
-
questions:
|
|
930
|
+
questions: z11.array(ZExerciseUpdateQuestion).optional()
|
|
676
931
|
});
|
|
677
|
-
var ZExerciseGetParam =
|
|
678
|
-
exerciseId:
|
|
932
|
+
var ZExerciseGetParam = z11.object({
|
|
933
|
+
exerciseId: z11.string().min(1)
|
|
679
934
|
});
|
|
680
|
-
var ZExerciseListQuery =
|
|
681
|
-
lessonId:
|
|
682
|
-
sectionId:
|
|
935
|
+
var ZExerciseListQuery = z11.object({
|
|
936
|
+
lessonId: z11.string().optional(),
|
|
937
|
+
sectionId: z11.string().optional()
|
|
683
938
|
});
|
|
684
|
-
var ZExerciseSubmissionCreate =
|
|
685
|
-
exerciseId:
|
|
686
|
-
answers:
|
|
687
|
-
questionId:
|
|
688
|
-
optionId:
|
|
689
|
-
answer:
|
|
939
|
+
var ZExerciseSubmissionCreate = z11.object({
|
|
940
|
+
exerciseId: z11.string().min(1),
|
|
941
|
+
answers: z11.array(z11.object({
|
|
942
|
+
questionId: z11.number().int(),
|
|
943
|
+
optionId: z11.number().int().optional(),
|
|
944
|
+
answer: z11.string().optional()
|
|
690
945
|
})).min(1)
|
|
691
946
|
});
|
|
692
|
-
var ZExerciseFromTemplate =
|
|
693
|
-
lessonId:
|
|
694
|
-
sectionId:
|
|
695
|
-
order:
|
|
696
|
-
templateId:
|
|
947
|
+
var ZExerciseFromTemplate = z11.object({
|
|
948
|
+
lessonId: z11.string().optional(),
|
|
949
|
+
sectionId: z11.string().optional(),
|
|
950
|
+
order: z11.number().int().optional(),
|
|
951
|
+
templateId: z11.number().int().min(1)
|
|
697
952
|
});
|
|
698
953
|
|
|
699
954
|
// ../utils/dist/validation/course-import/course-import.js
|
|
700
|
-
import * as
|
|
955
|
+
import * as z13 from "zod";
|
|
701
956
|
|
|
702
957
|
// ../utils/dist/validation/course/course.js
|
|
703
|
-
import * as
|
|
704
|
-
var ZCourseClone =
|
|
705
|
-
title:
|
|
706
|
-
description:
|
|
707
|
-
slug:
|
|
708
|
-
organizationId:
|
|
709
|
-
});
|
|
710
|
-
var ZCourseCloneParam =
|
|
711
|
-
courseId:
|
|
712
|
-
});
|
|
713
|
-
var ZCourseGetParam =
|
|
714
|
-
courseId:
|
|
715
|
-
});
|
|
716
|
-
var ZCourseGetQuery =
|
|
717
|
-
slug:
|
|
718
|
-
});
|
|
719
|
-
var ZCourseGetBySlugParam =
|
|
720
|
-
slug:
|
|
721
|
-
});
|
|
722
|
-
var ZCourseEnrollParam =
|
|
723
|
-
courseId:
|
|
724
|
-
});
|
|
725
|
-
var ZCourseEnrollBody =
|
|
726
|
-
inviteToken:
|
|
727
|
-
});
|
|
728
|
-
var ZCourseDownloadParam =
|
|
729
|
-
courseId:
|
|
730
|
-
});
|
|
731
|
-
var ZCertificateDownload =
|
|
732
|
-
theme:
|
|
733
|
-
studentName:
|
|
734
|
-
courseName:
|
|
735
|
-
courseDescription:
|
|
736
|
-
orgName:
|
|
737
|
-
orgLogoUrl:
|
|
738
|
-
facilitator:
|
|
739
|
-
});
|
|
740
|
-
var ZCourseDownloadContent =
|
|
741
|
-
courseTitle:
|
|
742
|
-
orgName:
|
|
743
|
-
orgTheme:
|
|
744
|
-
lessons:
|
|
745
|
-
lessonTitle:
|
|
746
|
-
lessonNumber:
|
|
747
|
-
lessonNote:
|
|
748
|
-
slideUrl:
|
|
749
|
-
video:
|
|
958
|
+
import * as z12 from "zod";
|
|
959
|
+
var ZCourseClone = z12.object({
|
|
960
|
+
title: z12.string().min(1),
|
|
961
|
+
description: z12.string().optional(),
|
|
962
|
+
slug: z12.string().min(1),
|
|
963
|
+
organizationId: z12.string().min(1)
|
|
964
|
+
});
|
|
965
|
+
var ZCourseCloneParam = z12.object({
|
|
966
|
+
courseId: z12.string().min(1)
|
|
967
|
+
});
|
|
968
|
+
var ZCourseGetParam = z12.object({
|
|
969
|
+
courseId: z12.string().min(1)
|
|
970
|
+
});
|
|
971
|
+
var ZCourseGetQuery = z12.object({
|
|
972
|
+
slug: z12.string().optional()
|
|
973
|
+
});
|
|
974
|
+
var ZCourseGetBySlugParam = z12.object({
|
|
975
|
+
slug: z12.string().min(1)
|
|
976
|
+
});
|
|
977
|
+
var ZCourseEnrollParam = z12.object({
|
|
978
|
+
courseId: z12.string().min(1)
|
|
979
|
+
});
|
|
980
|
+
var ZCourseEnrollBody = z12.object({
|
|
981
|
+
inviteToken: z12.string().min(1).optional()
|
|
982
|
+
});
|
|
983
|
+
var ZCourseDownloadParam = z12.object({
|
|
984
|
+
courseId: z12.string().min(1)
|
|
985
|
+
});
|
|
986
|
+
var ZCertificateDownload = z12.object({
|
|
987
|
+
theme: z12.string().min(1),
|
|
988
|
+
studentName: z12.string().min(1),
|
|
989
|
+
courseName: z12.string().min(1),
|
|
990
|
+
courseDescription: z12.string().min(1),
|
|
991
|
+
orgName: z12.string().min(1),
|
|
992
|
+
orgLogoUrl: z12.string().url().optional(),
|
|
993
|
+
facilitator: z12.string().optional()
|
|
994
|
+
});
|
|
995
|
+
var ZCourseDownloadContent = z12.object({
|
|
996
|
+
courseTitle: z12.string().min(1),
|
|
997
|
+
orgName: z12.string().min(1),
|
|
998
|
+
orgTheme: z12.string().min(1),
|
|
999
|
+
lessons: z12.array(z12.object({
|
|
1000
|
+
lessonTitle: z12.string().min(1),
|
|
1001
|
+
lessonNumber: z12.string().min(1),
|
|
1002
|
+
lessonNote: z12.string(),
|
|
1003
|
+
slideUrl: z12.string().url().optional(),
|
|
1004
|
+
video: z12.array(z12.string().url()).optional()
|
|
750
1005
|
}))
|
|
751
1006
|
});
|
|
752
|
-
var ZLessonDownloadContent =
|
|
753
|
-
title:
|
|
754
|
-
number:
|
|
755
|
-
orgName:
|
|
756
|
-
note:
|
|
757
|
-
slideUrl:
|
|
758
|
-
video:
|
|
759
|
-
courseTitle:
|
|
760
|
-
});
|
|
761
|
-
var ZCoursePresignUrlUpload =
|
|
762
|
-
fileName:
|
|
763
|
-
fileType:
|
|
764
|
-
});
|
|
765
|
-
var ZCourseDocumentPresignUrlUpload =
|
|
766
|
-
fileName:
|
|
767
|
-
fileType:
|
|
768
|
-
});
|
|
769
|
-
var ZCourseDownloadPresignedUrl =
|
|
770
|
-
keys:
|
|
771
|
-
});
|
|
772
|
-
var ZCourseContentUpdateItem =
|
|
773
|
-
id:
|
|
774
|
-
type:
|
|
775
|
-
isUnlocked:
|
|
776
|
-
order:
|
|
777
|
-
sectionId:
|
|
778
|
-
});
|
|
779
|
-
var ZCourseContentUpdate =
|
|
780
|
-
items:
|
|
781
|
-
});
|
|
782
|
-
var ZCourseContentDeleteItem =
|
|
783
|
-
id:
|
|
784
|
-
type:
|
|
785
|
-
});
|
|
786
|
-
var ZCourseContentDelete =
|
|
787
|
-
sectionId:
|
|
788
|
-
items:
|
|
1007
|
+
var ZLessonDownloadContent = z12.object({
|
|
1008
|
+
title: z12.string().min(1),
|
|
1009
|
+
number: z12.string().min(1),
|
|
1010
|
+
orgName: z12.string().min(1),
|
|
1011
|
+
note: z12.string(),
|
|
1012
|
+
slideUrl: z12.string().url().optional(),
|
|
1013
|
+
video: z12.array(z12.string().url()).optional(),
|
|
1014
|
+
courseTitle: z12.string().min(1)
|
|
1015
|
+
});
|
|
1016
|
+
var ZCoursePresignUrlUpload = z12.object({
|
|
1017
|
+
fileName: z12.string().min(1),
|
|
1018
|
+
fileType: z12.enum(ALLOWED_CONTENT_TYPES)
|
|
1019
|
+
});
|
|
1020
|
+
var ZCourseDocumentPresignUrlUpload = z12.object({
|
|
1021
|
+
fileName: z12.string().min(1),
|
|
1022
|
+
fileType: z12.enum(ALLOWED_DOCUMENT_TYPES)
|
|
1023
|
+
});
|
|
1024
|
+
var ZCourseDownloadPresignedUrl = z12.object({
|
|
1025
|
+
keys: z12.array(z12.string().min(1)).min(1)
|
|
1026
|
+
});
|
|
1027
|
+
var ZCourseContentUpdateItem = z12.object({
|
|
1028
|
+
id: z12.string().min(1),
|
|
1029
|
+
type: z12.enum(["LESSON", "EXERCISE"]),
|
|
1030
|
+
isUnlocked: z12.boolean().optional(),
|
|
1031
|
+
order: z12.number().int().min(0).optional(),
|
|
1032
|
+
sectionId: z12.string().nullable().optional()
|
|
1033
|
+
});
|
|
1034
|
+
var ZCourseContentUpdate = z12.object({
|
|
1035
|
+
items: z12.array(ZCourseContentUpdateItem).min(1)
|
|
1036
|
+
});
|
|
1037
|
+
var ZCourseContentDeleteItem = z12.object({
|
|
1038
|
+
id: z12.string().min(1),
|
|
1039
|
+
type: z12.enum(["LESSON", "EXERCISE"])
|
|
1040
|
+
});
|
|
1041
|
+
var ZCourseContentDelete = z12.object({
|
|
1042
|
+
sectionId: z12.string().min(1).optional(),
|
|
1043
|
+
items: z12.array(ZCourseContentDeleteItem).min(1).optional()
|
|
789
1044
|
}).refine((data) => Boolean(data.sectionId) !== Boolean(data.items), {
|
|
790
1045
|
message: "Provide either sectionId or items",
|
|
791
1046
|
path: ["sectionId"]
|
|
792
1047
|
});
|
|
793
|
-
var ZCourseCreate =
|
|
794
|
-
title:
|
|
795
|
-
description:
|
|
796
|
-
type:
|
|
797
|
-
organizationId:
|
|
798
|
-
});
|
|
799
|
-
var ZCourseMetadata =
|
|
800
|
-
requirements:
|
|
801
|
-
description:
|
|
802
|
-
goals:
|
|
803
|
-
videoUrl:
|
|
804
|
-
showDiscount:
|
|
805
|
-
discount:
|
|
806
|
-
paymentLink:
|
|
807
|
-
reward:
|
|
808
|
-
show:
|
|
809
|
-
description:
|
|
1048
|
+
var ZCourseCreate = z12.object({
|
|
1049
|
+
title: z12.string().min(1),
|
|
1050
|
+
description: z12.string().min(1),
|
|
1051
|
+
type: z12.enum(["LIVE_CLASS", "SELF_PACED"]),
|
|
1052
|
+
organizationId: z12.string().min(1)
|
|
1053
|
+
});
|
|
1054
|
+
var ZCourseMetadata = z12.object({
|
|
1055
|
+
requirements: z12.string().optional(),
|
|
1056
|
+
description: z12.string().optional(),
|
|
1057
|
+
goals: z12.string().optional(),
|
|
1058
|
+
videoUrl: z12.string().optional(),
|
|
1059
|
+
showDiscount: z12.boolean().optional(),
|
|
1060
|
+
discount: z12.number().optional(),
|
|
1061
|
+
paymentLink: z12.string().optional(),
|
|
1062
|
+
reward: z12.object({
|
|
1063
|
+
show: z12.boolean(),
|
|
1064
|
+
description: z12.string()
|
|
810
1065
|
}).optional(),
|
|
811
|
-
instructor:
|
|
812
|
-
name:
|
|
813
|
-
role:
|
|
814
|
-
coursesNo:
|
|
815
|
-
description:
|
|
816
|
-
imgUrl:
|
|
1066
|
+
instructor: z12.object({
|
|
1067
|
+
name: z12.string(),
|
|
1068
|
+
role: z12.string(),
|
|
1069
|
+
coursesNo: z12.number(),
|
|
1070
|
+
description: z12.string(),
|
|
1071
|
+
imgUrl: z12.string()
|
|
817
1072
|
}).optional(),
|
|
818
|
-
certificate:
|
|
819
|
-
templateUrl:
|
|
1073
|
+
certificate: z12.object({
|
|
1074
|
+
templateUrl: z12.string()
|
|
820
1075
|
}).optional(),
|
|
821
|
-
reviews:
|
|
822
|
-
id:
|
|
823
|
-
hide:
|
|
824
|
-
name:
|
|
825
|
-
avatar_url:
|
|
826
|
-
rating:
|
|
827
|
-
created_at:
|
|
828
|
-
description:
|
|
1076
|
+
reviews: z12.array(z12.object({
|
|
1077
|
+
id: z12.number(),
|
|
1078
|
+
hide: z12.boolean(),
|
|
1079
|
+
name: z12.string(),
|
|
1080
|
+
avatar_url: z12.string(),
|
|
1081
|
+
rating: z12.number(),
|
|
1082
|
+
created_at: z12.number(),
|
|
1083
|
+
description: z12.string()
|
|
829
1084
|
})).optional(),
|
|
830
|
-
lessonTabsOrder:
|
|
831
|
-
id:
|
|
832
|
-
name:
|
|
1085
|
+
lessonTabsOrder: z12.array(z12.object({
|
|
1086
|
+
id: z12.union([z12.literal(1), z12.literal(2), z12.literal(3), z12.literal(4)]),
|
|
1087
|
+
name: z12.string()
|
|
833
1088
|
})).optional(),
|
|
834
|
-
grading:
|
|
835
|
-
lessonDownload:
|
|
836
|
-
allowNewStudent:
|
|
837
|
-
sectionDisplay:
|
|
838
|
-
isContentGroupingEnabled:
|
|
839
|
-
});
|
|
840
|
-
var ZCourseUpdate =
|
|
841
|
-
title:
|
|
842
|
-
description:
|
|
843
|
-
type:
|
|
844
|
-
logo:
|
|
845
|
-
slug:
|
|
846
|
-
isPublished:
|
|
847
|
-
overview:
|
|
1089
|
+
grading: z12.boolean().optional(),
|
|
1090
|
+
lessonDownload: z12.boolean().optional(),
|
|
1091
|
+
allowNewStudent: z12.boolean(),
|
|
1092
|
+
sectionDisplay: z12.record(z12.string(), z12.boolean()).optional(),
|
|
1093
|
+
isContentGroupingEnabled: z12.boolean().optional()
|
|
1094
|
+
});
|
|
1095
|
+
var ZCourseUpdate = z12.object({
|
|
1096
|
+
title: z12.string().min(1).optional(),
|
|
1097
|
+
description: z12.string().min(1).optional(),
|
|
1098
|
+
type: z12.enum(["LIVE_CLASS", "SELF_PACED"]).optional(),
|
|
1099
|
+
logo: z12.string().optional(),
|
|
1100
|
+
slug: z12.string().optional(),
|
|
1101
|
+
isPublished: z12.boolean().optional(),
|
|
1102
|
+
overview: z12.string().optional(),
|
|
848
1103
|
metadata: ZCourseMetadata.optional(),
|
|
849
|
-
isCertificateDownloadable:
|
|
850
|
-
certificateTheme:
|
|
851
|
-
tagIds:
|
|
1104
|
+
isCertificateDownloadable: z12.boolean().optional(),
|
|
1105
|
+
certificateTheme: z12.string().optional(),
|
|
1106
|
+
tagIds: z12.array(z12.uuid()).max(100).optional()
|
|
852
1107
|
});
|
|
853
|
-
var ZCourseUpdateParam =
|
|
854
|
-
courseId:
|
|
1108
|
+
var ZCourseUpdateParam = z12.object({
|
|
1109
|
+
courseId: z12.string().min(1)
|
|
855
1110
|
});
|
|
856
|
-
var ZCourseDeleteParam =
|
|
857
|
-
courseId:
|
|
1111
|
+
var ZCourseDeleteParam = z12.object({
|
|
1112
|
+
courseId: z12.string().min(1)
|
|
858
1113
|
});
|
|
859
|
-
var ZCourseProgressParam =
|
|
860
|
-
courseId:
|
|
1114
|
+
var ZCourseProgressParam = z12.object({
|
|
1115
|
+
courseId: z12.string().min(1)
|
|
861
1116
|
});
|
|
862
|
-
var ZCourseProgressQuery =
|
|
863
|
-
profileId:
|
|
1117
|
+
var ZCourseProgressQuery = z12.object({
|
|
1118
|
+
profileId: z12.string().uuid()
|
|
864
1119
|
});
|
|
865
|
-
var ZCourseUserAnalyticsParam =
|
|
866
|
-
courseId:
|
|
867
|
-
userId:
|
|
1120
|
+
var ZCourseUserAnalyticsParam = z12.object({
|
|
1121
|
+
courseId: z12.string().min(1),
|
|
1122
|
+
userId: z12.string().uuid()
|
|
868
1123
|
});
|
|
869
1124
|
|
|
870
1125
|
// ../utils/dist/validation/course-import/course-import.js
|
|
871
|
-
var ZSupportedLocale =
|
|
872
|
-
var ZCourseImportWarning =
|
|
873
|
-
code:
|
|
874
|
-
message:
|
|
875
|
-
severity:
|
|
876
|
-
});
|
|
877
|
-
var ZCourseImportSourceReference =
|
|
878
|
-
type:
|
|
879
|
-
label:
|
|
880
|
-
pageStart:
|
|
881
|
-
pageEnd:
|
|
882
|
-
});
|
|
883
|
-
var ZCourseImportDraftCourse =
|
|
884
|
-
title:
|
|
885
|
-
description:
|
|
886
|
-
type:
|
|
1126
|
+
var ZSupportedLocale = z13.enum(["en", "hi", "fr", "pt", "de", "vi", "ru", "es", "pl", "da"]);
|
|
1127
|
+
var ZCourseImportWarning = z13.object({
|
|
1128
|
+
code: z13.string().min(1),
|
|
1129
|
+
message: z13.string().min(1),
|
|
1130
|
+
severity: z13.enum(["info", "warning", "error"])
|
|
1131
|
+
});
|
|
1132
|
+
var ZCourseImportSourceReference = z13.object({
|
|
1133
|
+
type: z13.enum(["prompt", "pdf", "course"]),
|
|
1134
|
+
label: z13.string().min(1),
|
|
1135
|
+
pageStart: z13.number().int().min(1).optional(),
|
|
1136
|
+
pageEnd: z13.number().int().min(1).optional()
|
|
1137
|
+
});
|
|
1138
|
+
var ZCourseImportDraftCourse = z13.object({
|
|
1139
|
+
title: z13.string().min(1),
|
|
1140
|
+
description: z13.string().min(1),
|
|
1141
|
+
type: z13.enum(["LIVE_CLASS", "SELF_PACED"]),
|
|
887
1142
|
locale: ZSupportedLocale.default("en"),
|
|
888
1143
|
metadata: ZCourseMetadata.optional()
|
|
889
1144
|
});
|
|
890
|
-
var ZCourseImportDraftSection =
|
|
891
|
-
externalId:
|
|
892
|
-
title:
|
|
893
|
-
order:
|
|
894
|
-
});
|
|
895
|
-
var ZCourseImportDraftLesson =
|
|
896
|
-
externalId:
|
|
897
|
-
sectionExternalId:
|
|
898
|
-
title:
|
|
899
|
-
order:
|
|
900
|
-
isUnlocked:
|
|
901
|
-
public:
|
|
902
|
-
});
|
|
903
|
-
var ZCourseImportDraftLessonLanguage =
|
|
904
|
-
lessonExternalId:
|
|
1145
|
+
var ZCourseImportDraftSection = z13.object({
|
|
1146
|
+
externalId: z13.string().min(1),
|
|
1147
|
+
title: z13.string().min(1),
|
|
1148
|
+
order: z13.number().int().min(0)
|
|
1149
|
+
});
|
|
1150
|
+
var ZCourseImportDraftLesson = z13.object({
|
|
1151
|
+
externalId: z13.string().min(1),
|
|
1152
|
+
sectionExternalId: z13.string().min(1),
|
|
1153
|
+
title: z13.string().min(1),
|
|
1154
|
+
order: z13.number().int().min(0),
|
|
1155
|
+
isUnlocked: z13.boolean().optional(),
|
|
1156
|
+
public: z13.boolean().optional()
|
|
1157
|
+
});
|
|
1158
|
+
var ZCourseImportDraftLessonLanguage = z13.object({
|
|
1159
|
+
lessonExternalId: z13.string().min(1),
|
|
905
1160
|
locale: ZSupportedLocale,
|
|
906
|
-
content:
|
|
1161
|
+
content: z13.string().min(1)
|
|
907
1162
|
});
|
|
908
|
-
var ZCourseImportDraftPayload =
|
|
1163
|
+
var ZCourseImportDraftPayload = z13.object({
|
|
909
1164
|
course: ZCourseImportDraftCourse,
|
|
910
|
-
tags:
|
|
911
|
-
sections:
|
|
912
|
-
lessons:
|
|
913
|
-
lessonLanguages:
|
|
914
|
-
exercises:
|
|
915
|
-
sourceReferences:
|
|
916
|
-
warnings:
|
|
1165
|
+
tags: z13.array(z13.string().trim().min(1).max(80)).max(100).default([]),
|
|
1166
|
+
sections: z13.array(ZCourseImportDraftSection).min(1),
|
|
1167
|
+
lessons: z13.array(ZCourseImportDraftLesson).min(1),
|
|
1168
|
+
lessonLanguages: z13.array(ZCourseImportDraftLessonLanguage).min(1),
|
|
1169
|
+
exercises: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
|
|
1170
|
+
sourceReferences: z13.array(ZCourseImportSourceReference).optional(),
|
|
1171
|
+
warnings: z13.array(ZCourseImportWarning).default([])
|
|
917
1172
|
}).superRefine((value, ctx) => {
|
|
918
1173
|
const normalizedTags = /* @__PURE__ */ new Set();
|
|
919
1174
|
value.tags.forEach((tag, index) => {
|
|
920
1175
|
const tagKey = tag.trim().toLowerCase();
|
|
921
1176
|
if (normalizedTags.has(tagKey)) {
|
|
922
1177
|
ctx.addIssue({
|
|
923
|
-
code:
|
|
1178
|
+
code: z13.ZodIssueCode.custom,
|
|
924
1179
|
path: ["tags", index],
|
|
925
1180
|
message: "Draft tags must be unique"
|
|
926
1181
|
});
|
|
@@ -931,7 +1186,7 @@ var ZCourseImportDraftPayload = z5.object({
|
|
|
931
1186
|
value.sections.forEach((section, index) => {
|
|
932
1187
|
if (sectionIds.has(section.externalId)) {
|
|
933
1188
|
ctx.addIssue({
|
|
934
|
-
code:
|
|
1189
|
+
code: z13.ZodIssueCode.custom,
|
|
935
1190
|
path: ["sections", index, "externalId"],
|
|
936
1191
|
message: "Section externalId must be unique"
|
|
937
1192
|
});
|
|
@@ -942,7 +1197,7 @@ var ZCourseImportDraftPayload = z5.object({
|
|
|
942
1197
|
value.lessons.forEach((lesson, index) => {
|
|
943
1198
|
if (lessonIds.has(lesson.externalId)) {
|
|
944
1199
|
ctx.addIssue({
|
|
945
|
-
code:
|
|
1200
|
+
code: z13.ZodIssueCode.custom,
|
|
946
1201
|
path: ["lessons", index, "externalId"],
|
|
947
1202
|
message: "Lesson externalId must be unique"
|
|
948
1203
|
});
|
|
@@ -950,7 +1205,7 @@ var ZCourseImportDraftPayload = z5.object({
|
|
|
950
1205
|
lessonIds.add(lesson.externalId);
|
|
951
1206
|
if (!sectionIds.has(lesson.sectionExternalId)) {
|
|
952
1207
|
ctx.addIssue({
|
|
953
|
-
code:
|
|
1208
|
+
code: z13.ZodIssueCode.custom,
|
|
954
1209
|
path: ["lessons", index, "sectionExternalId"],
|
|
955
1210
|
message: "Lesson sectionExternalId must reference an existing section"
|
|
956
1211
|
});
|
|
@@ -959,49 +1214,49 @@ var ZCourseImportDraftPayload = z5.object({
|
|
|
959
1214
|
value.lessonLanguages.forEach((lessonLanguage, index) => {
|
|
960
1215
|
if (!lessonIds.has(lessonLanguage.lessonExternalId)) {
|
|
961
1216
|
ctx.addIssue({
|
|
962
|
-
code:
|
|
1217
|
+
code: z13.ZodIssueCode.custom,
|
|
963
1218
|
path: ["lessonLanguages", index, "lessonExternalId"],
|
|
964
1219
|
message: "Lesson language must reference an existing lesson"
|
|
965
1220
|
});
|
|
966
1221
|
}
|
|
967
1222
|
});
|
|
968
1223
|
});
|
|
969
|
-
var ZCourseImportDraftCreate =
|
|
970
|
-
sourceType:
|
|
971
|
-
idempotencyKey:
|
|
972
|
-
summary:
|
|
973
|
-
sourceArtifacts:
|
|
1224
|
+
var ZCourseImportDraftCreate = z13.object({
|
|
1225
|
+
sourceType: z13.enum(["prompt", "pdf", "course"]),
|
|
1226
|
+
idempotencyKey: z13.string().min(1).optional(),
|
|
1227
|
+
summary: z13.record(z13.string(), z13.unknown()).optional(),
|
|
1228
|
+
sourceArtifacts: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
|
|
974
1229
|
draft: ZCourseImportDraftPayload
|
|
975
1230
|
});
|
|
976
|
-
var ZCourseImportCourseParam =
|
|
977
|
-
courseId:
|
|
1231
|
+
var ZCourseImportCourseParam = z13.object({
|
|
1232
|
+
courseId: z13.string().min(1)
|
|
978
1233
|
});
|
|
979
|
-
var ZCourseImportDraftCreateFromCourse =
|
|
980
|
-
courseId:
|
|
981
|
-
idempotencyKey:
|
|
982
|
-
summary:
|
|
983
|
-
sourceArtifacts:
|
|
1234
|
+
var ZCourseImportDraftCreateFromCourse = z13.object({
|
|
1235
|
+
courseId: z13.string().min(1),
|
|
1236
|
+
idempotencyKey: z13.string().min(1).optional(),
|
|
1237
|
+
summary: z13.record(z13.string(), z13.unknown()).optional(),
|
|
1238
|
+
sourceArtifacts: z13.array(z13.record(z13.string(), z13.unknown())).optional()
|
|
984
1239
|
});
|
|
985
|
-
var ZCourseImportDraftGetParam =
|
|
986
|
-
draftId:
|
|
1240
|
+
var ZCourseImportDraftGetParam = z13.object({
|
|
1241
|
+
draftId: z13.string().uuid()
|
|
987
1242
|
});
|
|
988
|
-
var ZCourseImportDraftUpdate =
|
|
989
|
-
summary:
|
|
990
|
-
sourceArtifacts:
|
|
991
|
-
warnings:
|
|
1243
|
+
var ZCourseImportDraftUpdate = z13.object({
|
|
1244
|
+
summary: z13.record(z13.string(), z13.unknown()).optional(),
|
|
1245
|
+
sourceArtifacts: z13.array(z13.record(z13.string(), z13.unknown())).optional(),
|
|
1246
|
+
warnings: z13.array(ZCourseImportWarning).optional(),
|
|
992
1247
|
draft: ZCourseImportDraftPayload.optional()
|
|
993
1248
|
});
|
|
994
|
-
var ZCourseImportDraftPublish =
|
|
995
|
-
title:
|
|
996
|
-
description:
|
|
997
|
-
type:
|
|
1249
|
+
var ZCourseImportDraftPublish = z13.object({
|
|
1250
|
+
title: z13.string().min(1).optional(),
|
|
1251
|
+
description: z13.string().min(1).optional(),
|
|
1252
|
+
type: z13.enum(["LIVE_CLASS", "SELF_PACED"]).optional(),
|
|
998
1253
|
metadata: ZCourseMetadata.optional(),
|
|
999
|
-
bannerImageUrl:
|
|
1000
|
-
bannerImageQuery:
|
|
1001
|
-
generateBannerImage:
|
|
1254
|
+
bannerImageUrl: z13.string().url().optional(),
|
|
1255
|
+
bannerImageQuery: z13.string().min(1).max(120).optional(),
|
|
1256
|
+
generateBannerImage: z13.boolean().optional()
|
|
1002
1257
|
});
|
|
1003
1258
|
var ZCourseImportDraftPublishToCourse = ZCourseImportDraftPublish.extend({
|
|
1004
|
-
courseId:
|
|
1259
|
+
courseId: z13.string().min(1)
|
|
1005
1260
|
});
|
|
1006
1261
|
|
|
1007
1262
|
// src/tools/course-drafts.ts
|
|
@@ -1037,6 +1292,7 @@ var ZPublishCourseDraftToExistingCourseToolInput = ZCourseImportDraftPublishToCo
|
|
|
1037
1292
|
});
|
|
1038
1293
|
var createCourseDraftShape = ZCourseImportDraftCreate.shape;
|
|
1039
1294
|
var createCourseDraftFromCourseShape = ZCourseImportDraftCreateFromCourse.shape;
|
|
1295
|
+
var listOrganizationCoursesShape = ZGetOrganizationCoursesQuery.shape;
|
|
1040
1296
|
var getCourseStructureShape = ZCourseImportCourseParam.shape;
|
|
1041
1297
|
var getCourseDraftShape = ZCourseImportDraftGetParam.shape;
|
|
1042
1298
|
var updateCourseDraftShape = ZUpdateCourseDraftToolInput.shape;
|
|
@@ -1050,6 +1306,16 @@ var publishCourseDraftShape = ZPublishCourseDraftToolInput.shape;
|
|
|
1050
1306
|
var publishCourseDraftToExistingCourseShape = ZPublishCourseDraftToExistingCourseToolInput.shape;
|
|
1051
1307
|
var tagCoursesShape = ZAutomationCourseTagAssignment.shape;
|
|
1052
1308
|
function registerCourseDraftTools(server, apiClient) {
|
|
1309
|
+
server.tool(
|
|
1310
|
+
"list_org_courses",
|
|
1311
|
+
"List all courses in the authenticated organization. Use this when the user refers to a course by name and you need to discover the available course IDs first.",
|
|
1312
|
+
listOrganizationCoursesShape,
|
|
1313
|
+
async (args) => {
|
|
1314
|
+
const query = ZGetOrganizationCoursesQuery.parse(args);
|
|
1315
|
+
const result = await apiClient.listOrganizationCourses(query);
|
|
1316
|
+
return jsonContent(result);
|
|
1317
|
+
}
|
|
1318
|
+
);
|
|
1053
1319
|
server.tool(
|
|
1054
1320
|
"get_course_structure",
|
|
1055
1321
|
"Read the current live course structure. Use this before creating a fresh draft for post-publish edits.",
|