@@ -7,56 +7,50 @@
|
||||
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { ComponentType } from 'react';
|
||||
import { CustomValidator } from '@rjsf/utils';
|
||||
import { CustomFieldExtensionSchema } from '@backstage/plugin-scaffolder-react';
|
||||
import { CustomFieldValidator } from '@backstage/plugin-scaffolder-react';
|
||||
import { Dispatch } from 'react';
|
||||
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 { FieldExtensionComponent } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldProps } from '@rjsf/core';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import { FieldValidation as FieldValidation_2 } from '@rjsf/core';
|
||||
import { default as Form_2 } from '@rjsf/core-v5';
|
||||
import { FormContextType } from '@rjsf/utils';
|
||||
import { FormEvent } from 'react';
|
||||
import { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { GenericObjectType } from '@rjsf/utils';
|
||||
import { HTMLAttributes } from 'react';
|
||||
import { IChangeEvent } from '@rjsf/core-v5';
|
||||
import { IconComponent } from '@backstage/core-plugin-api';
|
||||
import { IdSchema } from '@rjsf/utils';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JSONSchema7 } from 'json-schema';
|
||||
import { JsonValue } from '@backstage/types';
|
||||
import { LayoutOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ReactElement } from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { Ref } from 'react';
|
||||
import { Registry } from '@rjsf/utils';
|
||||
import { RegistryWidgetsType } from '@rjsf/utils';
|
||||
import { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { RJSFSchema } from '@rjsf/utils';
|
||||
import { RJSFValidationError } from '@rjsf/utils';
|
||||
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 { StrictRJSFSchema } from '@rjsf/utils';
|
||||
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 { TemplatesType } from '@rjsf/utils';
|
||||
import { UiSchema } from '@rjsf/utils';
|
||||
import { ValidatorType } from '@rjsf/utils';
|
||||
|
||||
// @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;
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "FieldExtensionComponent" needs to be exported by the entry point alpha.d.ts
|
||||
//
|
||||
// @alpha
|
||||
export function createLegacyScaffolderFieldExtension<
|
||||
TReturnValue = unknown,
|
||||
@@ -79,13 +73,16 @@ export const extractSchemaFromStep: (inputStep: JsonObject) => {
|
||||
schema: JsonObject;
|
||||
};
|
||||
|
||||
// Warning: (ae-forgotten-export) The symbol "ScaffolderRJSFFormProps" needs to be exported by the entry point alpha.d.ts
|
||||
//
|
||||
// @alpha
|
||||
export const Form: (
|
||||
props: PropsWithChildren<ScaffolderRJSFFormProps>,
|
||||
) => React_2.JSX.Element;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type FormValidation = {
|
||||
[name: string]: FieldValidation | FormValidation;
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export type LegacyCustomFieldValidator<TFieldReturnValue> = (
|
||||
data: TFieldReturnValue,
|
||||
@@ -280,8 +277,6 @@ export interface TemplateGroupsProps {
|
||||
text: string;
|
||||
url: string;
|
||||
}[];
|
||||
// Warning: (ae-forgotten-export) The symbol "TemplateGroupFilter" needs to be exported by the entry point alpha.d.ts
|
||||
//
|
||||
// (undocumented)
|
||||
groups: TemplateGroupFilter[];
|
||||
// (undocumented)
|
||||
@@ -321,7 +316,7 @@ export type WorkflowProps = {
|
||||
namespace: string;
|
||||
templateName: string;
|
||||
components?: {
|
||||
ReviewStepComponent?: React_2.ComponentType<ReviewStepProps_2>;
|
||||
ReviewStepComponent?: React_2.ComponentType<ReviewStepProps>;
|
||||
};
|
||||
onError(error: Error | undefined): JSX.Element | null;
|
||||
} & Pick<
|
||||
@@ -334,10 +329,5 @@ export type WorkflowProps = {
|
||||
| 'layouts'
|
||||
>;
|
||||
|
||||
// Warnings were encountered during analysis:
|
||||
//
|
||||
// src/legacy/extensions/types.d.ts:23:5 - (ae-forgotten-export) The symbol "CustomFieldExtensionSchema" needs to be exported by the entry point alpha.d.ts
|
||||
// src/next/components/Workflow/Workflow.d.ts:13:9 - (ae-forgotten-export) The symbol "ReviewStepProps_2" needs to be exported by the entry point alpha.d.ts
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
} from './types';
|
||||
import { Extension, attachComponentData } from '@backstage/core-plugin-api';
|
||||
import { FIELD_EXTENSION_KEY } from '../../extensions/keys';
|
||||
import { FieldExtensionComponent } from '../../extensions';
|
||||
import { FieldExtensionComponent } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
/**
|
||||
* Method for creating field extensions that can be used in the scaffolder
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
import { ApiHolder } from '@backstage/core-plugin-api';
|
||||
import { FieldValidation, FieldProps } from '@rjsf/core';
|
||||
import { CustomFieldExtensionSchema } from '../../extensions/types';
|
||||
import { CustomFieldExtensionSchema } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
/**
|
||||
* Field validation type for Custom Field Extensions.
|
||||
|
||||
@@ -20,7 +20,7 @@ import { PropsWithChildren } from 'react';
|
||||
import { FieldTemplate } from './FieldTemplate';
|
||||
import { DescriptionFieldTemplate } from './DescriptionFieldTemplate';
|
||||
import { FieldProps } from '@rjsf/utils';
|
||||
import { ScaffolderRJSFFormProps } from '../../../extensions';
|
||||
import { ScaffolderRJSFFormProps } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
// TODO(blam): We require here, as the types in this package depend on @rjsf/core explicitly
|
||||
// which is what we're using here as the default types, it needs to depend on @rjsf/core-v5 because
|
||||
|
||||
@@ -22,12 +22,10 @@ import { createFieldValidation, extractSchemaFromStep } from '../../lib';
|
||||
import {
|
||||
CustomFieldValidator,
|
||||
FieldExtensionUiSchema,
|
||||
} from '../../../extensions';
|
||||
} from '@backstage/plugin-scaffolder-react';
|
||||
import { isObject } from './utils';
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
/** @alpha */
|
||||
export type FormValidation = {
|
||||
[name: string]: FieldValidation | FormValidation;
|
||||
};
|
||||
|
||||
@@ -14,4 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
export { Stepper, type StepperProps } from './Stepper';
|
||||
export { createAsyncValidators } from './createAsyncValidators';
|
||||
export {
|
||||
createAsyncValidators,
|
||||
type FormValidation,
|
||||
} from './createAsyncValidators';
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import { Progress, Link } from '@backstage/core-components';
|
||||
import { Typography } from '@material-ui/core';
|
||||
import { errorApiRef, IconComponent, useApi } from '@backstage/core-plugin-api';
|
||||
import { TemplateGroupFilter } from '../../../components';
|
||||
import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateGroup } from '../TemplateGroup/TemplateGroup';
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,7 +27,7 @@ import { errorApiRef, useApi } from '@backstage/core-plugin-api';
|
||||
import { useTemplateParameterSchema } from '../../hooks/useTemplateParameterSchema';
|
||||
import { Stepper, type StepperProps } from '../Stepper/Stepper';
|
||||
import { SecretsContextProvider } from '../../../secrets/SecretsContext';
|
||||
import { ReviewStepProps } from '../../../components';
|
||||
import { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
const useStyles = makeStyles<BackstageTheme>(() => ({
|
||||
markdown: {
|
||||
|
||||
@@ -5,50 +5,58 @@
|
||||
```ts
|
||||
/// <reference types="react" />
|
||||
|
||||
import { FormProps as FormProps_2 } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import type { FormProps as FormProps_3 } from '@rjsf/core-v5';
|
||||
import { ComponentType } from 'react';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { FieldExtensionOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import type { FormProps as FormProps_2 } from '@rjsf/core-v5';
|
||||
import { FormProps as FormProps_3 } from '@backstage/plugin-scaffolder-react';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { LayoutOptions } from '@backstage/plugin-scaffolder-react';
|
||||
import { NextFieldExtensionOptions } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ScaffolderTaskOutput } from '@backstage/plugin-scaffolder-react';
|
||||
import { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react/alpha';
|
||||
import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react';
|
||||
|
||||
// @alpha @deprecated
|
||||
export type FormProps = Pick<
|
||||
FormProps_3,
|
||||
FormProps_2,
|
||||
'transformErrors' | 'noHtml5Validate'
|
||||
>;
|
||||
|
||||
// @alpha
|
||||
export type NextRouterProps = {
|
||||
export const LegacyRouter: (props: LegacyRouterProps) => React_2.JSX.Element;
|
||||
|
||||
// @alpha
|
||||
export type LegacyRouterProps = {
|
||||
components?: {
|
||||
TemplateCardComponent?: React_2.ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
}>;
|
||||
TaskPageComponent?: React_2.ComponentType<PropsWithChildren<{}>>;
|
||||
TemplateOutputsComponent?: React_2.ComponentType<{
|
||||
output?: ScaffolderTaskOutput;
|
||||
}>;
|
||||
TemplateListPageComponent?: React_2.ComponentType<TemplateListPageProps>;
|
||||
TemplateWizardPageComponent?: React_2.ComponentType<TemplateWizardPageProps>;
|
||||
ReviewStepComponent?: ComponentType<ReviewStepProps>;
|
||||
TemplateCardComponent?:
|
||||
| ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
}>
|
||||
| undefined;
|
||||
TaskPageComponent?: ComponentType<PropsWithChildren<{}>>;
|
||||
};
|
||||
groups?: TemplateGroupFilter[];
|
||||
groups?: Array<{
|
||||
title?: React_2.ReactNode;
|
||||
filter: (entity: Entity) => boolean;
|
||||
}>;
|
||||
templateFilter?: (entity: TemplateEntityV1beta3) => boolean;
|
||||
FormProps?: FormProps_2;
|
||||
defaultPreviewTemplate?: string;
|
||||
headerOptions?: {
|
||||
pageTitleOverride?: string;
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
};
|
||||
contextMenu?: {
|
||||
editor?: boolean;
|
||||
actions?: boolean;
|
||||
tasks?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
// @alpha
|
||||
export const NextScaffolderPage: (
|
||||
props: PropsWithChildren<NextRouterProps>,
|
||||
) => JSX_2.Element;
|
||||
export const LegacyScaffolderPage: (props: LegacyRouterProps) => JSX_2.Element;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type TemplateListPageProps = {
|
||||
@@ -66,9 +74,12 @@ export type TemplateListPageProps = {
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type TemplateWizardPageProps = {
|
||||
customFieldExtensions: NextFieldExtensionOptions<any, any>[];
|
||||
customFieldExtensions: FieldExtensionOptions<any, any>[];
|
||||
components?: {
|
||||
ReviewStepComponent?: React_2.ComponentType<ReviewStepProps>;
|
||||
};
|
||||
layouts?: LayoutOptions[];
|
||||
FormProps?: FormProps_2;
|
||||
formProps?: FormProps_3;
|
||||
};
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
|
||||
@@ -14,15 +14,14 @@ import { createScaffolderLayout as createScaffolderLayout_2 } from '@backstage/p
|
||||
import { CustomFieldExtensionSchema as CustomFieldExtensionSchema_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { CustomFieldValidator as CustomFieldValidator_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { DiscoveryApi } from '@backstage/core-plugin-api';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { ExternalRouteRef } from '@backstage/core-plugin-api';
|
||||
import { FetchApi } from '@backstage/core-plugin-api';
|
||||
import { FieldExtensionComponent as FieldExtensionComponent_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldExtensionComponentProps as FieldExtensionComponentProps_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldExtensionOptions as FieldExtensionOptions_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { FieldValidation } from '@rjsf/core';
|
||||
import { FieldValidation } from '@rjsf/utils';
|
||||
import { FormProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { IdentityApi } from '@backstage/core-plugin-api';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JSX as JSX_2 } from 'react';
|
||||
import { LayoutOptions as LayoutOptions_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { LayoutTemplate as LayoutTemplate_2 } from '@backstage/plugin-scaffolder-react';
|
||||
@@ -33,6 +32,7 @@ import { PathParams } from '@backstage/core-plugin-api';
|
||||
import { PropsWithChildren } from 'react';
|
||||
import { default as React_2 } from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
import { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
||||
import { RouteRef } from '@backstage/core-plugin-api';
|
||||
import { ScaffolderApi as ScaffolderApi_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { ScaffolderDryRunOptions as ScaffolderDryRunOptions_2 } from '@backstage/plugin-scaffolder-react';
|
||||
@@ -50,8 +50,10 @@ import { ScaffolderUseTemplateSecrets as ScaffolderUseTemplateSecrets_2 } from '
|
||||
import { ScmIntegrationRegistry } from '@backstage/integration';
|
||||
import { SubRouteRef } from '@backstage/core-plugin-api';
|
||||
import { TemplateEntityV1beta3 } from '@backstage/plugin-scaffolder-common';
|
||||
import { TemplateGroupFilter } from '@backstage/plugin-scaffolder-react';
|
||||
import { TemplateListPageProps } from '@backstage/plugin-scaffolder/alpha';
|
||||
import { TemplateParameterSchema as TemplateParameterSchema_2 } from '@backstage/plugin-scaffolder-react';
|
||||
import { UiSchema } from '@rjsf/utils';
|
||||
import { TemplateWizardPageProps } from '@backstage/plugin-scaffolder/alpha';
|
||||
import { z } from 'zod';
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
@@ -419,19 +421,7 @@ export const RepoUrlPickerFieldSchema: FieldSchema<
|
||||
export type RepoUrlPickerUiOptions =
|
||||
typeof RepoUrlPickerFieldSchema.uiOptionsType;
|
||||
|
||||
// @public
|
||||
export type ReviewStepProps = {
|
||||
disableButtons: boolean;
|
||||
formData: JsonObject;
|
||||
handleBack: () => void;
|
||||
handleReset: () => void;
|
||||
handleCreate: () => void;
|
||||
steps: {
|
||||
uiSchema: UiSchema;
|
||||
mergedSchema: JsonObject;
|
||||
schema: JsonObject;
|
||||
}[];
|
||||
};
|
||||
export { ReviewStepProps };
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export const rootRouteRef: RouteRef<undefined>;
|
||||
@@ -439,28 +429,30 @@ export const rootRouteRef: RouteRef<undefined>;
|
||||
// @public
|
||||
export type RouterProps = {
|
||||
components?: {
|
||||
ReviewStepComponent?: ComponentType<ReviewStepProps>;
|
||||
TemplateCardComponent?:
|
||||
| ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
}>
|
||||
| undefined;
|
||||
TaskPageComponent?: ComponentType<PropsWithChildren<{}>>;
|
||||
ReviewStepComponent?: React_2.ComponentType<ReviewStepProps>;
|
||||
TemplateCardComponent?: React_2.ComponentType<{
|
||||
template: TemplateEntityV1beta3;
|
||||
}>;
|
||||
TaskPageComponent?: React_2.ComponentType<PropsWithChildren<{}>>;
|
||||
EXPERIMENTAL_TemplateOutputsComponent?: React_2.ComponentType<{
|
||||
output?: ScaffolderTaskOutput_2;
|
||||
}>;
|
||||
EXPERIMENTAL_TemplateListPageComponent?: React_2.ComponentType<TemplateListPageProps>;
|
||||
EXPERIMENTAL_TemplateWizardPageComponent?: React_2.ComponentType<TemplateWizardPageProps>;
|
||||
};
|
||||
groups?: Array<{
|
||||
title?: React_2.ReactNode;
|
||||
filter: (entity: Entity) => boolean;
|
||||
}>;
|
||||
groups?: TemplateGroupFilter[];
|
||||
templateFilter?: (entity: TemplateEntityV1beta3) => boolean;
|
||||
defaultPreviewTemplate?: string;
|
||||
headerOptions?: {
|
||||
pageTitleOverride?: string;
|
||||
title?: string;
|
||||
subtitle?: string;
|
||||
};
|
||||
defaultPreviewTemplate?: string;
|
||||
formProps?: FormProps;
|
||||
contextMenu?: {
|
||||
editor?: boolean;
|
||||
actions?: boolean;
|
||||
tasks?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -537,7 +529,9 @@ export const ScaffolderLayouts: ComponentType<{
|
||||
export type ScaffolderOutputlink = ScaffolderOutputLink;
|
||||
|
||||
// @public
|
||||
export const ScaffolderPage: (props: RouterProps) => JSX_2.Element;
|
||||
export const ScaffolderPage: (
|
||||
props: PropsWithChildren<RouterProps>,
|
||||
) => JSX_2.Element;
|
||||
|
||||
// @public
|
||||
export const scaffolderPlugin: BackstagePlugin<
|
||||
@@ -585,10 +579,14 @@ export type ScaffolderTaskStatus = ScaffolderTaskStatus_2;
|
||||
// @public @deprecated (undocumented)
|
||||
export type ScaffolderUseTemplateSecrets = ScaffolderUseTemplateSecrets_2;
|
||||
|
||||
// @public
|
||||
export const TaskPage: (props: TaskPageProps) => React_2.JSX.Element;
|
||||
// @public (undocumented)
|
||||
export const TaskPage: (props: {
|
||||
TemplateOutputsComponent?: React_2.ComponentType<{
|
||||
output?: ScaffolderTaskOutput_2;
|
||||
}>;
|
||||
}) => React_2.JSX.Element;
|
||||
|
||||
// @public
|
||||
// @public @deprecated
|
||||
export type TaskPageProps = {
|
||||
loadingText?: string;
|
||||
};
|
||||
|
||||
@@ -51,6 +51,9 @@ const useStyles = makeStyles(theme => ({
|
||||
},
|
||||
}));
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export const OngoingTask = (props: {
|
||||
TemplateOutputsComponent?: React.ComponentType<{
|
||||
output?: ScaffolderTaskOutput;
|
||||
|
||||
@@ -45,11 +45,10 @@ import { ActionsPage } from '../../components/ActionsPage';
|
||||
import { ListTasksPage } from '../../components/ListTasksPage';
|
||||
|
||||
import {
|
||||
TemplateListPage,
|
||||
TemplateListPageProps,
|
||||
TemplateWizardPage,
|
||||
TemplateWizardPageProps,
|
||||
} from '../../next';
|
||||
} from '@backstage/plugin-scaffolder/alpha';
|
||||
import { TemplateListPage, TemplateWizardPage } from '../../next';
|
||||
import { OngoingTask } from '../OngoingTask';
|
||||
import { TemplateEditorPage } from '../../next/TemplateEditorPage';
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ const hasLinks = ({ links = [] }: ScaffolderTaskOutput): boolean =>
|
||||
/**
|
||||
* TaskPageProps for constructing a TaskPage
|
||||
* @param loadingText - Optional loading text shown before a task begins executing.
|
||||
*
|
||||
* @public
|
||||
* @deprecated - this is a useless type that is no longer used.
|
||||
*/
|
||||
export type TaskPageProps = {
|
||||
|
||||
Reference in New Issue
Block a user