ltijs
Version:
Easily turn your web application into a LTI 1.3 Learning Tool.
43 lines • 1.69 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.GetMembersOptionsSchema = exports.MembershipContainerSchema = exports.MembershipSchema = void 0;
const zod_1 = require("zod");
// Field names mirror the raw NRPS wire format (snake_case) verbatim rather than
// normalizing to camelCase, since ltijs passes platform responses through to
// consumers largely unmodified. `.loose()` tolerates vendor-specific extra
// fields real-world platforms (Moodle/Canvas/Brightspace/...) routinely send.
exports.MembershipSchema = zod_1.z
.object({
status: zod_1.z.string().optional(),
name: zod_1.z.string().optional(),
given_name: zod_1.z.string().optional(),
family_name: zod_1.z.string().optional(),
email: zod_1.z.string().optional(),
user_id: zod_1.z.string(),
roles: zod_1.z.array(zod_1.z.string()),
lis_person_sourcedid: zod_1.z.string().optional(),
})
.loose();
exports.MembershipContainerSchema = zod_1.z
.object({
id: zod_1.z.string().optional(),
context: zod_1.z
.object({
id: zod_1.z.string(),
label: zod_1.z.string().optional(),
title: zod_1.z.string().optional(),
})
.optional(),
members: zod_1.z.array(exports.MembershipSchema),
})
.loose();
exports.GetMembersOptionsSchema = zod_1.z
.object({
role: zod_1.z.string().optional(),
limit: zod_1.z.number().optional(),
pages: zod_1.z.union([zod_1.z.number(), zod_1.z.literal(false)]).optional(),
url: zod_1.z.string().optional(),
resourceLinkId: zod_1.z.union([zod_1.z.boolean(), zod_1.z.string()]).optional(),
})
.optional();
//# sourceMappingURL=names-and-roles.schemas.js.map