scaffolder: TemplateParameterV1beta3 to TemplateParametersV1beta3
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
@@ -64,7 +64,7 @@ export interface TemplateEntityV1beta3 extends Entity {
|
||||
kind: 'Template';
|
||||
spec: {
|
||||
type: string;
|
||||
parameters?: TemplateParameterV1beta3 | TemplateParameterV1beta3[];
|
||||
parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];
|
||||
steps: Array<TemplateEntityStepV1beta3>;
|
||||
output?: {
|
||||
[name: string]: string;
|
||||
@@ -86,7 +86,7 @@ export type TemplateInfo = {
|
||||
};
|
||||
|
||||
// @public
|
||||
export interface TemplateParameterV1beta3 extends JsonObject {
|
||||
export interface TemplateParametersV1beta3 extends JsonObject {
|
||||
// (undocumented)
|
||||
'backstage:permissions'?: TemplatePermissionsV1beta3;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { entityKindSchemaValidator } from '@backstage/catalog-model';
|
||||
import type {
|
||||
TemplateEntityV1beta3,
|
||||
TemplateParameterV1beta3,
|
||||
TemplateParametersV1beta3,
|
||||
} from './TemplateEntityV1beta3';
|
||||
import schema from './Template.v1beta3.schema.json';
|
||||
|
||||
@@ -163,12 +163,12 @@ describe('templateEntityV1beta3Validator', () => {
|
||||
});
|
||||
|
||||
it('rejects parameters with wrong backstage:permissions', async () => {
|
||||
(entity.spec.parameters as TemplateParameterV1beta3)[
|
||||
(entity.spec.parameters as TemplateParametersV1beta3)[
|
||||
'backstage:permissions'
|
||||
]!.tags = true as unknown as [];
|
||||
expect(() => validator(entity)).toThrow(/must be array/);
|
||||
|
||||
(entity.spec.parameters as TemplateParameterV1beta3)[
|
||||
(entity.spec.parameters as TemplateParametersV1beta3)[
|
||||
'backstage:permissions'
|
||||
] = true as {};
|
||||
expect(() => validator(entity)).toThrow(/must be object/);
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface TemplateEntityV1beta3 extends Entity {
|
||||
* to collect user input and validate it against that schema. This can then be used in the `steps` part below to template
|
||||
* variables passed from the user into each action in the template.
|
||||
*/
|
||||
parameters?: TemplateParameterV1beta3 | TemplateParameterV1beta3[];
|
||||
parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];
|
||||
/**
|
||||
* A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying
|
||||
* javascript action and some optional input parameters that may or may not have been collected from the end user.
|
||||
@@ -86,7 +86,7 @@ export interface TemplateEntityStepV1beta3 extends JsonObject {
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface TemplateParameterV1beta3 extends JsonObject {
|
||||
export interface TemplateParametersV1beta3 extends JsonObject {
|
||||
'backstage:permissions'?: TemplatePermissionsV1beta3;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,6 @@ export {
|
||||
export type {
|
||||
TemplateEntityV1beta3,
|
||||
TemplateEntityStepV1beta3,
|
||||
TemplateParameterV1beta3,
|
||||
TemplateParametersV1beta3,
|
||||
TemplatePermissionsV1beta3,
|
||||
} from './TemplateEntityV1beta3';
|
||||
|
||||
Reference in New Issue
Block a user