video.cerulea.blue/common/lexicons.ts

75 lines
1.6 KiB
TypeScript

import type { MakeLexiconUniverse } from "@char/lexicon.ts";
export const videoLexicon = {
lexicon: 1,
id: "blue.cerulea.video.video",
defs: {
main: {
type: "record",
key: "any",
record: {
type: "object",
required: ["video"],
properties: {
video: {
type: "blob",
accept: ["video/mp4", "video/webm"],
maxSize: 536870912,
},
title: {
type: "string",
maxGraphemes: 300,
maxLength: 3000,
},
description: {
type: "string",
},
},
},
},
},
} as const;
export const fetchVideoLexicon = {
lexicon: 1,
id: "blue.cerulea.video.fetchVideo",
defs: {
main: {
type: "procedure",
input: {
encoding: "application/json",
schema: {
type: "object",
required: ["repo", "blob"],
properties: {
repo: {
type: "string",
format: "did",
},
blob: {
type: "string",
format: "cid",
},
},
},
},
output: {
encoding: "application/json",
schema: {
type: "object",
required: ["filename"],
properties: {
filename: {
type: "string",
},
},
},
},
errors: [{ name: "Denied" }],
},
},
} as const;
export type VideoLexiconUniverse = MakeLexiconUniverse<
[typeof videoLexicon, typeof fetchVideoLexicon]
>;