Adds a number of examples for builtin functions
This patch also proposes: - changing the pattern by which the examples are imported - adds tests for the examples Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
@@ -20,6 +20,12 @@ import { Schema } from 'jsonschema';
|
||||
import zodToJsonSchema from 'zod-to-json-schema';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
|
||||
/** @public */
|
||||
export type TemplateExample = {
|
||||
description: string;
|
||||
example: string;
|
||||
};
|
||||
|
||||
/** @public */
|
||||
export type TemplateActionOptions<
|
||||
TActionInput extends JsonObject = {},
|
||||
@@ -29,7 +35,7 @@ export type TemplateActionOptions<
|
||||
> = {
|
||||
id: string;
|
||||
description?: string;
|
||||
examples?: { description: string; example: string }[];
|
||||
examples?: TemplateExample[];
|
||||
supportsDryRun?: boolean;
|
||||
schema?: {
|
||||
input?: TInputSchema;
|
||||
|
||||
@@ -17,5 +17,6 @@
|
||||
export {
|
||||
createTemplateAction,
|
||||
type TemplateActionOptions,
|
||||
type TemplateExample,
|
||||
} from './createTemplateAction';
|
||||
export { type ActionContext, type TemplateAction } from './types';
|
||||
|
||||
Reference in New Issue
Block a user