@backstage/plugin-scaffolder 1.25.1 → 1.26.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -5
- package/alpha/package.json +1 -1
- package/dist/alpha/api/FormFieldsApi.esm.js +40 -0
- package/dist/alpha/api/FormFieldsApi.esm.js.map +1 -0
- package/dist/alpha/api/ref.esm.js +8 -0
- package/dist/alpha/api/ref.esm.js.map +1 -0
- package/dist/alpha/api.esm.js +27 -0
- package/dist/alpha/api.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/CustomFieldExplorer.esm.js +1 -1
- package/dist/alpha/components/TemplateEditorPage/CustomFieldExplorer.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js +167 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldPlaygroud.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js +33 -0
- package/dist/alpha/components/TemplateEditorPage/CustomFieldsPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DirectoryEditorContext.esm.js +4 -7
- package/dist/alpha/components/TemplateEditorPage/DirectoryEditorContext.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunContext.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResults.esm.js +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js +2 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js +2 -2
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js +1 -1
- package/dist/alpha/components/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js +94 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditor.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateEditorBrowser.esm.js +36 -38
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateEditorForm.esm.js +12 -20
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorForm.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js +146 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorIntro.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js +53 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateEditorTextArea.esm.js +36 -3
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js +98 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateEditorToolbar.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js +43 -0
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateEditorPage/TemplateFormPreviewer.esm.js +77 -39
- package/dist/alpha/components/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +1 -0
- package/dist/alpha/components/TemplateEditorPage/TemplatePage.esm.js +52 -0
- package/dist/alpha/components/TemplateEditorPage/TemplatePage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateListPage/RegisterExistingButton.esm.js +1 -1
- package/dist/alpha/components/TemplateListPage/RegisterExistingButton.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateListPage/TemplateListPage.esm.js +2 -2
- package/dist/alpha/components/TemplateListPage/TemplateListPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateWizardPage/TemplateWizardPage.esm.js +2 -2
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPage.esm.js.map +1 -0
- package/dist/{next → alpha/components}/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js +1 -1
- package/dist/alpha/components/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +1 -0
- package/dist/alpha/extensions.esm.js +30 -0
- package/dist/alpha/extensions.esm.js.map +1 -0
- package/dist/alpha/fields/RepoUrlPicker.esm.js +37 -0
- package/dist/alpha/fields/RepoUrlPicker.esm.js.map +1 -0
- package/dist/alpha/plugin.esm.js +32 -0
- package/dist/alpha/plugin.esm.js.map +1 -0
- package/dist/alpha.d.ts +80 -9
- package/dist/alpha.esm.js +1 -60
- package/dist/alpha.esm.js.map +1 -1
- package/dist/api.esm.js +19 -5
- package/dist/api.esm.js.map +1 -1
- package/dist/components/ActionsPage/ActionsPage.esm.js +30 -5
- package/dist/components/ActionsPage/ActionsPage.esm.js.map +1 -1
- package/dist/components/FileBrowser/FileBrowser.esm.js +4 -3
- package/dist/components/FileBrowser/FileBrowser.esm.js.map +1 -1
- package/dist/components/ListTasksPage/ListTasksPage.esm.js +17 -3
- package/dist/components/ListTasksPage/ListTasksPage.esm.js.map +1 -1
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js +2 -2
- package/dist/components/ListTasksPage/OwnerListPicker.esm.js.map +1 -1
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js +10 -5
- package/dist/components/ListTasksPage/columns/CreatedAtColumn.esm.js.map +1 -1
- package/dist/components/OngoingTask/ContextMenu.esm.js +15 -2
- package/dist/components/OngoingTask/ContextMenu.esm.js.map +1 -1
- package/dist/components/OngoingTask/OngoingTask.esm.js +24 -1
- package/dist/components/OngoingTask/OngoingTask.esm.js.map +1 -1
- package/dist/components/Router/Router.esm.js +35 -7
- package/dist/components/Router/Router.esm.js.map +1 -1
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js +1 -1
- package/dist/components/fields/EntityPicker/EntityPicker.esm.js.map +1 -1
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js +1 -0
- package/dist/components/fields/MultiEntityPicker/MultiEntityPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/RepoUrlPicker.esm.js.map +1 -1
- package/dist/components/fields/RepoUrlPicker/schema.esm.js +5 -6
- package/dist/components/fields/RepoUrlPicker/schema.esm.js.map +1 -1
- package/dist/components/fields/utils.esm.js +2 -1
- package/dist/components/fields/utils.esm.js.map +1 -1
- package/dist/index.d.ts +13 -8
- package/dist/lib/filesystem/WebFileSystemAccess.esm.js +34 -1
- package/dist/lib/filesystem/WebFileSystemAccess.esm.js.map +1 -1
- package/dist/lib/filesystem/createExampleTemplate.esm.js +76 -0
- package/dist/lib/filesystem/createExampleTemplate.esm.js.map +1 -0
- package/dist/packages/opaque-internal/src/OpaqueType.esm.js +103 -0
- package/dist/packages/opaque-internal/src/OpaqueType.esm.js.map +1 -0
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormField.esm.js +6 -0
- package/dist/packages/scaffolder-internal/src/wiring/InternalFormField.esm.js.map +1 -0
- package/dist/plugin.esm.js +5 -2
- package/dist/plugin.esm.js.map +1 -1
- package/dist/routes.esm.js +16 -1
- package/dist/routes.esm.js.map +1 -1
- package/dist/translation.esm.js +22 -3
- package/dist/translation.esm.js.map +1 -1
- package/package.json +34 -23
- package/dist/next/TemplateEditorPage/CustomFieldExplorer.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DirectoryEditorContext.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunContext.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResults.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsList.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/DryRunResultsView.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/IconLink.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/DryRunResults/TaskStatusStepper.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditor.esm.js +0 -56
- package/dist/next/TemplateEditorPage/TemplateEditor.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorBrowser.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorForm.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js +0 -91
- package/dist/next/TemplateEditorPage/TemplateEditorIntro.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js +0 -87
- package/dist/next/TemplateEditorPage/TemplateEditorPage.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateEditorTextArea.esm.js.map +0 -1
- package/dist/next/TemplateEditorPage/TemplateFormPreviewer.esm.js.map +0 -1
- package/dist/next/TemplateListPage/RegisterExistingButton.esm.js.map +0 -1
- package/dist/next/TemplateListPage/TemplateListPage.esm.js.map +0 -1
- package/dist/next/TemplateWizardPage/TemplateWizardPage.esm.js.map +0 -1
- package/dist/next/TemplateWizardPage/TemplateWizardPageContextMenu.esm.js.map +0 -1
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunContext.esm.js +0 -0
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/DryRunResultsSplitView.esm.js +0 -0
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/IconLink.esm.js +0 -0
- /package/dist/{next → alpha/components}/TemplateEditorPage/DryRunResults/TaskPageLinks.esm.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/schema.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {
|
|
1
|
+
{"version":3,"file":"schema.esm.js","sources":["../../../../src/components/fields/RepoUrlPicker/schema.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { makeFieldSchema } from '@backstage/plugin-scaffolder-react';\n\n/**\n * @public\n */\nexport const RepoUrlPickerFieldSchema = makeFieldSchema({\n output: z => z.string(),\n uiOptions: z =>\n z.object({\n allowedHosts: z\n .array(z.string())\n .optional()\n .describe('List of allowed SCM platform hosts'),\n allowedOrganizations: z\n .array(z.string())\n .optional()\n .describe('List of allowed organizations in the given SCM platform'),\n allowedOwners: z\n .array(z.string())\n .optional()\n .describe('List of allowed owners in the given SCM platform'),\n allowedProjects: z\n .array(z.string())\n .optional()\n .describe('List of allowed projects in the given SCM platform'),\n allowedRepos: z\n .array(z.string())\n .optional()\n .describe('List of allowed repos in the given SCM platform'),\n requestUserCredentials: z\n .object({\n secretsKey: z\n .string()\n .describe(\n 'Key used within the template secrets context to store the credential',\n ),\n additionalScopes: z\n .object({\n gitea: z\n .array(z.string())\n .optional()\n .describe('Additional Gitea scopes to request'),\n gerrit: z\n .array(z.string())\n .optional()\n .describe('Additional Gerrit scopes to request'),\n github: z\n .array(z.string())\n .optional()\n .describe('Additional GitHub scopes to request'),\n gitlab: z\n .array(z.string())\n .optional()\n .describe('Additional GitLab scopes to request'),\n bitbucket: z\n .array(z.string())\n .optional()\n .describe('Additional BitBucket scopes to request'),\n azure: z\n .array(z.string())\n .optional()\n .describe('Additional Azure scopes to request'),\n })\n .optional()\n .describe('Additional permission scopes to request'),\n })\n .optional()\n .describe(\n 'If defined will request user credentials to auth against the given SCM platform',\n ),\n }),\n});\n\n/**\n * The input props that can be specified under `ui:options` for the\n * `RepoUrlPicker` field extension.\n *\n * @public\n * @deprecated this will be removed as it's no longer used\n */\nexport type RepoUrlPickerUiOptions =\n typeof RepoUrlPickerFieldSchema.uiOptionsType;\n\nexport type RepoUrlPickerProps = typeof RepoUrlPickerFieldSchema.type;\n\n// This has been duplicated to /plugins/scaffolder/src/components/fields/RepoBranchPicker/schema.ts\n// NOTE: There is a bug with this failing validation in the custom field explorer due\n// to https://github.com/rjsf-team/react-jsonschema-form/issues/675 even if\n// requestUserCredentials is not defined\nexport const RepoUrlPickerSchema = RepoUrlPickerFieldSchema.schema;\n"],"names":[],"mappings":";;AAqBO,MAAM,2BAA2B,eAAgB,CAAA;AAAA,EACtD,MAAA,EAAQ,CAAK,CAAA,KAAA,CAAA,CAAE,MAAO,EAAA;AAAA,EACtB,SAAA,EAAW,CACT,CAAA,KAAA,CAAA,CAAE,MAAO,CAAA;AAAA,IACP,YAAA,EAAc,CACX,CAAA,KAAA,CAA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CAChB,CAAA,QAAA,EACA,CAAA,QAAA,CAAS,qCAAqC,CAAA;AAAA,QACjD,SAAA,EAAW,CACR,CAAA,KAAA,CAAM,CAAE,CAAA,MAAA,EAAQ,CAChB,CAAA,QAAA,EACA,CAAA,QAAA,CAAS,wCAAwC,CAAA;AAAA,QACpD,KAAA,EAAO,CACJ,CAAA,KAAA,CAAM,CAAE,CAAA,MAAA,EAAQ,CAChB,CAAA,QAAA,EACA,CAAA,QAAA,CAAS,oCAAoC,CAAA;AAAA,OACjD,CAAA,CACA,QAAS,EAAA,CACT,SAAS,yCAAyC,CAAA;AAAA,KACtD,CACA,CAAA,QAAA,EACA,CAAA,QAAA;AAAA,MACC,iFAAA;AAAA,KACF;AAAA,GACH,CAAA;AACL,CAAC,EAAA;AAkBM,MAAM,sBAAsB,wBAAyB,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.esm.js","sources":["../../../src/components/fields/utils.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport {
|
|
1
|
+
{"version":3,"file":"utils.esm.js","sources":["../../../src/components/fields/utils.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { FieldSchema as FieldSchemaType } from '@backstage/plugin-scaffolder-react';\n\n/**\n * @public\n * @deprecated - import from {@link @backstage/plugin-scaffolder-react#FieldSchema} instead\n */\nexport interface FieldSchema<T, P> extends FieldSchemaType<T, P> {}\n\n/**\n * @public\n * @deprecated use `makeFieldSchema` instead\n * Utility function to convert zod return and UI options schemas to a\n * CustomFieldExtensionSchema with FieldExtensionComponentProps type inference\n */\n\nexport function makeFieldSchemaFromZod<\n TReturnSchema extends z.ZodType,\n TUiOptionsSchema extends z.ZodType = z.ZodType<any, any, {}>,\n>(\n returnSchema: TReturnSchema,\n uiOptionsSchema?: TUiOptionsSchema,\n): FieldSchema<\n TReturnSchema extends z.ZodType<any, any, infer IReturn> ? IReturn : never,\n TUiOptionsSchema extends z.ZodType<any, any, infer IUiOptions>\n ? IUiOptions\n : never\n> {\n return {\n schema: {\n returnValue: zodToJsonSchema(returnSchema) as JSONSchema7,\n uiOptions: uiOptionsSchema\n ? (zodToJsonSchema(uiOptionsSchema) as JSONSchema7)\n : undefined,\n },\n type: null as any,\n uiOptionsType: null as any,\n TProps: undefined as any,\n };\n}\n"],"names":[],"mappings":";;AAiCgB,SAAA,sBAAA,CAId,cACA,eAMA,EAAA;AACA,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,WAAA,EAAa,gBAAgB,YAAY,CAAA;AAAA,MACzC,SAAW,EAAA,eAAA,GACN,eAAgB,CAAA,eAAe,CAChC,GAAA,KAAA,CAAA;AAAA,KACN;AAAA,IACA,IAAM,EAAA,IAAA;AAAA,IACN,aAAe,EAAA,IAAA;AAAA,IACf,MAAQ,EAAA,KAAA,CAAA;AAAA,GACV,CAAA;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { DiscoveryApi, FetchApi, IdentityApi, ApiHolder } from '@backstage/core-
|
|
|
4
4
|
import { ScmIntegrationRegistry } from '@backstage/integration';
|
|
5
5
|
import { Observable } from '@backstage/types';
|
|
6
6
|
import * as _backstage_plugin_scaffolder_react from '@backstage/plugin-scaffolder-react';
|
|
7
|
-
import { ScaffolderApi as ScaffolderApi$1, ScaffolderTask as ScaffolderTask$1, ScaffolderGetIntegrationsListOptions as ScaffolderGetIntegrationsListOptions$1, ScaffolderGetIntegrationsListResponse as ScaffolderGetIntegrationsListResponse$1, TemplateParameterSchema as TemplateParameterSchema$1, ScaffolderScaffoldOptions as ScaffolderScaffoldOptions$1, ScaffolderScaffoldResponse as ScaffolderScaffoldResponse$1, ScaffolderStreamLogsOptions as ScaffolderStreamLogsOptions$1, LogEvent as LogEvent$1, ScaffolderDryRunOptions as ScaffolderDryRunOptions$1, ScaffolderDryRunResponse as ScaffolderDryRunResponse$1, ListActionsResponse as ListActionsResponse$1, ReviewStepProps, ScaffolderTaskOutput as ScaffolderTaskOutput$1, TemplateGroupFilter, FormProps,
|
|
7
|
+
import { ScaffolderApi as ScaffolderApi$1, ScaffolderTask as ScaffolderTask$1, ScaffolderGetIntegrationsListOptions as ScaffolderGetIntegrationsListOptions$1, ScaffolderGetIntegrationsListResponse as ScaffolderGetIntegrationsListResponse$1, TemplateParameterSchema as TemplateParameterSchema$1, ScaffolderScaffoldOptions as ScaffolderScaffoldOptions$1, ScaffolderScaffoldResponse as ScaffolderScaffoldResponse$1, ScaffolderStreamLogsOptions as ScaffolderStreamLogsOptions$1, LogEvent as LogEvent$1, ScaffolderDryRunOptions as ScaffolderDryRunOptions$1, ScaffolderDryRunResponse as ScaffolderDryRunResponse$1, ListActionsResponse as ListActionsResponse$1, ReviewStepProps, ScaffolderTaskOutput as ScaffolderTaskOutput$1, TemplateGroupFilter, FormProps, FieldSchema as FieldSchema$1, createScaffolderFieldExtension as createScaffolderFieldExtension$1, ScaffolderUseTemplateSecrets as ScaffolderUseTemplateSecrets$1, CustomFieldExtensionSchema as CustomFieldExtensionSchema$1, CustomFieldValidator as CustomFieldValidator$1, FieldExtensionOptions as FieldExtensionOptions$1, FieldExtensionComponentProps as FieldExtensionComponentProps$1, FieldExtensionComponent as FieldExtensionComponent$1, ScaffolderOutputLink, ScaffolderTaskStatus as ScaffolderTaskStatus$1, createScaffolderLayout as createScaffolderLayout$1, LayoutTemplate as LayoutTemplate$1, LayoutOptions as LayoutOptions$1 } from '@backstage/plugin-scaffolder-react';
|
|
8
8
|
export { ReviewStepProps } from '@backstage/plugin-scaffolder-react';
|
|
9
9
|
import * as React from 'react';
|
|
10
10
|
import React__default, { PropsWithChildren } from 'react';
|
|
@@ -33,8 +33,11 @@ declare class ScaffolderClient implements ScaffolderApi$1 {
|
|
|
33
33
|
});
|
|
34
34
|
listTasks(options: {
|
|
35
35
|
filterByOwnership: 'owned' | 'all';
|
|
36
|
+
limit?: number;
|
|
37
|
+
offset?: number;
|
|
36
38
|
}): Promise<{
|
|
37
39
|
tasks: ScaffolderTask$1[];
|
|
40
|
+
totalTasks?: number;
|
|
38
41
|
}>;
|
|
39
42
|
getIntegrationsList(options: ScaffolderGetIntegrationsListOptions$1): Promise<ScaffolderGetIntegrationsListResponse$1>;
|
|
40
43
|
getTemplateParameterSchema(templateRef: string): Promise<TemplateParameterSchema$1>;
|
|
@@ -46,6 +49,7 @@ declare class ScaffolderClient implements ScaffolderApi$1 {
|
|
|
46
49
|
private streamLogsPolling;
|
|
47
50
|
listActions(): Promise<ListActionsResponse$1>;
|
|
48
51
|
cancelTask(taskId: string): Promise<void>;
|
|
52
|
+
retry?(taskId: string): Promise<void>;
|
|
49
53
|
autocomplete({ token, resource, provider, context, }: {
|
|
50
54
|
token: string;
|
|
51
55
|
provider: string;
|
|
@@ -106,6 +110,9 @@ declare const scaffolderPlugin: _backstage_core_plugin_api.BackstagePlugin<{
|
|
|
106
110
|
actions: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
107
111
|
listTasks: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
108
112
|
edit: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
113
|
+
editor: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
114
|
+
customFields: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
115
|
+
templateForm: _backstage_core_plugin_api.SubRouteRef<undefined>;
|
|
109
116
|
}, {
|
|
110
117
|
registerComponent: _backstage_core_plugin_api.ExternalRouteRef<undefined, true>;
|
|
111
118
|
viewTechDoc: _backstage_core_plugin_api.ExternalRouteRef<{
|
|
@@ -251,16 +258,13 @@ declare const RepoBranchPickerFieldExtension: _backstage_plugin_scaffolder_react
|
|
|
251
258
|
|
|
252
259
|
/**
|
|
253
260
|
* @public
|
|
254
|
-
*
|
|
255
|
-
* matching FieldExtensionComponentProps type for a field extension.
|
|
261
|
+
* @deprecated - import from {@link @backstage/plugin-scaffolder-react#FieldSchema} instead
|
|
256
262
|
*/
|
|
257
|
-
interface FieldSchema<
|
|
258
|
-
readonly schema: CustomFieldExtensionSchema$1;
|
|
259
|
-
readonly type: FieldExtensionComponentProps$1<TReturn, TUiOptions>;
|
|
260
|
-
readonly uiOptionsType: TUiOptions;
|
|
263
|
+
interface FieldSchema<T, P> extends FieldSchema$1<T, P> {
|
|
261
264
|
}
|
|
262
265
|
/**
|
|
263
266
|
* @public
|
|
267
|
+
* @deprecated use `makeFieldSchema` instead
|
|
264
268
|
* Utility function to convert zod return and UI options schemas to a
|
|
265
269
|
* CustomFieldExtensionSchema with FieldExtensionComponentProps type inference
|
|
266
270
|
*/
|
|
@@ -312,7 +316,7 @@ type OwnerPickerUiOptions = typeof OwnerPickerFieldSchema.uiOptionsType;
|
|
|
312
316
|
/**
|
|
313
317
|
* @public
|
|
314
318
|
*/
|
|
315
|
-
declare const RepoUrlPickerFieldSchema: FieldSchema<string, {
|
|
319
|
+
declare const RepoUrlPickerFieldSchema: _backstage_plugin_scaffolder_react.FieldSchema<string, {
|
|
316
320
|
allowedHosts?: string[] | undefined;
|
|
317
321
|
allowedOrganizations?: string[] | undefined;
|
|
318
322
|
allowedOwners?: string[] | undefined;
|
|
@@ -335,6 +339,7 @@ declare const RepoUrlPickerFieldSchema: FieldSchema<string, {
|
|
|
335
339
|
* `RepoUrlPicker` field extension.
|
|
336
340
|
*
|
|
337
341
|
* @public
|
|
342
|
+
* @deprecated this will be removed as it's no longer used
|
|
338
343
|
*/
|
|
339
344
|
type RepoUrlPickerUiOptions = typeof RepoUrlPickerFieldSchema.uiOptionsType;
|
|
340
345
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { get, set } from 'idb-keyval';
|
|
2
|
+
|
|
1
3
|
const showDirectoryPicker = window.showDirectoryPicker;
|
|
2
4
|
class WebFileAccess {
|
|
3
5
|
constructor(path, handle) {
|
|
@@ -36,11 +38,32 @@ class WebDirectoryAccess {
|
|
|
36
38
|
}
|
|
37
39
|
}
|
|
38
40
|
}
|
|
41
|
+
async createFile(options) {
|
|
42
|
+
const { name, data } = options;
|
|
43
|
+
let file;
|
|
44
|
+
if (name.includes("/")) {
|
|
45
|
+
const [dir, path] = name.split("/");
|
|
46
|
+
const handle = await this.handle.getDirectoryHandle(dir, {
|
|
47
|
+
create: true
|
|
48
|
+
});
|
|
49
|
+
file = await handle.getFileHandle(path, { create: true });
|
|
50
|
+
} else {
|
|
51
|
+
file = await this.handle.getFileHandle(name, {
|
|
52
|
+
create: true
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const writable = await file.createWritable();
|
|
56
|
+
await writable.write(data);
|
|
57
|
+
await writable.close();
|
|
58
|
+
}
|
|
39
59
|
}
|
|
40
60
|
class WebFileSystemAccess {
|
|
41
61
|
static isSupported() {
|
|
42
62
|
return Boolean(showDirectoryPicker);
|
|
43
63
|
}
|
|
64
|
+
static fromHandle(handle) {
|
|
65
|
+
return new WebDirectoryAccess(handle);
|
|
66
|
+
}
|
|
44
67
|
static async requestDirectoryAccess() {
|
|
45
68
|
if (!showDirectoryPicker) {
|
|
46
69
|
throw new Error("File system access is not supported");
|
|
@@ -51,6 +74,16 @@ class WebFileSystemAccess {
|
|
|
51
74
|
constructor() {
|
|
52
75
|
}
|
|
53
76
|
}
|
|
77
|
+
class WebFileSystemStore {
|
|
78
|
+
static key = "scalfolder-template-editor-directory";
|
|
79
|
+
static async getDirectory() {
|
|
80
|
+
const directory = await get(WebFileSystemStore.key);
|
|
81
|
+
return directory.handle;
|
|
82
|
+
}
|
|
83
|
+
static async setDirectory(directory) {
|
|
84
|
+
return set(WebFileSystemStore.key, directory);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
54
87
|
|
|
55
|
-
export { WebFileSystemAccess };
|
|
88
|
+
export { WebFileSystemAccess, WebFileSystemStore };
|
|
56
89
|
//# sourceMappingURL=WebFileSystemAccess.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WebFileSystemAccess.esm.js","sources":["../../../src/lib/filesystem/WebFileSystemAccess.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateDirectoryAccess, TemplateFileAccess } from './types';\n\ntype WritableFileHandle = FileSystemFileHandle & {\n createWritable(): Promise<{\n write(data: string | Blob | BufferSource): Promise<void>;\n close(): Promise<void>;\n }>;\n};\n\n// A nicer type than the one from the TS lib\ninterface IterableDirectoryHandle extends FileSystemDirectoryHandle {\n values(): AsyncIterable<\n | ({ kind: 'file' } & WritableFileHandle)\n | ({ kind: 'directory' } & IterableDirectoryHandle)\n >;\n}\n\nconst showDirectoryPicker = (window as any).showDirectoryPicker as\n | (() => Promise<IterableDirectoryHandle>)\n | undefined;\n\nclass WebFileAccess implements TemplateFileAccess {\n constructor(\n readonly path: string,\n private readonly handle: WritableFileHandle,\n ) {}\n\n file(): Promise<File> {\n return this.handle.getFile();\n }\n\n async save(data: string | Blob | BufferSource): Promise<void> {\n const writable = await this.handle.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\nclass WebDirectoryAccess implements TemplateDirectoryAccess {\n constructor(private readonly handle: IterableDirectoryHandle) {}\n\n async listFiles(): Promise<TemplateFileAccess[]> {\n const content = [];\n for await (const entry of this.listDirectoryContents(this.handle)) {\n content.push(entry);\n }\n return content;\n }\n\n private async *listDirectoryContents(\n dirHandle: IterableDirectoryHandle,\n basePath: string[] = [],\n ): AsyncIterable<TemplateFileAccess> {\n for await (const handle of dirHandle.values()) {\n if (handle.kind === 'file') {\n yield new WebFileAccess([...basePath, handle.name].join('/'), handle);\n } else if (handle.kind === 'directory') {\n // Skip git storage directory\n if (handle.name === '.git') {\n continue;\n }\n yield* this.listDirectoryContents(handle, [...basePath, handle.name]);\n }\n }\n }\n}\n\n/** @internal */\nexport class WebFileSystemAccess {\n static isSupported(): boolean {\n return Boolean(showDirectoryPicker);\n }\n\n static async requestDirectoryAccess(): Promise<TemplateDirectoryAccess> {\n if (!showDirectoryPicker) {\n throw new Error('File system access is not supported');\n }\n const handle = await showDirectoryPicker();\n return new WebDirectoryAccess(handle);\n }\n\n private constructor() {}\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"WebFileSystemAccess.esm.js","sources":["../../../src/lib/filesystem/WebFileSystemAccess.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { get, set } from 'idb-keyval';\nimport { TemplateDirectoryAccess, TemplateFileAccess } from './types';\n\ntype WritableFileHandle = FileSystemFileHandle & {\n createWritable(): Promise<{\n write(data: string | Blob | BufferSource): Promise<void>;\n close(): Promise<void>;\n }>;\n};\n\n// A nicer type than the one from the TS lib\ninterface IterableDirectoryHandle extends FileSystemDirectoryHandle {\n values(): AsyncIterable<\n | ({ kind: 'file' } & WritableFileHandle)\n | ({ kind: 'directory' } & IterableDirectoryHandle)\n >;\n}\n\nconst showDirectoryPicker = (window as any).showDirectoryPicker as\n | (() => Promise<IterableDirectoryHandle>)\n | undefined;\n\nclass WebFileAccess implements TemplateFileAccess {\n constructor(\n readonly path: string,\n private readonly handle: WritableFileHandle,\n ) {}\n\n file(): Promise<File> {\n return this.handle.getFile();\n }\n\n async save(data: string | Blob | BufferSource): Promise<void> {\n const writable = await this.handle.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\nclass WebDirectoryAccess implements TemplateDirectoryAccess {\n constructor(private readonly handle: IterableDirectoryHandle) {}\n\n async listFiles(): Promise<TemplateFileAccess[]> {\n const content = [];\n for await (const entry of this.listDirectoryContents(this.handle)) {\n content.push(entry);\n }\n return content;\n }\n\n private async *listDirectoryContents(\n dirHandle: IterableDirectoryHandle,\n basePath: string[] = [],\n ): AsyncIterable<TemplateFileAccess> {\n for await (const handle of dirHandle.values()) {\n if (handle.kind === 'file') {\n yield new WebFileAccess([...basePath, handle.name].join('/'), handle);\n } else if (handle.kind === 'directory') {\n // Skip git storage directory\n if (handle.name === '.git') {\n continue;\n }\n yield* this.listDirectoryContents(handle, [...basePath, handle.name]);\n }\n }\n }\n\n async createFile(options: { name: string; data: string }): Promise<void> {\n const { name, data } = options;\n let file: FileSystemFileHandle;\n\n // Current create template does not require support for nested directories\n if (name.includes('/')) {\n const [dir, path] = name.split('/');\n const handle = await this.handle.getDirectoryHandle(dir, {\n create: true,\n });\n file = await handle.getFileHandle(path, { create: true });\n } else {\n file = await this.handle.getFileHandle(name, {\n create: true,\n });\n }\n const writable = await file.createWritable();\n await writable.write(data);\n await writable.close();\n }\n}\n\n/** @internal */\nexport class WebFileSystemAccess {\n static isSupported(): boolean {\n return Boolean(showDirectoryPicker);\n }\n\n static fromHandle(handle: IterableDirectoryHandle) {\n return new WebDirectoryAccess(handle);\n }\n\n static async requestDirectoryAccess(): Promise<TemplateDirectoryAccess> {\n if (!showDirectoryPicker) {\n throw new Error('File system access is not supported');\n }\n const handle = await showDirectoryPicker();\n return new WebDirectoryAccess(handle);\n }\n\n private constructor() {}\n}\n\nexport class WebFileSystemStore {\n private static readonly key = 'scalfolder-template-editor-directory';\n\n static async getDirectory(): Promise<IterableDirectoryHandle | undefined> {\n const directory = await get(WebFileSystemStore.key);\n return directory.handle;\n }\n\n static async setDirectory(directory: TemplateDirectoryAccess | undefined) {\n return set(WebFileSystemStore.key, directory);\n }\n}\n"],"names":[],"mappings":";;AAkCA,MAAM,sBAAuB,MAAe,CAAA,mBAAA,CAAA;AAI5C,MAAM,aAA4C,CAAA;AAAA,EAChD,WAAA,CACW,MACQ,MACjB,EAAA;AAFS,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA,CAAA;AACQ,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA,CAAA;AAAA,GAChB;AAAA,EAEH,IAAsB,GAAA;AACpB,IAAO,OAAA,IAAA,CAAK,OAAO,OAAQ,EAAA,CAAA;AAAA,GAC7B;AAAA,EAEA,MAAM,KAAK,IAAmD,EAAA;AAC5D,IAAA,MAAM,QAAW,GAAA,MAAM,IAAK,CAAA,MAAA,CAAO,cAAe,EAAA,CAAA;AAClD,IAAM,MAAA,QAAA,CAAS,MAAM,IAAI,CAAA,CAAA;AACzB,IAAA,MAAM,SAAS,KAAM,EAAA,CAAA;AAAA,GACvB;AAC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AE9B,aAAa,YAA6D,GAAA;AACxE,IAAA,MAAM,SAAY,GAAA,MAAM,GAAI,CAAA,kBAAA,CAAmB,GAAG,CAAA,CAAA;AAClD,IAAA,OAAO,SAAU,CAAA,MAAA,CAAA;AAAA,GACnB;AAAA,EAEA,aAAa,aAAa,SAAgD,EAAA;AACxE,IAAO,OAAA,GAAA,CAAI,kBAAmB,CAAA,GAAA,EAAK,SAAS,CAAA,CAAA;AAAA,GAC9C;AACF;;;;"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
const files = {
|
|
2
|
+
"template.yaml": `
|
|
3
|
+
apiVersion: scaffolder.backstage.io/v1beta3
|
|
4
|
+
# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-template
|
|
5
|
+
kind: Template
|
|
6
|
+
metadata:
|
|
7
|
+
name: generated-example-template
|
|
8
|
+
title: Scaffolder Example Template
|
|
9
|
+
description: An example template for the scaffolder
|
|
10
|
+
spec:
|
|
11
|
+
owner: user:guest
|
|
12
|
+
type: service
|
|
13
|
+
# These parameters are used to generate the input form in the frontend, and are
|
|
14
|
+
# used to gather input data for the execution of the template.
|
|
15
|
+
parameters:
|
|
16
|
+
- title: Fill in some steps
|
|
17
|
+
required:
|
|
18
|
+
- name
|
|
19
|
+
properties:
|
|
20
|
+
name:
|
|
21
|
+
title: Name
|
|
22
|
+
type: string
|
|
23
|
+
description: Unique name of the component
|
|
24
|
+
owner:
|
|
25
|
+
title: Owner
|
|
26
|
+
type: string
|
|
27
|
+
description: Owner of the component
|
|
28
|
+
ui:field: OwnerPicker
|
|
29
|
+
ui:options:
|
|
30
|
+
catalogFilter:
|
|
31
|
+
kind: Group
|
|
32
|
+
- title: Choose a location
|
|
33
|
+
required:
|
|
34
|
+
- repoUrl
|
|
35
|
+
properties:
|
|
36
|
+
repoUrl:
|
|
37
|
+
title: Repository Location
|
|
38
|
+
type: string
|
|
39
|
+
ui:field: RepoUrlPicker
|
|
40
|
+
ui:options:
|
|
41
|
+
allowedHosts:
|
|
42
|
+
- github.com
|
|
43
|
+
steps:
|
|
44
|
+
- id: fetch-base
|
|
45
|
+
name: Fetch Base
|
|
46
|
+
action: fetch:template
|
|
47
|
+
input:
|
|
48
|
+
url: ./skeleton
|
|
49
|
+
values:
|
|
50
|
+
name: \${{parameters.name}}
|
|
51
|
+
owner: \${{parameters.owner}}
|
|
52
|
+
destination: \${{ parameters.repoUrl | parseRepoUrl }}`,
|
|
53
|
+
"skeleton/README.md": `# This service is named \${{values.name}}!`,
|
|
54
|
+
"skeleton/catalog-info.yaml": `apiVersion: backstage.io/v1alpha1
|
|
55
|
+
kind: Component
|
|
56
|
+
metadata:
|
|
57
|
+
name: \${{values.component_id | dump}}
|
|
58
|
+
{%- if values.description %}
|
|
59
|
+
description: \${{values.description | dump}}
|
|
60
|
+
{%- endif %}
|
|
61
|
+
annotations:
|
|
62
|
+
github.com/project-slug: \${{values.destination.owner + "/" + values.destination.repo}}
|
|
63
|
+
backstage.io/techdocs-ref: dir:.
|
|
64
|
+
spec:
|
|
65
|
+
type: service
|
|
66
|
+
lifecycle: experimental
|
|
67
|
+
owner: \${{values.owner | dump}}`
|
|
68
|
+
};
|
|
69
|
+
async function createExampleTemplate(directory) {
|
|
70
|
+
for (const [name, data] of Object.entries(files)) {
|
|
71
|
+
await directory.createFile({ name, data });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export { createExampleTemplate };
|
|
76
|
+
//# sourceMappingURL=createExampleTemplate.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createExampleTemplate.esm.js","sources":["../../../src/lib/filesystem/createExampleTemplate.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { TemplateDirectoryAccess } from './types';\n\nconst files = {\n 'template.yaml': `\napiVersion: scaffolder.backstage.io/v1beta3\n# https://backstage.io/docs/features/software-catalog/descriptor-format#kind-template\nkind: Template\nmetadata:\n name: generated-example-template\n title: Scaffolder Example Template\n description: An example template for the scaffolder\nspec:\n owner: user:guest\n type: service\n # These parameters are used to generate the input form in the frontend, and are\n # used to gather input data for the execution of the template.\n parameters:\n - title: Fill in some steps\n required:\n - name\n properties:\n name:\n title: Name\n type: string\n description: Unique name of the component\n owner:\n title: Owner\n type: string\n description: Owner of the component\n ui:field: OwnerPicker\n ui:options:\n catalogFilter:\n kind: Group\n - title: Choose a location\n required:\n - repoUrl\n properties:\n repoUrl:\n title: Repository Location\n type: string\n ui:field: RepoUrlPicker\n ui:options:\n allowedHosts:\n - github.com\n steps:\n - id: fetch-base\n name: Fetch Base\n action: fetch:template\n input:\n url: ./skeleton\n values:\n name: \\${{parameters.name}}\n owner: \\${{parameters.owner}}\n destination: \\${{ parameters.repoUrl | parseRepoUrl }}`,\n 'skeleton/README.md': `# This service is named \\${{values.name}}!`,\n 'skeleton/catalog-info.yaml': `apiVersion: backstage.io/v1alpha1\nkind: Component\nmetadata:\n name: \\${{values.component_id | dump}}\n {%- if values.description %}\n description: \\${{values.description | dump}}\n {%- endif %}\n annotations:\n github.com/project-slug: \\${{values.destination.owner + \"/\" + values.destination.repo}}\n backstage.io/techdocs-ref: dir:.\nspec:\n type: service\n lifecycle: experimental\n owner: \\${{values.owner | dump}}`,\n};\n\nexport async function createExampleTemplate(\n directory: TemplateDirectoryAccess,\n) {\n for (const [name, data] of Object.entries(files)) {\n await directory.createFile({ name, data });\n }\n}\n"],"names":[],"mappings":"AAkBA,MAAM,KAAQ,GAAA;AAAA,EACZ,eAAiB,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gEAAA,CAAA;AAAA,EAmDjB,oBAAsB,EAAA,CAAA,0CAAA,CAAA;AAAA,EACtB,4BAA8B,EAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAA,CAAA;AAchC,CAAA,CAAA;AAEA,eAAsB,sBACpB,SACA,EAAA;AACA,EAAA,KAAA,MAAW,CAAC,IAAM,EAAA,IAAI,KAAK,MAAO,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AAChD,IAAA,MAAM,SAAU,CAAA,UAAA,CAAW,EAAE,IAAA,EAAM,MAAM,CAAA,CAAA;AAAA,GAC3C;AACF;;;;"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
class OpaqueType {
|
|
2
|
+
/**
|
|
3
|
+
* Creates a new opaque type.
|
|
4
|
+
*
|
|
5
|
+
* @param options.type The type identifier of the opaque type
|
|
6
|
+
* @param options.versions The available versions of the opaque type
|
|
7
|
+
* @returns A new opaque type helper
|
|
8
|
+
*/
|
|
9
|
+
static create(options) {
|
|
10
|
+
return new OpaqueType(options.type, new Set(options.versions));
|
|
11
|
+
}
|
|
12
|
+
#type;
|
|
13
|
+
#versions;
|
|
14
|
+
constructor(type, versions) {
|
|
15
|
+
this.#type = type;
|
|
16
|
+
this.#versions = versions;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* The internal version of the opaque type, used like this: `typeof MyOpaqueType.TPublic`
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
*
|
|
23
|
+
* This property is only useful for type checking, its runtime value is `undefined`.
|
|
24
|
+
*/
|
|
25
|
+
TPublic = void 0;
|
|
26
|
+
/**
|
|
27
|
+
* The internal version of the opaque type, used like this: `typeof MyOpaqueType.TInternal`
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
*
|
|
31
|
+
* This property is only useful for type checking, its runtime value is `undefined`.
|
|
32
|
+
*/
|
|
33
|
+
TInternal = void 0;
|
|
34
|
+
/**
|
|
35
|
+
* @param value Input value expected to be an instance of this opaque type
|
|
36
|
+
* @returns True if the value matches this opaque type
|
|
37
|
+
*/
|
|
38
|
+
isType = (value) => {
|
|
39
|
+
return this.#isThisInternalType(value);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @param value Input value expected to be an instance of this opaque type
|
|
43
|
+
* @throws If the value is not an instance of this opaque type or is of an unsupported version
|
|
44
|
+
* @returns The internal version of the opaque type
|
|
45
|
+
*/
|
|
46
|
+
toInternal = (value) => {
|
|
47
|
+
if (!this.#isThisInternalType(value)) {
|
|
48
|
+
throw new TypeError(
|
|
49
|
+
`Invalid opaque type, expected '${this.#type}', but got '${this.#stringifyUnknown(value)}'`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
if (!this.#versions.has(value.version)) {
|
|
53
|
+
const versions = Array.from(this.#versions).map(this.#stringifyVersion);
|
|
54
|
+
if (versions.length > 1) {
|
|
55
|
+
versions[versions.length - 1] = `or ${versions[versions.length - 1]}`;
|
|
56
|
+
}
|
|
57
|
+
const expected = versions.length > 2 ? versions.join(", ") : versions.join(" ");
|
|
58
|
+
throw new TypeError(
|
|
59
|
+
`Invalid opaque type instance, got version ${this.#stringifyVersion(
|
|
60
|
+
value.version
|
|
61
|
+
)}, expected ${expected}`
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Creates an instance of the opaque type, returning the public type.
|
|
68
|
+
*
|
|
69
|
+
* @param version The version of the instance to create
|
|
70
|
+
* @param value The remaining public and internal properties of the instance
|
|
71
|
+
* @returns An instance of the opaque type
|
|
72
|
+
*/
|
|
73
|
+
createInstance(version, props) {
|
|
74
|
+
return Object.assign(props, {
|
|
75
|
+
$$type: this.#type,
|
|
76
|
+
...version && { version }
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
#isThisInternalType(value) {
|
|
80
|
+
if (value === null || typeof value !== "object") {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
return value.$$type === this.#type;
|
|
84
|
+
}
|
|
85
|
+
#stringifyUnknown(value) {
|
|
86
|
+
if (typeof value !== "object") {
|
|
87
|
+
return `<${typeof value}>`;
|
|
88
|
+
}
|
|
89
|
+
if (value === null) {
|
|
90
|
+
return "<null>";
|
|
91
|
+
}
|
|
92
|
+
if ("$$type" in value) {
|
|
93
|
+
return String(value.$$type);
|
|
94
|
+
}
|
|
95
|
+
return String(value);
|
|
96
|
+
}
|
|
97
|
+
#stringifyVersion = (version) => {
|
|
98
|
+
return version ? `'${version}'` : "undefined";
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export { OpaqueType };
|
|
103
|
+
//# sourceMappingURL=OpaqueType.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OpaqueType.esm.js","sources":["../../../../../../packages/opaque-internal/src/OpaqueType.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// TODO(Rugvip): This lives here temporarily, but should be moved to a more\n// central location. It's useful for backend packages too so we'll need to have\n// it in a common package, but it might also be that we want to make it\n// available publicly too in which case it would make sense to have this be part\n// of @backstage/version-bridge. The problem with exporting it from there is\n// that it would need to be very stable at that point, so it might be a bit\n// early to put it there already.\n\n/**\n * A helper for working with opaque types.\n */\nexport class OpaqueType<\n T extends {\n public: { $$type: string };\n versions: { version: string | undefined };\n },\n> {\n /**\n * Creates a new opaque type.\n *\n * @param options.type The type identifier of the opaque type\n * @param options.versions The available versions of the opaque type\n * @returns A new opaque type helper\n */\n static create<\n T extends {\n public: { $$type: string };\n versions: { version: string | undefined };\n },\n >(options: {\n type: T['public']['$$type'];\n versions: Array<T['versions']['version']>;\n }) {\n return new OpaqueType<T>(options.type, new Set(options.versions));\n }\n\n #type: string;\n #versions: Set<string | undefined>;\n\n private constructor(type: string, versions: Set<string | undefined>) {\n this.#type = type;\n this.#versions = versions;\n }\n\n /**\n * The internal version of the opaque type, used like this: `typeof MyOpaqueType.TPublic`\n *\n * @remarks\n *\n * This property is only useful for type checking, its runtime value is `undefined`.\n */\n TPublic: T['public'] = undefined as any;\n\n /**\n * The internal version of the opaque type, used like this: `typeof MyOpaqueType.TInternal`\n *\n * @remarks\n *\n * This property is only useful for type checking, its runtime value is `undefined`.\n */\n TInternal: T['public'] & T['versions'] = undefined as any;\n\n /**\n * @param value Input value expected to be an instance of this opaque type\n * @returns True if the value matches this opaque type\n */\n isType = (value: unknown): value is T['public'] => {\n return this.#isThisInternalType(value);\n };\n\n /**\n * @param value Input value expected to be an instance of this opaque type\n * @throws If the value is not an instance of this opaque type or is of an unsupported version\n * @returns The internal version of the opaque type\n */\n toInternal = (value: unknown): T['public'] & T['versions'] => {\n if (!this.#isThisInternalType(value)) {\n throw new TypeError(\n `Invalid opaque type, expected '${\n this.#type\n }', but got '${this.#stringifyUnknown(value)}'`,\n );\n }\n\n if (!this.#versions.has(value.version)) {\n const versions = Array.from(this.#versions).map(this.#stringifyVersion);\n if (versions.length > 1) {\n versions[versions.length - 1] = `or ${versions[versions.length - 1]}`;\n }\n const expected =\n versions.length > 2 ? versions.join(', ') : versions.join(' ');\n throw new TypeError(\n `Invalid opaque type instance, got version ${this.#stringifyVersion(\n value.version,\n )}, expected ${expected}`,\n );\n }\n\n return value;\n };\n\n /**\n * Creates an instance of the opaque type, returning the public type.\n *\n * @param version The version of the instance to create\n * @param value The remaining public and internal properties of the instance\n * @returns An instance of the opaque type\n */\n createInstance<\n TVersion extends T['versions']['version'],\n TPublic extends T['public'],\n >(\n version: TVersion,\n props: Omit<T['public'], '$$type'> &\n (T['versions'] extends infer UVersion\n ? UVersion extends { version: TVersion }\n ? Omit<UVersion, 'version'>\n : never\n : never) &\n Object, // & Object to allow for object properties too, e.g. toString()\n ): TPublic {\n return Object.assign(props as object, {\n $$type: this.#type,\n ...(version && { version }),\n }) as unknown as TPublic;\n }\n\n #isThisInternalType(value: unknown): value is T['public'] & T['versions'] {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n return (value as T['public']).$$type === this.#type;\n }\n\n #stringifyUnknown(value: unknown) {\n if (typeof value !== 'object') {\n return `<${typeof value}>`;\n }\n if (value === null) {\n return '<null>';\n }\n if ('$$type' in value) {\n return String(value.$$type);\n }\n return String(value);\n }\n\n #stringifyVersion = (version: string | undefined) => {\n return version ? `'${version}'` : 'undefined';\n };\n}\n"],"names":[],"mappings":"AA2BO,MAAM,UAKX,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,OAKL,OAGC,EAAA;AACD,IAAO,OAAA,IAAI,WAAc,OAAQ,CAAA,IAAA,EAAM,IAAI,GAAI,CAAA,OAAA,CAAQ,QAAQ,CAAC,CAAA,CAAA;AAAA,GAClE;AAAA,EAEA,KAAA,CAAA;AAAA,EACA,SAAA,CAAA;AAAA,EAEQ,WAAA,CAAY,MAAc,QAAmC,EAAA;AACnE,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAA,CAAA;AACb,IAAA,IAAA,CAAK,SAAY,GAAA,QA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aqueType } from '../../../opaque-internal/src/OpaqueType.esm.js';
|
|
2
|
+
|
|
3
|
+
const OpaqueFormField = OpaqueType.create({ type: "@backstage/scaffolder/FormField", versions: ["v1"] });
|
|
4
|
+
|
|
5
|
+
export { OpaqueFormField };
|
|
6
|
+
//# sourceMappingURL=InternalFormField.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InternalFormField.esm.js","sources":["../../../../../../../packages/scaffolder-internal/src/wiring/InternalFormField.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { OpaqueType } from '@internal/opaque';\nimport { z } from 'zod';\n\nimport { FormFieldExtensionData } from '@backstage/plugin-scaffolder-react/alpha';\n\n/** @alpha */\nexport interface FormField {\n readonly $$type: '@backstage/scaffolder/FormField';\n}\n\n/** @alpha */\nexport const OpaqueFormField = OpaqueType.create<{\n public: FormField;\n versions: FormFieldExtensionData<z.ZodType, z.ZodType> & {\n readonly version: 'v1';\n };\n}>({ type: '@backstage/scaffolder/FormField', versions: ['v1'] });\n"],"names":[],"mappings":";;AA2Ba,MAAA,eAAA,GAAkB,UAAW,CAAA,MAAA,CAKvC,EAAE,IAAA,EAAM,mCAAmC,QAAU,EAAA,CAAC,IAAI,CAAA,EAAG;;;;"}
|
package/dist/plugin.esm.js
CHANGED
|
@@ -12,7 +12,7 @@ import { RepoUrlPicker } from './components/fields/RepoUrlPicker/RepoUrlPicker.e
|
|
|
12
12
|
import { createPlugin, createApiFactory, discoveryApiRef, fetchApiRef, identityApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
|
|
13
13
|
import { OwnedEntityPicker } from './components/fields/OwnedEntityPicker/OwnedEntityPicker.esm.js';
|
|
14
14
|
import { EntityTagsPicker } from './components/fields/EntityTagsPicker/EntityTagsPicker.esm.js';
|
|
15
|
-
import { rootRouteRef, selectedTemplateRouteRef, scaffolderTaskRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, editRouteRef, registerComponentRouteRef, viewTechDocRouteRef } from './routes.esm.js';
|
|
15
|
+
import { rootRouteRef, selectedTemplateRouteRef, scaffolderTaskRouteRef, actionsRouteRef, scaffolderListTaskRouteRef, editRouteRef, editorRouteRef, customFieldsRouteRef, templateFormRouteRef, registerComponentRouteRef, viewTechDocRouteRef } from './routes.esm.js';
|
|
16
16
|
import { MyGroupsPicker } from './components/fields/MyGroupsPicker/MyGroupsPicker.esm.js';
|
|
17
17
|
import { RepoBranchPicker } from './components/fields/RepoBranchPicker/RepoBranchPicker.esm.js';
|
|
18
18
|
import { RepoBranchPickerSchema } from './components/fields/RepoBranchPicker/schema.esm.js';
|
|
@@ -49,7 +49,10 @@ const scaffolderPlugin = createPlugin({
|
|
|
49
49
|
ongoingTask: scaffolderTaskRouteRef,
|
|
50
50
|
actions: actionsRouteRef,
|
|
51
51
|
listTasks: scaffolderListTaskRouteRef,
|
|
52
|
-
edit: editRouteRef
|
|
52
|
+
edit: editRouteRef,
|
|
53
|
+
editor: editorRouteRef,
|
|
54
|
+
customFields: customFieldsRouteRef,
|
|
55
|
+
templateForm: templateFormRouteRef
|
|
53
56
|
},
|
|
54
57
|
externalRoutes: {
|
|
55
58
|
registerComponent: registerComponentRouteRef,
|
package/dist/plugin.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport {\n createScaffolderFieldExtension,\n scaffolderApiRef,\n} from '@backstage/plugin-scaffolder-react';\nimport { ScaffolderClient } from './api';\nimport {\n EntityPicker,\n EntityPickerSchema,\n} from './components/fields/EntityPicker/EntityPicker';\nimport { entityNamePickerValidation } from './components/fields/EntityNamePicker';\nimport {\n EntityNamePicker,\n EntityNamePickerSchema,\n} from './components/fields/EntityNamePicker/EntityNamePicker';\nimport {\n OwnerPicker,\n OwnerPickerSchema,\n} from './components/fields/OwnerPicker/OwnerPicker';\nimport {\n MultiEntityPicker,\n MultiEntityPickerSchema,\n validateMultiEntityPickerValidation,\n} from './components/fields/MultiEntityPicker/MultiEntityPicker';\nimport { repoPickerValidation } from './components/fields/RepoUrlPicker';\nimport {\n RepoUrlPicker,\n RepoUrlPickerSchema,\n} from './components/fields/RepoUrlPicker/RepoUrlPicker';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n OwnedEntityPicker,\n OwnedEntityPickerSchema,\n} from './components/fields/OwnedEntityPicker/OwnedEntityPicker';\nimport {\n EntityTagsPicker,\n EntityTagsPickerSchema,\n} from './components/fields/EntityTagsPicker/EntityTagsPicker';\nimport {\n registerComponentRouteRef,\n rootRouteRef,\n viewTechDocRouteRef,\n selectedTemplateRouteRef,\n scaffolderTaskRouteRef,\n scaffolderListTaskRouteRef,\n actionsRouteRef,\n editRouteRef,\n} from './routes';\nimport {\n MyGroupsPicker,\n MyGroupsPickerSchema,\n} from './components/fields/MyGroupsPicker/MyGroupsPicker';\nimport { RepoBranchPicker } from './components/fields/RepoBranchPicker/RepoBranchPicker';\nimport { RepoBranchPickerSchema } from './components/fields/RepoBranchPicker/schema';\n\n/**\n * The main plugin export for the scaffolder.\n * @public\n */\nexport const scaffolderPlugin = createPlugin({\n id: 'scaffolder',\n apis: [\n createApiFactory({\n api: scaffolderApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n fetchApi: fetchApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) =>\n new ScaffolderClient({\n discoveryApi,\n scmIntegrationsApi,\n fetchApi,\n identityApi,\n }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n selectedTemplate: selectedTemplateRouteRef,\n ongoingTask: scaffolderTaskRouteRef,\n actions: actionsRouteRef,\n listTasks: scaffolderListTaskRouteRef,\n edit: editRouteRef,\n },\n externalRoutes: {\n registerComponent: registerComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n },\n});\n\n/**\n * A field extension for selecting an Entity that exists in the Catalog.\n *\n * @public\n */\nexport const EntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityPicker,\n name: 'EntityPicker',\n schema: EntityPickerSchema,\n }),\n);\n\n/**\n * The field extension for selecting a name for a new Entity in the Catalog.\n *\n * @public\n */\nexport const EntityNamePickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n schema: EntityNamePickerSchema,\n }),\n);\n\n/**\n * A field extension for selecting multiple entities that exists in the Catalog.\n *\n * @public\n */\nexport const MultiEntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: MultiEntityPicker,\n name: 'MultiEntityPicker',\n schema: MultiEntityPickerSchema,\n validation: validateMultiEntityPickerValidation,\n }),\n);\n\n/**\n * The field extension which provides the ability to select a RepositoryUrl.\n * Currently, this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.\n *\n * @public\n */\nexport const RepoUrlPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n schema: RepoUrlPickerSchema,\n }),\n);\n\n/**\n * A field extension for picking users and groups out of the Catalog.\n *\n * @public\n */\nexport const OwnerPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: OwnerPicker,\n name: 'OwnerPicker',\n schema: OwnerPickerSchema,\n }),\n);\n\n/**\n * A field extension for picking groups a user belongs to out of the catalog.\n *\n * @public\n */\nexport const MyGroupsPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: MyGroupsPicker,\n name: 'MyGroupsPicker',\n schema: MyGroupsPickerSchema,\n }),\n);\n\n/**\n * The Router and main entrypoint to the Scaffolder plugin.\n *\n * @public\n */\nexport const ScaffolderPage = scaffolderPlugin.provide(\n createRoutableExtension({\n name: 'ScaffolderPage',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * A field extension to show all the Entities that are owned by the current logged-in User for use in templates.\n *\n * @public\n */\nexport const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n schema: OwnedEntityPickerSchema,\n }),\n);\n\n/**\n * EntityTagsPickerFieldExtension\n * @public\n */\nexport const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n schema: EntityTagsPickerSchema,\n }),\n);\n\n/**\n * A field extension to select a branch from a repository.\n *\n * @public\n */\nexport const RepoBranchPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: RepoBranchPicker,\n name: 'RepoBranchPicker',\n schema: RepoBranchPickerSchema,\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"plugin.esm.js","sources":["../src/plugin.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { scmIntegrationsApiRef } from '@backstage/integration-react';\nimport {\n createScaffolderFieldExtension,\n scaffolderApiRef,\n} from '@backstage/plugin-scaffolder-react';\nimport { ScaffolderClient } from './api';\nimport {\n EntityPicker,\n EntityPickerSchema,\n} from './components/fields/EntityPicker/EntityPicker';\nimport { entityNamePickerValidation } from './components/fields/EntityNamePicker';\nimport {\n EntityNamePicker,\n EntityNamePickerSchema,\n} from './components/fields/EntityNamePicker/EntityNamePicker';\nimport {\n OwnerPicker,\n OwnerPickerSchema,\n} from './components/fields/OwnerPicker/OwnerPicker';\nimport {\n MultiEntityPicker,\n MultiEntityPickerSchema,\n validateMultiEntityPickerValidation,\n} from './components/fields/MultiEntityPicker/MultiEntityPicker';\nimport { repoPickerValidation } from './components/fields/RepoUrlPicker';\nimport {\n RepoUrlPicker,\n RepoUrlPickerSchema,\n} from './components/fields/RepoUrlPicker/RepoUrlPicker';\nimport {\n createApiFactory,\n createPlugin,\n createRoutableExtension,\n discoveryApiRef,\n fetchApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport {\n OwnedEntityPicker,\n OwnedEntityPickerSchema,\n} from './components/fields/OwnedEntityPicker/OwnedEntityPicker';\nimport {\n EntityTagsPicker,\n EntityTagsPickerSchema,\n} from './components/fields/EntityTagsPicker/EntityTagsPicker';\nimport {\n registerComponentRouteRef,\n rootRouteRef,\n viewTechDocRouteRef,\n selectedTemplateRouteRef,\n scaffolderTaskRouteRef,\n scaffolderListTaskRouteRef,\n actionsRouteRef,\n editRouteRef,\n editorRouteRef,\n customFieldsRouteRef,\n templateFormRouteRef,\n} from './routes';\nimport {\n MyGroupsPicker,\n MyGroupsPickerSchema,\n} from './components/fields/MyGroupsPicker/MyGroupsPicker';\nimport { RepoBranchPicker } from './components/fields/RepoBranchPicker/RepoBranchPicker';\nimport { RepoBranchPickerSchema } from './components/fields/RepoBranchPicker/schema';\n\n/**\n * The main plugin export for the scaffolder.\n * @public\n */\nexport const scaffolderPlugin = createPlugin({\n id: 'scaffolder',\n apis: [\n createApiFactory({\n api: scaffolderApiRef,\n deps: {\n discoveryApi: discoveryApiRef,\n scmIntegrationsApi: scmIntegrationsApiRef,\n fetchApi: fetchApiRef,\n identityApi: identityApiRef,\n },\n factory: ({ discoveryApi, scmIntegrationsApi, fetchApi, identityApi }) =>\n new ScaffolderClient({\n discoveryApi,\n scmIntegrationsApi,\n fetchApi,\n identityApi,\n }),\n }),\n ],\n routes: {\n root: rootRouteRef,\n selectedTemplate: selectedTemplateRouteRef,\n ongoingTask: scaffolderTaskRouteRef,\n actions: actionsRouteRef,\n listTasks: scaffolderListTaskRouteRef,\n edit: editRouteRef,\n editor: editorRouteRef,\n customFields: customFieldsRouteRef,\n templateForm: templateFormRouteRef,\n },\n externalRoutes: {\n registerComponent: registerComponentRouteRef,\n viewTechDoc: viewTechDocRouteRef,\n },\n});\n\n/**\n * A field extension for selecting an Entity that exists in the Catalog.\n *\n * @public\n */\nexport const EntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityPicker,\n name: 'EntityPicker',\n schema: EntityPickerSchema,\n }),\n);\n\n/**\n * The field extension for selecting a name for a new Entity in the Catalog.\n *\n * @public\n */\nexport const EntityNamePickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityNamePicker,\n name: 'EntityNamePicker',\n validation: entityNamePickerValidation,\n schema: EntityNamePickerSchema,\n }),\n);\n\n/**\n * A field extension for selecting multiple entities that exists in the Catalog.\n *\n * @public\n */\nexport const MultiEntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: MultiEntityPicker,\n name: 'MultiEntityPicker',\n schema: MultiEntityPickerSchema,\n validation: validateMultiEntityPickerValidation,\n }),\n);\n\n/**\n * The field extension which provides the ability to select a RepositoryUrl.\n * Currently, this is an encoded URL that looks something like the following `github.com?repo=myRepoName&owner=backstage`.\n *\n * @public\n */\nexport const RepoUrlPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: RepoUrlPicker,\n name: 'RepoUrlPicker',\n validation: repoPickerValidation,\n schema: RepoUrlPickerSchema,\n }),\n);\n\n/**\n * A field extension for picking users and groups out of the Catalog.\n *\n * @public\n */\nexport const OwnerPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: OwnerPicker,\n name: 'OwnerPicker',\n schema: OwnerPickerSchema,\n }),\n);\n\n/**\n * A field extension for picking groups a user belongs to out of the catalog.\n *\n * @public\n */\nexport const MyGroupsPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: MyGroupsPicker,\n name: 'MyGroupsPicker',\n schema: MyGroupsPickerSchema,\n }),\n);\n\n/**\n * The Router and main entrypoint to the Scaffolder plugin.\n *\n * @public\n */\nexport const ScaffolderPage = scaffolderPlugin.provide(\n createRoutableExtension({\n name: 'ScaffolderPage',\n component: () => import('./components/Router').then(m => m.Router),\n mountPoint: rootRouteRef,\n }),\n);\n\n/**\n * A field extension to show all the Entities that are owned by the current logged-in User for use in templates.\n *\n * @public\n */\nexport const OwnedEntityPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: OwnedEntityPicker,\n name: 'OwnedEntityPicker',\n schema: OwnedEntityPickerSchema,\n }),\n);\n\n/**\n * EntityTagsPickerFieldExtension\n * @public\n */\nexport const EntityTagsPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: EntityTagsPicker,\n name: 'EntityTagsPicker',\n schema: EntityTagsPickerSchema,\n }),\n);\n\n/**\n * A field extension to select a branch from a repository.\n *\n * @public\n */\nexport const RepoBranchPickerFieldExtension = scaffolderPlugin.provide(\n createScaffolderFieldExtension({\n component: RepoBranchPicker,\n name: 'RepoBranchPicker',\n schema: RepoBranchPickerSchema,\n }),\n);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAqFO,MAAM,mBAAmB,YAAa,CAAA;AAAA,EAC3C,EAAI,EAAA,YAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,gBAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,YAAc,EAAA,eAAA;AAAA,QACd,kBAAoB,EAAA,qBAAA;AAAA,QACpB,QAAU,EAAA,WAAA;AAAA,QACV,WAAa,EAAA,cAAA;AAAA,OACf;AAAA,MACA,OAAA,EAAS,CAAC,EAAE,YAAA,EAAc,oBAAoB,QAAU,EAAA,WAAA,EACtD,KAAA,IAAI,gBAAiB,CAAA;AAAA,QACnB,YAAA;AAAA,QACA,kBAAA;AAAA,QACA,QAAA;AAAA,QACA,WAAA;AAAA,OACD,CAAA;AAAA,KACJ,CAAA;AAAA,GACH;AAAA,EACA,MAAQ,EAAA;AAAA,IACN,IAAM,EAAA,YAAA;AAAA,IACN,gBAAkB,EAAA,wBAAA;AAAA,IAClB,WAAa,EAAA,sBAAA;AAAA,IACb,OAAS,EAAA,eAAA;AAAA,IACT,SAAW,EAAA,0BAAA;AAAA,IACX,IAAM,EAAA,YAAA;AAAA,IACN,MAAQ,EAAA,cAAA;AAAA,IACR,YAAc,EAAA,oBAAA;AAAA,IACd,YAAc,EAAA,oBAAA;AAAA,GAChB;AAAA,EACA,cAAgB,EAAA;AAAA,IACd,iBAAmB,EAAA,yBAAA;AAAA,IACnB,WAAa,EAAA,mBAAA;AAAA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A;AACH,EAAA;AAOO,MAAM,iBAAiB,gBAAiB,CAAA,OAAA;AAAA,EAC7C,uBAAwB,CAAA;AAAA,IACtB,IAAM,EAAA,gBAAA;AAAA,IACN,SAAA,EAAW,MAAM,OAAO,kCAAqB,EAAE,IAAK,CAAA,CAAA,CAAA,KAAK,EAAE,MAAM,CAAA;AAAA,IACjE,UAAY,EAAA,YAAA;AAAA,GACb,CAAA;AACH,EAAA;AAOO,MAAM,kCAAkC,gBAAiB,CAAA,OAAA;AAAA,EAC9D,8BAA+B,CAAA;AAAA,IAC7B,SAAW,EAAA,iBAAA;AAAA,IACX,IAAM,EAAA,mBAAA;AAAA,IACN,MAAQ,EAAA,uBAAA;AAAA,GACT,CAAA;AACH,EAAA;AAMO,MAAM,iCAAiC,gBAAiB,CAAA,OAAA;AAAA,EAC7D,8BAA+B,CAAA;AAAA,IAC7B,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,MAAQ,EAAA,sBAAA;AAAA,GACT,CAAA;AACH,EAAA;AAOO,MAAM,iCAAiC,gBAAiB,CAAA,OAAA;AAAA,EAC7D,8BAA+B,CAAA;AAAA,IAC7B,SAAW,EAAA,gBAAA;AAAA,IACX,IAAM,EAAA,kBAAA;AAAA,IACN,MAAQ,EAAA,sBAAA;AAAA,GACT,CAAA;AACH;;;;"}
|
package/dist/routes.esm.js
CHANGED
|
@@ -44,6 +44,21 @@ const editRouteRef = createSubRouteRef({
|
|
|
44
44
|
parent: rootRouteRef,
|
|
45
45
|
path: "/edit"
|
|
46
46
|
});
|
|
47
|
+
const editorRouteRef = createSubRouteRef({
|
|
48
|
+
id: "scaffolder/editor",
|
|
49
|
+
parent: rootRouteRef,
|
|
50
|
+
path: "/template"
|
|
51
|
+
});
|
|
52
|
+
const customFieldsRouteRef = createSubRouteRef({
|
|
53
|
+
id: "scaffolder/customFields",
|
|
54
|
+
parent: rootRouteRef,
|
|
55
|
+
path: "/custom-fields"
|
|
56
|
+
});
|
|
57
|
+
const templateFormRouteRef = createSubRouteRef({
|
|
58
|
+
id: "scaffolder/editorForm",
|
|
59
|
+
parent: rootRouteRef,
|
|
60
|
+
path: "/template-form"
|
|
61
|
+
});
|
|
47
62
|
|
|
48
|
-
export { actionsRouteRef, editRouteRef, registerComponentRouteRef, rootRouteRef, scaffolderListTaskRouteRef, scaffolderTaskRouteRef, selectedTemplateRouteRef, viewTechDocRouteRef };
|
|
63
|
+
export { actionsRouteRef, customFieldsRouteRef, editRouteRef, editorRouteRef, registerComponentRouteRef, rootRouteRef, scaffolderListTaskRouteRef, scaffolderTaskRouteRef, selectedTemplateRouteRef, templateFormRouteRef, viewTechDocRouteRef };
|
|
49
64
|
//# sourceMappingURL=routes.esm.js.map
|
package/dist/routes.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createExternalRouteRef,\n createRouteRef,\n createSubRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n defaultTarget: 'catalog-import.importPage',\n});\n\nexport const viewTechDocRouteRef = createExternalRouteRef({\n id: 'view-techdoc',\n optional: true,\n params: ['namespace', 'kind', 'name'],\n defaultTarget: 'techdocs.docRoot',\n});\n\n/**\n * @public\n */\nexport const rootRouteRef = createRouteRef({\n id: 'scaffolder',\n});\n\n/**\n * @deprecated This is the old template route, can be deleted before next major release\n * @public\n */\nexport const legacySelectedTemplateRouteRef = createSubRouteRef({\n id: 'scaffolder/legacy/selected-template',\n parent: rootRouteRef,\n path: '/templates/:templateName',\n});\n\nexport const selectedTemplateRouteRef = createSubRouteRef({\n id: 'scaffolder/selected-template',\n parent: rootRouteRef,\n path: '/templates/:namespace/:templateName',\n});\n\nexport const scaffolderTaskRouteRef = createSubRouteRef({\n id: 'scaffolder/task',\n parent: rootRouteRef,\n path: '/tasks/:taskId',\n});\n\nexport const scaffolderListTaskRouteRef = createSubRouteRef({\n id: 'scaffolder/list-tasks',\n parent: rootRouteRef,\n path: '/tasks',\n});\n\nexport const actionsRouteRef = createSubRouteRef({\n id: 'scaffolder/actions',\n parent: rootRouteRef,\n path: '/actions',\n});\n\nexport const editRouteRef = createSubRouteRef({\n id: 'scaffolder/edit',\n parent: rootRouteRef,\n path: '/edit',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,4BAA4B,sBAAuB,CAAA;AAAA,EAC9D,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AAAA,EACV,aAAe,EAAA,2BAAA;AACjB,CAAC,EAAA;AAEM,MAAM,sBAAsB,sBAAuB,CAAA;AAAA,EACxD,EAAI,EAAA,cAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AAAA,EACV,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,aAAe,EAAA,kBAAA;AACjB,CAAC,EAAA;AAKM,MAAM,eAAe,cAAe,CAAA;AAAA,EACzC,EAAI,EAAA,YAAA;AACN,CAAC,EAAA;AAM6C,iBAAkB,CAAA;AAAA,EAC9D,EAAI,EAAA,qCAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,0BAAA;AACR,CAAC,EAAA;AAEM,MAAM,2BAA2B,iBAAkB,CAAA;AAAA,EACxD,EAAI,EAAA,8BAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,qCAAA;AACR,CAAC,EAAA;AAEM,MAAM,yBAAyB,iBAAkB,CAAA;AAAA,EACtD,EAAI,EAAA,iBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,gBAAA;AACR,CAAC,EAAA;AAEM,MAAM,6BAA6B,iBAAkB,CAAA;AAAA,EAC1D,EAAI,EAAA,uBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,QAAA;AACR,CAAC,EAAA;AAEM,MAAM,kBAAkB,iBAAkB,CAAA;AAAA,EAC/C,EAAI,EAAA,oBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,UAAA;AACR,CAAC,EAAA;AAEM,MAAM,eAAe,iBAAkB,CAAA;AAAA,EAC5C,EAAI,EAAA,iBAAA;AAAA,EACJ,MAAQ,EAAA,YAAA;AAAA,EACR,IAAM,EAAA,OAAA;AACR,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"routes.esm.js","sources":["../src/routes.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createExternalRouteRef,\n createRouteRef,\n createSubRouteRef,\n} from '@backstage/core-plugin-api';\n\nexport const registerComponentRouteRef = createExternalRouteRef({\n id: 'register-component',\n optional: true,\n defaultTarget: 'catalog-import.importPage',\n});\n\nexport const viewTechDocRouteRef = createExternalRouteRef({\n id: 'view-techdoc',\n optional: true,\n params: ['namespace', 'kind', 'name'],\n defaultTarget: 'techdocs.docRoot',\n});\n\n/**\n * @public\n */\nexport const rootRouteRef = createRouteRef({\n id: 'scaffolder',\n});\n\n/**\n * @deprecated This is the old template route, can be deleted before next major release\n * @public\n */\nexport const legacySelectedTemplateRouteRef = createSubRouteRef({\n id: 'scaffolder/legacy/selected-template',\n parent: rootRouteRef,\n path: '/templates/:templateName',\n});\n\nexport const selectedTemplateRouteRef = createSubRouteRef({\n id: 'scaffolder/selected-template',\n parent: rootRouteRef,\n path: '/templates/:namespace/:templateName',\n});\n\nexport const scaffolderTaskRouteRef = createSubRouteRef({\n id: 'scaffolder/task',\n parent: rootRouteRef,\n path: '/tasks/:taskId',\n});\n\nexport const scaffolderListTaskRouteRef = createSubRouteRef({\n id: 'scaffolder/list-tasks',\n parent: rootRouteRef,\n path: '/tasks',\n});\n\nexport const actionsRouteRef = createSubRouteRef({\n id: 'scaffolder/actions',\n parent: rootRouteRef,\n path: '/actions',\n});\n\nexport const editRouteRef = createSubRouteRef({\n id: 'scaffolder/edit',\n parent: rootRouteRef,\n path: '/edit',\n});\n\nexport const editorRouteRef = createSubRouteRef({\n id: 'scaffolder/editor',\n parent: rootRouteRef,\n path: '/template',\n});\n\nexport const customFieldsRouteRef = createSubRouteRef({\n id: 'scaffolder/customFields',\n parent: rootRouteRef,\n path: '/custom-fields',\n});\n\nexport const templateFormRouteRef = createSubRouteRef({\n id: 'scaffolder/editorForm',\n parent: rootRouteRef,\n path: '/template-form',\n});\n"],"names":[],"mappings":";;AAqBO,MAAM,4BAA4B,sBAAuB,CAAA;AAAA,EAC9D,EAAI,EAAA,oBAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AAAA,EACV,aAAe,EAAA,2BAAA;AACjB,CAAC,EAAA;AAEM,MAAM,sBAAsB,sBAAuB,CAAA;AAAA,EACxD,EAAI,EAAA,cAAA;AAAA,EACJ,QAAU,EAAA,IAAA;AAAA,EACV,MAAQ,EAAA,CAAC,WAAa,EAAA,MAAA,EAAQ,MAAM,CAAA;AAAA,EACpC,aAAe,EAAA,kBAAA;AACjB,CAAC,EAAA;AAKM,MAAM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