altair-graphql-core
Version:
Several of the core logic for altair graphql client
98 lines • 4.5 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pluginV3ManifestSchema = exports.pluginIconSchema = exports.pluginEntrySchema = void 0;
const v4_1 = require("zod/v4");
const capabilities_1 = require("./capabilities");
const pluginHtmlEntrySchema = (0, v4_1.object)({
type: (0, v4_1.literal)('html'),
path: (0, v4_1.string)(),
});
const pluginJsEntrySchema = (0, v4_1.object)({
type: (0, v4_1.literal)('js'),
scripts: (0, v4_1.string)().array(),
styles: (0, v4_1.string)().array(),
});
exports.pluginEntrySchema = (0, v4_1.union)([pluginHtmlEntrySchema, pluginJsEntrySchema]);
const pluginIconImageSchema = (0, v4_1.object)({
type: (0, v4_1.literal)('image'),
url: (0, v4_1.string)(),
});
const pluginIconSvgSchema = (0, v4_1.object)({
type: (0, v4_1.literal)('svg'),
src: (0, v4_1.string)(),
});
exports.pluginIconSchema = (0, v4_1.union)([pluginIconImageSchema, pluginIconSvgSchema]);
exports.pluginV3ManifestSchema = (0, v4_1.object)({
/**
* Version of manifest (should be 3). It is a control measure for variations in the plugin versions
*/
manifest_version: (0, v4_1.literal)(3).meta({
description: 'Version of manifest (should be 3). It is a control measure for variations in the plugin versions',
}),
/**
* Name of the plugin. It should be the same name you would use in your `package.json` file. It uniquely identifies your plugin. The plugin name must begin with `altair-graphql-plugin-`.
*/
name: (0, v4_1.string)().meta({
description: 'Name of the plugin. It should be the same name you would use in your `package.json` file. It uniquely identifies your plugin. The plugin name must begin with `altair-graphql-plugin-`.',
}),
/**
* The name of the plugin that is displayed in the UI. It is the human readable version of your plugin name.
*/
display_name: (0, v4_1.string)().meta({
description: 'The name of the plugin that is displayed in the UI. It is the human readable version of your plugin name.',
}),
/**
* The version of your plugin. It should be the same version you would have in your `package.json` file (except you have a good reason why they should be different).
*/
version: (0, v4_1.string)().meta({
description: 'The version of your plugin. It should be the same version you would have in your `package.json` file (except you have a good reason why they should be different).',
}),
/**
* The description of what your plugin is about. It would be used to describe your plugin.
*/
description: (0, v4_1.string)().meta({
description: 'The description of what your plugin is about. It would be used to describe your plugin.',
}),
/**
* The entry point of the plugin
*/
entry: exports.pluginEntrySchema.meta({
description: 'The entry point of the plugin',
}),
/**
* Specifies the capabilities (functionalities) available to the plugin. In the future, this would be used to request the necessary permissions from the user
*/
capabilities: capabilities_1.pluginCapabilitiesSchema
.array()
.meta({
description: 'Specifies the capabilities (functionalities) available to the plugin. In the future, this would be used to request the necessary permissions from the user',
})
.optional(),
/**
* Email of the author of the plugin
*/
author_email: (0, v4_1.string)()
.meta({ description: 'Email of the author of the plugin' })
.optional(),
/**
* Name of the author of the plugin
*/
author: (0, v4_1.string)()
.meta({ description: 'Name of the author of the plugin' })
.optional(),
/**
* The minimum version of Altair that the plugin is compatible with. This is useful for when the plugin uses features that are only available in a certain version of Altair
*/
minimum_altair_version: (0, v4_1.string)()
.meta({
description: 'The minimum version of Altair that the plugin is compatible with. This is useful for when the plugin uses features that are only available in a certain version of Altair',
})
.optional(),
/**
* The icon of the plugin. It can be an image or an SVG
*/
icon: exports.pluginIconSchema
.meta({ description: 'The icon of the plugin. It can be an image or an SVG' })
.optional(),
});
//# sourceMappingURL=manifest.js.map