add schemas for repos and plugins

This commit is contained in:
Evert Prants 2021-10-07 18:29:59 +03:00
parent 9a2142688b
commit 906dfa7c34
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
5 changed files with 95 additions and 1 deletions

View File

@ -1,3 +1,4 @@
/src/
/schema/
/tsconfig.json
/tslint.json

View File

@ -3,6 +3,7 @@
"version": "3.3.4",
"description": "Squeebot v3 core for the execution environment",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"module": "lib/",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",

47
schema/plugin.schema.json Normal file
View File

@ -0,0 +1,47 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://squeebot.lunasqu.ee/pkg/plugin.schema.json",
"title": "plugin",
"description": "Squeebot plugin definition",
"type": "object",
"properties": {
"main": {
"type": "string",
"description": "Plugin's entry file, must export a class that extends Plugin"
},
"name": {
"type": "string",
"description": "Name of the plugin"
},
"description": {
"type": "string",
"description": "A short description of the plugin's functions"
},
"tags": {
"type": "array",
"description": "A list of descriptive tags",
"items": {
"type": "string"
}
},
"version": {
"type": "string",
"description": "Semantic version(ing)"
},
"dependencies": {
"type": "array",
"description": "A list of plugin dependencies. ? suffix denotes optional.",
"items": {
"type": "string"
}
},
"npmDependencies": {
"type": "array",
"description": "A list of NPM dependencies, package@version format",
"items": {
"type": "string"
}
}
},
"required": ["main", "name", "version"]
}

View File

@ -0,0 +1,38 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://squeebot.lunasqu.ee/pkg/repository.schema.json",
"title": "repository",
"description": "Squeebot repository definition",
"type": "object",
"properties": {
"created": {
"type": "integer",
"description": "When was the repository last built"
},
"name": {
"type": "string",
"description": "Name of the repository"
},
"plugins": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Name of the plugin"
},
"version": {
"type": "string",
"description": "Plugin version"
}
}
}
},
"typescript": {
"type": "boolean",
"description": "Is TypeScript enabled?"
}
},
"required": ["name", "plugins"]
}

View File

@ -0,0 +1,7 @@
export * from './channel';
export * from './common';
export * from './core';
export * from './npm';
export * from './plugin';
export * from './types';
export * from './util';