feat: add usage documentation for backstage-cli config:docs command and create new configuration files
Signed-off-by: Ladislav Vitásek <ladislav.vitasek@gendigital.com>
This commit is contained in:
@@ -0,0 +1,524 @@
|
||||
## API Report File for "@backstage/plugin-scaffolder-react"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { AnyApiFactory } from '@backstage/frontend-plugin-api';
|
||||
import { AnyApiRef } from '@backstage/core-plugin-api';
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { ApiRef } from '@backstage/frontend-plugin-api';
|
||||
import { ComponentType } from 'react';
|
||||
import { ConfigurableExtensionDataRef } from '@backstage/frontend-plugin-api';
|
||||
import { CustomFieldValidator } from '@backstage/plugin-scaffolder-react';
|
||||
import { Dispatch } from 'react';
|
||||
import { ExtensionBlueprint } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
|
||||
import { ExtensionInput } from '@backstage/frontend-plugin-api';
|
||||
import { FieldExtensionComponentProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldSchema } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import { FormField } from '@internal/scaffolder';
|
||||
import { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { LayoutOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { Overrides } from '@material-ui/core/styles/overrides';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ReactElement } from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderRJSFFormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderStep } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderTaskOutput } from '@backstage/plugin-scaffolder-react';
|
||||
import { SetStateAction } from 'react';
|
||||
import { StyleRules } from '@material-ui/core/styles/withStyles';
|
||||
import { TaskStep } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateParameterSchema } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplatePresentationV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
|
||||
import { UiSchema } from '@rjsf/utils';
|
||||
import { WidgetProps } from '@rjsf/utils';
|
||||
import { z } from 'zod';
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type BackstageOverrides = Overrides & {
|
||||
[Name in keyof ScaffolderReactComponentsNameToClassKey]?: Partial<
|
||||
StyleRules<ScaffolderReactComponentsNameToClassKey[Name]>
|
||||
>;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type BackstageTemplateStepperClassKey =
|
||||
| 'backButton'
|
||||
| 'footer'
|
||||
| 'formWrapper';
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const createAsyncValidators: (
|
||||
rootSchema: JsonObject,
|
||||
validators: Record<
|
||||
string,
|
||||
undefined | CustomFieldValidator<unknown, unknown>
|
||||
>,
|
||||
context: {
|
||||
apiHolder: ApiHolder;
|
||||
},
|
||||
) => (formData: JsonObject) => Promise<FormValidation>;
|
||||
|
||||
// @alpha
|
||||
export const createFieldValidation: () => FieldValidation;
|
||||
|
||||
// @alpha
|
||||
export function createFormField<
|
||||
TReturnValue extends z.ZodType,
|
||||
TUiOptions extends z.ZodType,
|
||||
>(opts: FormFieldExtensionData<TReturnValue, TUiOptions>): FormField;
|
||||
|
||||
// @alpha
|
||||
export function createScaffolderFormDecorator<
|
||||
TInputSchema extends {
|
||||
[key in string]: (zImpl: typeof z) => z.ZodType;
|
||||
} = {
|
||||
[key in string]: (zImpl: typeof z) => z.ZodType;
|
||||
},
|
||||
TDeps extends {
|
||||
[key in string]: AnyApiRef;
|
||||
} = {
|
||||
[key in string]: AnyApiRef;
|
||||
},
|
||||
TInput extends JsonObject = {
|
||||
[key in keyof TInputSchema]: z.infer<ReturnType<TInputSchema[key]>>;
|
||||
},
|
||||
>(options: {
|
||||
id: string;
|
||||
schema?: {
|
||||
input?: TInputSchema;
|
||||
};
|
||||
deps?: TDeps;
|
||||
decorator: (
|
||||
ctx: ScaffolderFormDecoratorContext<TInput>,
|
||||
deps: TDeps extends {
|
||||
[key in string]: AnyApiRef;
|
||||
}
|
||||
? {
|
||||
[key in keyof TDeps]: TDeps[key]['T'];
|
||||
}
|
||||
: never,
|
||||
) => Promise<void>;
|
||||
}): ScaffolderFormDecorator<TInput>;
|
||||
|
||||
// @alpha
|
||||
export const DefaultTemplateOutputs: (props: {
|
||||
output?: ScaffolderTaskOutput;
|
||||
}) => React_2.JSX.Element | null;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const EmbeddableWorkflow: (props: WorkflowProps) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export const extractSchemaFromStep: (inputStep: JsonObject) => {
|
||||
uiSchema: UiSchema;
|
||||
schema: JsonObject;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export const Form: (
|
||||
props: PropsWithChildren<ScaffolderRJSFFormProps>,
|
||||
) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export const FormDecoratorBlueprint: ExtensionBlueprint<{
|
||||
kind: 'scaffolder-form-decorator';
|
||||
name: undefined;
|
||||
params: {
|
||||
decorator: ScaffolderFormDecorator;
|
||||
};
|
||||
output: ConfigurableExtensionDataRef<
|
||||
ScaffolderFormDecorator,
|
||||
'scaffolder.form-decorator-loader',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
config: {};
|
||||
configInput: {};
|
||||
dataRefs: {
|
||||
formDecoratorLoader: ConfigurableExtensionDataRef<
|
||||
ScaffolderFormDecorator,
|
||||
'scaffolder.form-decorator-loader',
|
||||
{}
|
||||
>;
|
||||
};
|
||||
}>;
|
||||
|
||||
// @alpha
|
||||
export const FormFieldBlueprint: ExtensionBlueprint<{
|
||||
kind: 'scaffolder-form-field';
|
||||
name: undefined;
|
||||
params: {
|
||||
field: () => Promise<FormField>;
|
||||
};
|
||||
output: ConfigurableExtensionDataRef<
|
||||
() => Promise<FormField>,
|
||||
'scaffolder.form-field-loader',
|
||||
{}
|
||||
>;
|
||||
inputs: {};
|
||||
config: {};
|
||||
configInput: {};
|
||||
dataRefs: {
|
||||
formFieldLoader: ConfigurableExtensionDataRef<
|
||||
() => Promise<FormField>,
|
||||
'scaffolder.form-field-loader',
|
||||
{}
|
||||
>;
|
||||
};
|
||||
}>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type FormFieldExtensionData<
|
||||
TReturnValue extends z.ZodType = z.ZodType,
|
||||
TUiOptions extends z.ZodType = z.ZodType,
|
||||
> = {
|
||||
name: string;
|
||||
component: (
|
||||
props: FieldExtensionComponentProps<
|
||||
z.output<TReturnValue>,
|
||||
z.output<TUiOptions>
|
||||
>,
|
||||
) => JSX.Element | null;
|
||||
validation?: CustomFieldValidator<
|
||||
z.output<TReturnValue>,
|
||||
z.output<TUiOptions>
|
||||
>;
|
||||
schema?: FieldSchema<z.output<TReturnValue>, z.output<TUiOptions>>;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const formFieldsApi: ExtensionDefinition<{
|
||||
config: {};
|
||||
configInput: {};
|
||||
output: ConfigurableExtensionDataRef<AnyApiFactory, 'core.api.factory', {}>;
|
||||
inputs: {
|
||||
formFields: ExtensionInput<
|
||||
ConfigurableExtensionDataRef<
|
||||
() => Promise<FormField>,
|
||||
'scaffolder.form-field-loader',
|
||||
{}
|
||||
>,
|
||||
{
|
||||
singleton: false;
|
||||
optional: false;
|
||||
}
|
||||
>;
|
||||
};
|
||||
kind: 'api';
|
||||
name: 'form-fields';
|
||||
params: {
|
||||
factory: AnyApiFactory;
|
||||
};
|
||||
}>;
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
export const formFieldsApiRef: ApiRef<ScaffolderFormFieldsApi>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type FormValidation = {
|
||||
[name: string]: FieldValidation | FormValidation;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export interface ParsedTemplateSchema {
|
||||
// (undocumented)
|
||||
description?: string;
|
||||
// (undocumented)
|
||||
mergedSchema: JsonObject;
|
||||
// (undocumented)
|
||||
schema: JsonObject;
|
||||
// (undocumented)
|
||||
title: string;
|
||||
// (undocumented)
|
||||
uiSchema: UiSchema;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const ReviewState: (props: ReviewStateProps) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export type ReviewStateProps = {
|
||||
schemas: ParsedTemplateSchema[];
|
||||
formState: JsonObject;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export const ScaffolderField: (
|
||||
props: PropsWithChildren<ScaffolderFieldProps>,
|
||||
) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export interface ScaffolderFieldProps {
|
||||
// (undocumented)
|
||||
disabled?: boolean;
|
||||
// (undocumented)
|
||||
displayLabel?: boolean;
|
||||
// (undocumented)
|
||||
errors?: ReactElement;
|
||||
// (undocumented)
|
||||
help?: ReactElement;
|
||||
// (undocumented)
|
||||
rawDescription?: string;
|
||||
// (undocumented)
|
||||
rawErrors?: string[];
|
||||
// (undocumented)
|
||||
rawHelp?: string;
|
||||
// (undocumented)
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ScaffolderFormDecorator<TInput extends JsonObject = JsonObject> = {
|
||||
readonly $$type: '@backstage/scaffolder/FormDecorator';
|
||||
readonly id: string;
|
||||
readonly TInput: TInput;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ScaffolderFormDecoratorContext<
|
||||
TInput extends JsonObject = JsonObject,
|
||||
> = {
|
||||
input: TInput;
|
||||
formState: Record<string, JsonValue>;
|
||||
setFormState: (
|
||||
fn: (currentState: Record<string, JsonValue>) => Record<string, JsonValue>,
|
||||
) => void;
|
||||
setSecrets: (
|
||||
fn: (currentState: Record<string, string>) => Record<string, string>,
|
||||
) => void;
|
||||
};
|
||||
|
||||
// @alpha @deprecated (undocumented)
|
||||
export interface ScaffolderFormFieldsApi {
|
||||
// (undocumented)
|
||||
getFormFields(): Promise<FormFieldExtensionData[]>;
|
||||
}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export function ScaffolderPageContextMenu(
|
||||
props: ScaffolderPageContextMenuProps,
|
||||
): React_2.JSX.Element | null;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ScaffolderPageContextMenuProps = {
|
||||
onEditorClicked?: () => void;
|
||||
onActionsClicked?: () => void;
|
||||
onTasksClicked?: () => void;
|
||||
onCreateClicked?: () => void;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ScaffolderReactComponentsNameToClassKey = {
|
||||
ScaffolderReactTemplateCategoryPicker: ScaffolderReactTemplateCategoryPickerClassKey;
|
||||
BackstageTemplateStepper: BackstageTemplateStepperClassKey;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type ScaffolderReactTemplateCategoryPickerClassKey = 'root' | 'label';
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const scaffolderReactTranslationRef: TranslationRef<
|
||||
'scaffolder-react',
|
||||
{
|
||||
readonly 'passwordWidget.content': 'This widget is insecure. Please use [`ui:field: Secret`](https://backstage.io/docs/features/software-templates/writing-templates/#using-secrets) instead of `ui:widget: password`';
|
||||
readonly 'scaffolderPageContextMenu.moreLabel': 'more';
|
||||
readonly 'scaffolderPageContextMenu.createLabel': 'Create';
|
||||
readonly 'scaffolderPageContextMenu.editorLabel': 'Manage Templates';
|
||||
readonly 'scaffolderPageContextMenu.actionsLabel': 'Installed Actions';
|
||||
readonly 'scaffolderPageContextMenu.tasksLabel': 'Task List';
|
||||
readonly 'stepper.backButtonText': 'Back';
|
||||
readonly 'stepper.createButtonText': 'Create';
|
||||
readonly 'stepper.reviewButtonText': 'Review';
|
||||
readonly 'stepper.stepIndexLabel': 'Step {{index, number}}';
|
||||
readonly 'stepper.nextButtonText': 'Next';
|
||||
readonly 'templateCategoryPicker.title': 'Categories';
|
||||
readonly 'templateCard.noDescription': 'No description';
|
||||
readonly 'templateCard.chooseButtonText': 'Choose';
|
||||
readonly 'cardHeader.detailBtnTitle': 'Show template entity details';
|
||||
readonly 'templateOutputs.title': 'Text Output';
|
||||
readonly 'workflow.noDescription': 'No description';
|
||||
}
|
||||
>;
|
||||
|
||||
// @alpha
|
||||
export const SecretWidget: (
|
||||
props: Pick<
|
||||
WidgetProps,
|
||||
'name' | 'onChange' | 'schema' | 'required' | 'disabled'
|
||||
>,
|
||||
) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export const Stepper: (stepperProps: StepperProps) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export type StepperProps = {
|
||||
manifest: TemplateParameterSchema;
|
||||
extensions: FieldExtensionOptions<any, any>[];
|
||||
templateName?: string;
|
||||
formProps?: FormProps;
|
||||
initialState?: Record<string, JsonValue>;
|
||||
onCreate: (values: Record<string, JsonValue>) => Promise<void>;
|
||||
components?: {
|
||||
ReviewStepComponent?: ComponentType<ReviewStepProps>;
|
||||
ReviewStateComponent?: (props: ReviewStateProps) => JSX.Element;
|
||||
backButtonText?: ReactNode;
|
||||
createButtonText?: ReactNode;
|
||||
reviewButtonText?: ReactNode;
|
||||
};
|
||||
layouts?: LayoutOptions[];
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export const TaskLogStream: (props: {
|
||||
logs: {
|
||||
[k: string]: string[];
|
||||
};
|
||||
}) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export const TaskSteps: (props: TaskStepsProps) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export interface TaskStepsProps {
|
||||
// (undocumented)
|
||||
activeStep?: number;
|
||||
// (undocumented)
|
||||
isComplete?: boolean;
|
||||
// (undocumented)
|
||||
isError?: boolean;
|
||||
// (undocumented)
|
||||
steps: (TaskStep & ScaffolderStep)[];
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const TemplateCard: (props: TemplateCardProps) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export interface TemplateCardProps {
|
||||
// (undocumented)
|
||||
additionalLinks?: {
|
||||
icon: IconComponent;
|
||||
text: string;
|
||||
url: string;
|
||||
}[];
|
||||
// (undocumented)
|
||||
onSelected?: (template: TemplateEntityV1beta3) => void;
|
||||
// (undocumented)
|
||||
template: TemplateEntityV1beta3;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const TemplateCategoryPicker: () => React_2.JSX.Element | null;
|
||||
|
||||
// @alpha
|
||||
export const TemplateGroup: (
|
||||
props: TemplateGroupProps,
|
||||
) => React_2.JSX.Element | null;
|
||||
|
||||
// @alpha
|
||||
export interface TemplateGroupProps {
|
||||
// (undocumented)
|
||||
components?: {
|
||||
CardComponent?: React_2.ComponentType<TemplateCardProps>;
|
||||
};
|
||||
// (undocumented)
|
||||
onSelected: (template: TemplateEntityV1beta3) => void;
|
||||
// (undocumented)
|
||||
templates: {
|
||||
template: TemplateEntityV1beta3;
|
||||
additionalLinks?: {
|
||||
icon: IconComponent;
|
||||
text: string;
|
||||
url: string;
|
||||
}[];
|
||||
}[];
|
||||
// (undocumented)
|
||||
title: React_2.ReactNode;
|
||||
}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const TemplateGroups: (
|
||||
props: TemplateGroupsProps,
|
||||
) => React_2.JSX.Element | null;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export interface TemplateGroupsProps {
|
||||
// (undocumented)
|
||||
additionalLinksForEntity?: (template: TemplateEntityV1beta3) => {
|
||||
icon: IconComponent;
|
||||
text: string;
|
||||
url: string;
|
||||
}[];
|
||||
// (undocumented)
|
||||
groups: TemplateGroupFilter[];
|
||||
// (undocumented)
|
||||
onTemplateSelected?: (template: TemplateEntityV1beta3) => void;
|
||||
// (undocumented)
|
||||
TemplateCardComponent?: React_2.ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
}>;
|
||||
// (undocumented)
|
||||
templateFilter?: (entity: TemplateEntityV1beta3) => boolean;
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export const useFilteredSchemaProperties: (
|
||||
manifest: TemplateParameterSchema | undefined,
|
||||
) => TemplateParameterSchema | undefined;
|
||||
|
||||
// @alpha
|
||||
export const useFormDataFromQuery: (
|
||||
initialState?: Record<string, JsonValue>,
|
||||
) => [Record<string, any>, Dispatch<SetStateAction<Record<string, any>>>];
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const useTemplateParameterSchema: (templateRef: string) => {
|
||||
manifest?: TemplateParameterSchema;
|
||||
loading: boolean;
|
||||
error?: Error;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export const useTemplateSchema: (manifest: TemplateParameterSchema) => {
|
||||
steps: ParsedTemplateSchema[];
|
||||
presentation?: TemplatePresentationV1beta3;
|
||||
};
|
||||
|
||||
// @alpha (undocumented)
|
||||
export const Workflow: (workflowProps: WorkflowProps) => JSX.Element | null;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type WorkflowProps = {
|
||||
title?: string;
|
||||
description?: string;
|
||||
namespace: string;
|
||||
templateName: string;
|
||||
components?: {
|
||||
ReviewStepComponent?: React_2.ComponentType<ReviewStepProps>;
|
||||
};
|
||||
onError(error: Error | undefined): JSX.Element | null;
|
||||
} & Pick<
|
||||
StepperProps,
|
||||
| 'extensions'
|
||||
| 'formProps'
|
||||
| 'components'
|
||||
| 'onCreate'
|
||||
| 'initialState'
|
||||
| 'layouts'
|
||||
>;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
@@ -0,0 +1,567 @@
|
||||
## API Report File for "@backstage/plugin-scaffolder-react"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { ApiRef } from '@backstage/frontend-plugin-api';
|
||||
import { ComponentType } from 'react';
|
||||
import { CustomValidator } from '@rjsf/utils';
|
||||
import { ElementType } from 'react';
|
||||
import { ErrorSchema } from '@rjsf/utils';
|
||||
import { ErrorTransformer } from '@rjsf/utils';
|
||||
import { Experimental_DefaultFormStateBehavior } from '@rjsf/utils';
|
||||
import { Extension } from '@backstage/core-plugin-api';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import Form from '@rjsf/core';
|
||||
import { FormContextType } from '@rjsf/utils';
|
||||
import { FormEvent } from 'react';
|
||||
import type { FormProps as FormProps_2 } from '@rjsf/core';
|
||||
import { GenericObjectType } from '@rjsf/utils';
|
||||
import { HTMLAttributes } from 'react';
|
||||
import { IChangeEvent } from '@rjsf/core';
|
||||
import { IdSchema } from '@rjsf/utils';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JSONSchema7 } from 'json-schema';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { Observable } from '@backstage/types';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { Ref } from 'react';
|
||||
import { Registry } from '@rjsf/utils';
|
||||
import { RegistryWidgetsType } from '@rjsf/utils';
|
||||
import { RJSFSchema } from '@rjsf/utils';
|
||||
import { RJSFValidationError } from '@rjsf/utils';
|
||||
import { StrictRJSFSchema } from '@rjsf/utils';
|
||||
import { TaskSpec } from '@backstage/plugin-scaffolder-common';
|
||||
import { TaskStep } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplatePresentationV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplatesType } from '@rjsf/utils';
|
||||
import { UIOptionsType } from '@rjsf/utils';
|
||||
import { UiSchema } from '@rjsf/utils';
|
||||
import { ValidatorType } from '@rjsf/utils';
|
||||
import { z } from 'zod';
|
||||
|
||||
// @public
|
||||
export type Action = {
|
||||
id: string;
|
||||
description?: string;
|
||||
schema?: {
|
||||
input?: JSONSchema7;
|
||||
output?: JSONSchema7;
|
||||
};
|
||||
examples?: ActionExample[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export type ActionExample = {
|
||||
description: string;
|
||||
example: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export function createScaffolderFieldExtension<
|
||||
TReturnValue = unknown,
|
||||
TInputProps extends UIOptionsType = {},
|
||||
>(
|
||||
options: FieldExtensionOptions<TReturnValue, TInputProps>,
|
||||
): Extension<FieldExtensionComponent<TReturnValue, TInputProps>>;
|
||||
|
||||
// @public
|
||||
export function createScaffolderLayout<TInputProps = unknown>(
|
||||
options: LayoutOptions,
|
||||
): Extension<LayoutComponent<TInputProps>>;
|
||||
|
||||
// @public
|
||||
export type CustomFieldExtensionSchema = {
|
||||
returnValue: JSONSchema7;
|
||||
uiOptions?: JSONSchema7;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type CustomFieldValidator<TFieldReturnValue, TUiOptions = unknown> = (
|
||||
data: TFieldReturnValue,
|
||||
field: FieldValidation,
|
||||
context: {
|
||||
apiHolder: ApiHolder;
|
||||
formData: JsonObject;
|
||||
schema: JsonObject;
|
||||
uiSchema?: FieldExtensionUiSchema<TFieldReturnValue, TUiOptions>;
|
||||
},
|
||||
) => void | Promise<void>;
|
||||
|
||||
// @public
|
||||
export type FieldExtensionComponent<_TReturnValue, _TInputProps> = () => null;
|
||||
|
||||
// @public
|
||||
export interface FieldExtensionComponentProps<
|
||||
TFieldReturnValue,
|
||||
TUiOptions = {},
|
||||
> extends PropsWithChildren<ScaffolderRJSFFieldProps<TFieldReturnValue>> {
|
||||
// (undocumented)
|
||||
uiSchema: FieldExtensionUiSchema<TFieldReturnValue, TUiOptions>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type FieldExtensionOptions<
|
||||
TFieldReturnValue = unknown,
|
||||
TUiOptions = unknown,
|
||||
> = {
|
||||
name: string;
|
||||
component: (
|
||||
props: FieldExtensionComponentProps<TFieldReturnValue, TUiOptions>,
|
||||
) => JSX.Element | null;
|
||||
validation?: CustomFieldValidator<TFieldReturnValue, TUiOptions>;
|
||||
schema?: CustomFieldExtensionSchema;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface FieldExtensionUiSchema<TFieldReturnValue, TUiOptions>
|
||||
extends UiSchema<TFieldReturnValue> {
|
||||
// (undocumented)
|
||||
'ui:options'?: TUiOptions & UIOptionsType<TFieldReturnValue>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface FieldSchema<TReturn, TUiOptions> {
|
||||
// (undocumented)
|
||||
readonly schema: CustomFieldExtensionSchema;
|
||||
// (undocumented)
|
||||
readonly TOutput: TReturn;
|
||||
// (undocumented)
|
||||
readonly TProps: FieldExtensionComponentProps<TReturn, TUiOptions>;
|
||||
// @deprecated (undocumented)
|
||||
readonly type: FieldExtensionComponentProps<TReturn, TUiOptions>;
|
||||
// @deprecated (undocumented)
|
||||
readonly uiOptionsType: TUiOptions;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type FormProps = Pick<
|
||||
FormProps_2,
|
||||
| 'transformErrors'
|
||||
| 'noHtml5Validate'
|
||||
| 'uiSchema'
|
||||
| 'formContext'
|
||||
| 'omitExtraData'
|
||||
| 'liveOmit'
|
||||
>;
|
||||
|
||||
// @public
|
||||
export type LayoutComponent<_TInputProps> = () => null;
|
||||
|
||||
// @public
|
||||
export interface LayoutOptions<P = any> {
|
||||
// (undocumented)
|
||||
component: LayoutTemplate<P>;
|
||||
// (undocumented)
|
||||
name: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type LayoutTemplate<T = any> = NonNullable<
|
||||
FormProps_2<T>['uiSchema']
|
||||
>['ui:ObjectFieldTemplate'];
|
||||
|
||||
// @public
|
||||
export type ListActionsResponse = Array<Action>;
|
||||
|
||||
// @public
|
||||
export type LogEvent = {
|
||||
type: 'log' | 'completion' | 'cancelled' | 'recovered';
|
||||
body: {
|
||||
message: string;
|
||||
stepId?: string;
|
||||
status?: ScaffolderTaskStatus;
|
||||
};
|
||||
createdAt: string;
|
||||
id: string;
|
||||
taskId: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export function makeFieldSchema<
|
||||
TReturnType extends z.ZodType,
|
||||
TUiOptions extends z.ZodType,
|
||||
>(options: {
|
||||
output: (zImpl: typeof z) => TReturnType;
|
||||
uiOptions?: (zImpl: typeof z) => TUiOptions;
|
||||
}): FieldSchema<z.output<TReturnType>, z.output<TUiOptions>>;
|
||||
|
||||
// @public
|
||||
export type ReviewStepProps = {
|
||||
disableButtons: boolean;
|
||||
formData: JsonObject;
|
||||
handleBack: () => void;
|
||||
handleReset: () => void;
|
||||
handleCreate: () => void;
|
||||
steps: {
|
||||
uiSchema: UiSchema;
|
||||
mergedSchema: JsonObject;
|
||||
schema: JsonObject;
|
||||
}[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface ScaffolderApi {
|
||||
// (undocumented)
|
||||
autocomplete?(options: {
|
||||
token: string;
|
||||
provider: string;
|
||||
resource: string;
|
||||
context?: Record<string, string>;
|
||||
}): Promise<{
|
||||
results: {
|
||||
title?: string;
|
||||
id: string;
|
||||
}[];
|
||||
}>;
|
||||
cancelTask(taskId: string): Promise<void>;
|
||||
// (undocumented)
|
||||
dryRun?(options: ScaffolderDryRunOptions): Promise<ScaffolderDryRunResponse>;
|
||||
// (undocumented)
|
||||
getIntegrationsList(
|
||||
options: ScaffolderGetIntegrationsListOptions,
|
||||
): Promise<ScaffolderGetIntegrationsListResponse>;
|
||||
// (undocumented)
|
||||
getTask(taskId: string): Promise<ScaffolderTask>;
|
||||
// (undocumented)
|
||||
getTemplateParameterSchema(
|
||||
templateRef: string,
|
||||
): Promise<TemplateParameterSchema>;
|
||||
listActions(): Promise<ListActionsResponse>;
|
||||
// (undocumented)
|
||||
listTasks?(options: {
|
||||
filterByOwnership: 'owned' | 'all';
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}): Promise<{
|
||||
tasks: ScaffolderTask[];
|
||||
totalTasks?: number;
|
||||
}>;
|
||||
retry?(taskId: string): Promise<void>;
|
||||
scaffold(
|
||||
options: ScaffolderScaffoldOptions,
|
||||
): Promise<ScaffolderScaffoldResponse>;
|
||||
// (undocumented)
|
||||
streamLogs(options: ScaffolderStreamLogsOptions): Observable<LogEvent>;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export const scaffolderApiRef: ApiRef<ScaffolderApi>;
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ScaffolderDryRunOptions {
|
||||
// (undocumented)
|
||||
directoryContents: {
|
||||
path: string;
|
||||
base64Content: string;
|
||||
}[];
|
||||
// (undocumented)
|
||||
secrets?: Record<string, string>;
|
||||
// (undocumented)
|
||||
template: JsonValue;
|
||||
// (undocumented)
|
||||
values: JsonObject;
|
||||
}
|
||||
|
||||
// @public (undocumented)
|
||||
export interface ScaffolderDryRunResponse {
|
||||
// (undocumented)
|
||||
directoryContents: Array<{
|
||||
path: string;
|
||||
base64Content: string;
|
||||
executable: boolean;
|
||||
}>;
|
||||
// (undocumented)
|
||||
log: Array<Pick<LogEvent, 'body'>>;
|
||||
// (undocumented)
|
||||
output: ScaffolderTaskOutput;
|
||||
// (undocumented)
|
||||
steps: TaskStep[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export const ScaffolderFieldExtensions: React.ComponentType<
|
||||
React.PropsWithChildren<{}>
|
||||
>;
|
||||
|
||||
// @public
|
||||
export interface ScaffolderGetIntegrationsListOptions {
|
||||
// (undocumented)
|
||||
allowedHosts: string[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ScaffolderGetIntegrationsListResponse {
|
||||
// (undocumented)
|
||||
integrations: {
|
||||
type: string;
|
||||
title: string;
|
||||
host: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
// @public
|
||||
export const ScaffolderLayouts: React_2.ComponentType<
|
||||
React_2.PropsWithChildren<{}>
|
||||
>;
|
||||
|
||||
// @public (undocumented)
|
||||
export type ScaffolderOutputLink = {
|
||||
title?: string;
|
||||
icon?: string;
|
||||
url?: string;
|
||||
entityRef?: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export type ScaffolderOutputText = {
|
||||
title?: string;
|
||||
icon?: string;
|
||||
content?: string;
|
||||
default?: boolean;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type ScaffolderRJSFField<
|
||||
T = any,
|
||||
S extends StrictRJSFSchema = RJSFSchema,
|
||||
F extends FormContextType = any,
|
||||
> = ComponentType<ScaffolderRJSFFieldProps<T, S, F>>;
|
||||
|
||||
// @public
|
||||
export interface ScaffolderRJSFFieldProps<
|
||||
T = any,
|
||||
S extends StrictRJSFSchema = RJSFSchema,
|
||||
F extends FormContextType = any,
|
||||
> extends GenericObjectType,
|
||||
Pick<
|
||||
HTMLAttributes<HTMLElement>,
|
||||
Exclude<
|
||||
keyof HTMLAttributes<HTMLElement>,
|
||||
'onBlur' | 'onFocus' | 'onChange'
|
||||
>
|
||||
> {
|
||||
autofocus?: boolean;
|
||||
disabled: boolean;
|
||||
errorSchema?: ErrorSchema<T>;
|
||||
formContext?: F;
|
||||
formData?: T;
|
||||
hideError?: boolean;
|
||||
idPrefix?: string;
|
||||
idSchema: IdSchema<T>;
|
||||
idSeparator?: string;
|
||||
name: string;
|
||||
onBlur: (id: string, value: any) => void;
|
||||
onChange: (
|
||||
newFormData: T | undefined,
|
||||
es?: ErrorSchema<T>,
|
||||
id?: string,
|
||||
) => any;
|
||||
onFocus: (id: string, value: any) => void;
|
||||
rawErrors: string[];
|
||||
readonly: boolean;
|
||||
registry: Registry<T, S, F>;
|
||||
required?: boolean;
|
||||
schema: S;
|
||||
uiSchema: UiSchema<T, S, F>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ScaffolderRJSFFormProps<
|
||||
T = any,
|
||||
S extends StrictRJSFSchema = RJSFSchema,
|
||||
F extends FormContextType = any,
|
||||
> {
|
||||
acceptcharset?: string;
|
||||
action?: string;
|
||||
autoComplete?: string;
|
||||
children?: ReactNode;
|
||||
className?: string;
|
||||
customValidate?: CustomValidator<T, S, F>;
|
||||
disabled?: boolean;
|
||||
enctype?: string;
|
||||
experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior;
|
||||
extraErrors?: ErrorSchema<T>;
|
||||
fields?: ScaffolderRJSFRegistryFieldsType<T, S, F>;
|
||||
focusOnFirstError?: boolean | ((error: RJSFValidationError) => void);
|
||||
formContext?: F;
|
||||
formData?: T;
|
||||
id?: string;
|
||||
idPrefix?: string;
|
||||
idSeparator?: string;
|
||||
_internalFormWrapper?: ElementType;
|
||||
liveOmit?: boolean;
|
||||
liveValidate?: boolean;
|
||||
method?: string;
|
||||
name?: string;
|
||||
noHtml5Validate?: boolean;
|
||||
// @deprecated
|
||||
noValidate?: boolean;
|
||||
omitExtraData?: boolean;
|
||||
onBlur?: (id: string, data: any) => void;
|
||||
onChange?: (data: IChangeEvent<T, S, F>, id?: string) => void;
|
||||
onError?: (errors: RJSFValidationError[]) => void;
|
||||
onFocus?: (id: string, data: any) => void;
|
||||
onSubmit?: (data: IChangeEvent<T, S, F>, event: FormEvent<any>) => void;
|
||||
readonly?: boolean;
|
||||
ref?: Ref<Form<T, S, F>>;
|
||||
schema: S;
|
||||
showErrorList?: false | 'top' | 'bottom';
|
||||
tagName?: ElementType;
|
||||
target?: string;
|
||||
templates?: Partial<Omit<TemplatesType<T, S, F>, 'ButtonTemplates'>> & {
|
||||
ButtonTemplates?: Partial<TemplatesType<T, S, F>['ButtonTemplates']>;
|
||||
};
|
||||
transformErrors?: ErrorTransformer<T, S, F>;
|
||||
translateString?: Registry['translateString'];
|
||||
uiSchema?: UiSchema<T, S, F>;
|
||||
validator: ValidatorType<T, S, F>;
|
||||
widgets?: RegistryWidgetsType<T, S, F>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ScaffolderRJSFRegistryFieldsType<
|
||||
T = any,
|
||||
S extends StrictRJSFSchema = RJSFSchema,
|
||||
F extends FormContextType = any,
|
||||
> = {
|
||||
[name: string]: ScaffolderRJSFField<T, S, F>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface ScaffolderScaffoldOptions {
|
||||
// (undocumented)
|
||||
secrets?: Record<string, string>;
|
||||
// (undocumented)
|
||||
templateRef: string;
|
||||
// (undocumented)
|
||||
values: Record<string, JsonValue>;
|
||||
}
|
||||
|
||||
// @public
|
||||
export interface ScaffolderScaffoldResponse {
|
||||
// (undocumented)
|
||||
taskId: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ScaffolderStep = {
|
||||
id: string;
|
||||
status: ScaffolderTaskStatus;
|
||||
endedAt?: string;
|
||||
startedAt?: string;
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface ScaffolderStreamLogsOptions {
|
||||
// (undocumented)
|
||||
after?: number;
|
||||
// (undocumented)
|
||||
isTaskRecoverable?: boolean;
|
||||
// (undocumented)
|
||||
taskId: string;
|
||||
}
|
||||
|
||||
// @public
|
||||
export type ScaffolderTask = {
|
||||
id: string;
|
||||
spec: TaskSpec;
|
||||
status: 'failed' | 'completed' | 'processing' | 'open' | 'cancelled';
|
||||
lastHeartbeatAt: string;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export type ScaffolderTaskOutput = {
|
||||
links?: ScaffolderOutputLink[];
|
||||
text?: ScaffolderOutputText[];
|
||||
} & {
|
||||
[key: string]: unknown;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type ScaffolderTaskStatus =
|
||||
| 'cancelled'
|
||||
| 'completed'
|
||||
| 'failed'
|
||||
| 'open'
|
||||
| 'processing'
|
||||
| 'skipped';
|
||||
|
||||
// @public
|
||||
export interface ScaffolderUseTemplateSecrets {
|
||||
// (undocumented)
|
||||
secrets: Record<string, string>;
|
||||
// (undocumented)
|
||||
setSecrets: (input: Record<string, string>) => void;
|
||||
}
|
||||
|
||||
// @public
|
||||
export const SecretsContextProvider: (
|
||||
props: PropsWithChildren<{
|
||||
initialSecrets?: Record<string, string>;
|
||||
}>,
|
||||
) => React_2.JSX.Element;
|
||||
|
||||
// @public
|
||||
export type TaskStream = {
|
||||
cancelled: boolean;
|
||||
loading: boolean;
|
||||
error?: Error;
|
||||
stepLogs: {
|
||||
[stepId in string]: string[];
|
||||
};
|
||||
completed: boolean;
|
||||
task?: ScaffolderTask;
|
||||
steps: {
|
||||
[stepId in string]: ScaffolderStep;
|
||||
};
|
||||
output?: ScaffolderTaskOutput;
|
||||
};
|
||||
|
||||
// @public (undocumented)
|
||||
export type TemplateGroupFilter = {
|
||||
title?: React.ReactNode;
|
||||
filter: (entity: TemplateEntityV1beta3) => boolean;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type TemplateParameterSchema = {
|
||||
title: string;
|
||||
description?: string;
|
||||
presentation?: TemplatePresentationV1beta3;
|
||||
steps: Array<{
|
||||
title: string;
|
||||
description?: string;
|
||||
schema: JsonObject;
|
||||
}>;
|
||||
EXPERIMENTAL_formDecorators?: {
|
||||
id: string;
|
||||
input?: JsonObject;
|
||||
}[];
|
||||
};
|
||||
|
||||
// @public
|
||||
export const useCustomFieldExtensions: <
|
||||
TComponentDataType = FieldExtensionOptions,
|
||||
>(
|
||||
outlet: React.ReactNode,
|
||||
) => TComponentDataType[];
|
||||
|
||||
// @public
|
||||
export const useCustomLayouts: <TComponentDataType = LayoutOptions<any>>(
|
||||
outlet: React.ReactNode,
|
||||
) => TComponentDataType[];
|
||||
|
||||
// @public
|
||||
export const useTaskEventStream: (taskId: string) => TaskStream;
|
||||
|
||||
// @public
|
||||
export const useTemplateSecrets: () => ScaffolderUseTemplateSecrets;
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
Reference in New Issue
Block a user