Skip to main content

Variable: pluginManifestSchema

const pluginManifestSchema: object

Defined in: src/plugins/core/manifest-schema.ts:96

JSON Schema for plugin manifest validation.

Type declaration​

$id​

readonly $id: "https://chive.pub/schemas/plugin-manifest.json" = 'https://chive.pub/schemas/plugin-manifest.json'

$schema​

readonly $schema: "http://json-schema.org/draft-07/schema#" = 'http://json-schema.org/draft-07/schema#'

additionalProperties​

readonly additionalProperties: false = false

description​

readonly description: "Schema for Chive plugin manifest files (plugin.json)" = 'Schema for Chive plugin manifest files (plugin.json)'

properties​

readonly properties: object

properties.author​

readonly author: object

properties.author.description​

readonly description: "Author name or organization" = 'Author name or organization'

properties.author.examples​

readonly examples: readonly ["Chive Team", "Jane Doe <jane@example.com>"]

properties.author.maxLength​

readonly maxLength: 200 = 200

properties.author.minLength​

readonly minLength: 1 = 1

properties.author.type​

readonly type: "string" = 'string'

properties.dependencies​

readonly dependencies: object

properties.dependencies.description​

readonly description: "Plugin dependencies (other plugin IDs that must be loaded first)" = 'Plugin dependencies (other plugin IDs that must be loaded first)'

properties.dependencies.items​

readonly items: object

properties.dependencies.items.pattern​

readonly pattern: "^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*)+$" = '^[a-z][a-z0-9]*(\\.[a-z][a-z0-9-]*)+$'

properties.dependencies.items.type​

readonly type: "string" = 'string'

properties.dependencies.maxItems​

readonly maxItems: 10 = 10

properties.dependencies.type​

readonly type: "array" = 'array'

properties.dependencies.uniqueItems​

readonly uniqueItems: true = true

properties.description​

readonly description: object

properties.description.description​

readonly description: "Brief description of what the plugin does" = 'Brief description of what the plugin does'

properties.description.maxLength​

readonly maxLength: 500 = 500

properties.description.minLength​

readonly minLength: 10 = 10

properties.description.type​

readonly type: "string" = 'string'

properties.entrypoint​

readonly entrypoint: object

properties.entrypoint.description​

readonly description: "Relative path to plugin entry point" = 'Relative path to plugin entry point'

properties.entrypoint.examples​

readonly examples: readonly ["dist/index.js", "lib/main.mjs"]

properties.entrypoint.maxLength​

readonly maxLength: 256 = 256

properties.entrypoint.pattern​

readonly pattern: "^[a-zA-Z0-9_\-./]+\.(js|mjs)$" = '^[a-zA-Z0-9_\\-./]+\\.(js|mjs)$'

properties.entrypoint.type​

readonly type: "string" = 'string'

properties.id​

readonly id: object

properties.id.description​

readonly description: "Unique plugin identifier in reverse domain notation (e.g., "pub.chive.plugin.github")" = 'Unique plugin identifier in reverse domain notation (e.g., "pub.chive.plugin.github")'

properties.id.examples​

readonly examples: readonly ["pub.chive.plugin.github", "org.orcid.chive-integration", "com.example.my-plugin"]

properties.id.maxLength​

readonly maxLength: 128 = 128

properties.id.minLength​

readonly minLength: 3 = 3

properties.id.pattern​

readonly pattern: "^[a-z][a-z0-9]*(\.[a-z][a-z0-9-]*)+$" = '^[a-z][a-z0-9]*(\\.[a-z][a-z0-9-]*)+$'

properties.id.type​

readonly type: "string" = 'string'

properties.license​

readonly license: object

properties.license.description​

readonly description: "SPDX license identifier" = 'SPDX license identifier'

properties.license.enum​

readonly enum: readonly ["MIT", "Apache-2.0", "GPL-3.0", "GPL-3.0-only", "GPL-3.0-or-later", "BSD-2-Clause", "BSD-3-Clause", "ISC", "MPL-2.0", "LGPL-3.0", "AGPL-3.0", "Unlicense", "UNLICENSED"]

properties.license.type​

readonly type: "string" = 'string'

properties.name​

readonly name: object

properties.name.description​

readonly description: "Human-readable plugin name" = 'Human-readable plugin name'

properties.name.examples​

readonly examples: readonly ["GitHub Integration", "ORCID Linking"]

properties.name.maxLength​

readonly maxLength: 100 = 100

properties.name.minLength​

readonly minLength: 1 = 1

properties.name.type​

readonly type: "string" = 'string'

properties.permissions​

readonly permissions: object = pluginPermissionsSchema

properties.permissions.additionalProperties​

readonly additionalProperties: false = false

properties.permissions.properties​

readonly properties: object

properties.permissions.properties.hooks​

readonly hooks: object

properties.permissions.properties.hooks.description​

readonly description: "Event hooks the plugin can subscribe to" = 'Event hooks the plugin can subscribe to'

properties.permissions.properties.hooks.items​

readonly items: object

properties.permissions.properties.hooks.items.type​

readonly type: "string" = 'string'

properties.permissions.properties.hooks.maxItems​

readonly maxItems: 50 = 50

properties.permissions.properties.hooks.type​

readonly type: "array" = 'array'

properties.permissions.properties.hooks.uniqueItems​

readonly uniqueItems: true = true

properties.permissions.properties.network​

readonly network: object

properties.permissions.properties.network.additionalProperties​

readonly additionalProperties: false = false

properties.permissions.properties.network.properties​

readonly properties: object

properties.permissions.properties.network.properties.allowedDomains​

readonly allowedDomains: object

properties.permissions.properties.network.properties.allowedDomains.description​

readonly description: "Domains the plugin can make HTTP requests to" = 'Domains the plugin can make HTTP requests to'

properties.permissions.properties.network.properties.allowedDomains.items​

readonly items: object

properties.permissions.properties.network.properties.allowedDomains.items.type​

readonly type: "string" = 'string'

properties.permissions.properties.network.properties.allowedDomains.maxItems​

readonly maxItems: 20 = 20

properties.permissions.properties.network.properties.allowedDomains.type​

readonly type: "array" = 'array'

properties.permissions.properties.network.properties.allowedDomains.uniqueItems​

readonly uniqueItems: true = true

properties.permissions.properties.network.required​

readonly required: readonly ["allowedDomains"]

properties.permissions.properties.network.type​

readonly type: "object" = 'object'

properties.permissions.properties.storage​

readonly storage: object

properties.permissions.properties.storage.additionalProperties​

readonly additionalProperties: false = false

properties.permissions.properties.storage.properties​

readonly properties: object

properties.permissions.properties.storage.properties.maxSize​

readonly maxSize: object

properties.permissions.properties.storage.properties.maxSize.description​

readonly description: "Maximum storage size in bytes" = 'Maximum storage size in bytes'

properties.permissions.properties.storage.properties.maxSize.maximum​

readonly maximum: 104857600 = 104857600

properties.permissions.properties.storage.properties.maxSize.minimum​

readonly minimum: 0 = 0

properties.permissions.properties.storage.properties.maxSize.type​

readonly type: "number" = 'number'

properties.permissions.properties.storage.required​

readonly required: readonly ["maxSize"]

properties.permissions.properties.storage.type​

readonly type: "object" = 'object'

properties.permissions.type​

readonly type: "object" = 'object'

properties.version​

readonly version: object

properties.version.description​

readonly description: "Semantic version (semver 2.0)" = 'Semantic version (semver 2.0)'

properties.version.examples​

readonly examples: readonly ["1.0.0", "2.1.3-beta.1", "0.9.0+build.123"]

properties.version.pattern​

readonly pattern: "^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" = '^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$'

properties.version.type​

readonly type: "string" = 'string'

required​

readonly required: readonly ["id", "name", "version", "description", "author", "license", "permissions", "entrypoint"]

title​

readonly title: "Chive Plugin Manifest" = 'Chive Plugin Manifest'

type​

readonly type: "object" = 'object'

Remarks​

This schema validates plugin.json files according to Chive's plugin manifest specification. All plugins must pass validation before loading.

Example​

import Ajv from 'ajv';
import addFormats from 'ajv-formats';
import { pluginManifestSchema } from './manifest-schema.js';

const ajv = new Ajv({ allErrors: true });
addFormats(ajv);

const validate = ajv.compile(pluginManifestSchema);
const isValid = validate(manifestData);

if (!isValid) {
console.error('Validation errors:', validate.errors);
}