You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
639 B
TypeScript
33 lines
639 B
TypeScript
import { Api, replacer } from "../common/api.ts";
|
|
import { MakeHandlers, makeServe } from "../common/deps/yaypi.ts";
|
|
|
|
const handlers: MakeHandlers<typeof Api> = {
|
|
v1: {
|
|
listSchemas: async (limit) => [
|
|
{
|
|
id: 0,
|
|
latestVersion: {
|
|
version: 1,
|
|
schema: {
|
|
name: "Test",
|
|
fields: [
|
|
{
|
|
name: "name",
|
|
options: {
|
|
displayAs: "input",
|
|
minLength: 0,
|
|
},
|
|
kind: "string",
|
|
required: true,
|
|
},
|
|
],
|
|
},
|
|
},
|
|
},
|
|
],
|
|
saveSchema: async ({ schema, id }) => "todo",
|
|
},
|
|
};
|
|
|
|
export const serveApi = makeServe(Api, handlers, "/api", replacer);
|