UNPKG

kolibri-constants

Version:

A package that exposes constants commonly used across the Kolibri Ecosystem

138 lines (135 loc) 3.83 kB
// -*- coding: utf-8 -*- // Generated by scripts/generate_from_specs.py // EmbedContentRequest export const SCHEMA = { "$id": "/schemas/embed_content_request", "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "description": "Schema for embed content requests received by RayServe", "additionalProperties": false, "definitions": { "language": { "type": "string", "description": "Language code from https://github.com/learningequality/le-utils/blob/main/le_utils/resources/languagelookup.json", "pattern": "^[a-z]{2,3}(?:-[a-zA-Z]+)?$" }, "url": { "type": "string", "pattern": "^(https?:\\/\\/(?:storage\\.cloud\\.google\\.com|localhost(?::[0-9]+)?)\\/[a-z0-9-._~!$&'()*+,;=:@%\\/\\?]+)$" }, "preset": { "type": "string", "description": "Presets from https://github.com/learningequality/le-utils/blob/main/le_utils/constants/format_presets.py", "enum": [ "high_res_video", "low_res_video", "video_thumbnail", "video_subtitle", "video_dependency", "audio", "audio_thumbnail", "audio_dependency", "document", "epub", "document_thumbnail", "exercise", "exercise_thumbnail", "exercise_image", "exercise_graphie", "channel_thumbnail", "topic_thumbnail", "html5_zip", "html5_dependency", "html5_thumbnail", "h5p", "h5p_thumbnail", "zim", "zim_thumbnail", "qti", "qti_thumbnail", "slideshow_image", "slideshow_thumbnail", "slideshow_manifest", "imscp_zip", "bloompub" ] }, "file": { "type": "object", "additionalProperties": false, "properties": { "url": { "$ref": "#/definitions/url" }, "preset": { "$ref": "#/definitions/preset" }, "language": { "$ref": "#/definitions/language" } }, "required": [ "url", "preset" ] }, "resource": { "type": "object", "description": "The key textual metadata and data for a content resource", "additionalProperties": false, "properties": { "id": { "$ref": "/schemas/common_embed_definitions#/definitions/uuid", "description": "The UUID of the content resource" }, "title": { "type": "string", "description": "The title of the content resource" }, "description": { "type": "string", "description": "The description of the content resource" }, "text": { "type": "string", "description": "The cleaned up text extracted from the content resource (in markdown or plaintext format)" }, "language": { "$ref": "#/definitions/language" }, "files": { "type": "array", "description": "A list of files associated with the content resource", "items": { "$ref": "#/definitions/file" } }, "content_id": { "$ref": "/schemas/common_embed_definitions#/definitions/uuid", "description": "The UUID of the content resource(s)" } }, "required": [ "id", "title", "description", "text", "content_id" ] } }, "properties": { "resources": { "type": "array", "description": "A list of content resources to embed", "items": { "$ref": "#/definitions/resource" } }, "metadata": { "type": "object", "description": "The metadata of the channel for logging purposes" } }, "required": ["resources"] };