ltijs
Version:
Easily turn your web application into a LTI 1.3 Learning Tool.
26 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ContentItemsInputSchema = exports.DeepLinkingOptionsSchema = exports.ContentItemSchema = void 0;
const zod_1 = require("zod");
exports.ContentItemSchema = zod_1.z
.object({
type: zod_1.z.string(),
})
.loose();
exports.DeepLinkingOptionsSchema = zod_1.z.object({
message: zod_1.z.string().optional(),
errMessage: zod_1.z.string().optional(),
errmessage: zod_1.z.string().optional(),
log: zod_1.z.string().optional(),
errLog: zod_1.z.string().optional(),
errlog: zod_1.z.string().optional(),
});
// Accepts a single content item or an array of them (matching legacy's
// caller-facing flexibility) and normalizes to an array -- rejects
// `undefined`/malformed input the same way any other `validate()` call does,
// replacing both the old missing-content-items guard and manual array
// normalization in one step.
exports.ContentItemsInputSchema = zod_1.z
.union([exports.ContentItemSchema, zod_1.z.array(exports.ContentItemSchema)])
.transform(value => (Array.isArray(value) ? value : [value]));
//# sourceMappingURL=deep-linking.schemas.js.map