kolibri-constants
Version:
A package that exposes constants commonly used across the Kolibri Ecosystem
152 lines (149 loc) • 4.29 kB
JavaScript
// -*- 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": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
"description": "A unique identifier in the form of a UUID"
},
"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": "#/definitions/uuid",
"description": "The UUID of the content resource"
},
"channel_id": {
"$ref": "#/definitions/uuid",
"description": "The UUID of the channel that the content resource belongs to"
},
"title": {
"type": "string",
"description": "The title of the content resource"
},
"description": {
"type": "string",
"description": "The description of the content resource"
},
"text": {
"type": "string",
"description": "Optional textual content to include in the embedding"
},
"language": {
"$ref": "#/definitions/language"
},
"files": {
"type": "array",
"description": "A list of files associated with the content resource",
"items": {
"$ref": "#/definitions/file"
}
},
"content_id": {
"$ref": "#/definitions/uuid",
"description": "The UUID of the content resource(s)"
},
"channel_version": {
"type": "integer",
"description": "The version number of the channel that the content resource belongs to"
}
},
"required": [
"id",
"channel_id",
"title",
"description",
"content_id",
"channel_version"
]
}
},
"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"]
};