@backstage/plugin-scaffolder-common 2.1.1-next.0 → 2.2.0

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 CHANGED
@@ -1,5 +1,29 @@
1
1
  # @backstage/plugin-scaffolder-common
2
2
 
3
+ ## 2.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8006acf: Promote the `formDecorators` field on the `Template` spec out of experimental.
8
+ The previous `EXPERIMENTAL_formDecorators` field continues to work and is
9
+ kept as a deprecated alias.
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+ - @backstage/catalog-model@1.9.0
15
+ - @backstage/errors@1.3.1
16
+ - @backstage/integration@2.0.2
17
+ - @backstage/plugin-permission-common@0.9.9
18
+
19
+ ## 2.2.0-next.1
20
+
21
+ ### Minor Changes
22
+
23
+ - 8006acf: Promote the `formDecorators` field on the `Template` spec out of experimental.
24
+ The previous `EXPERIMENTAL_formDecorators` field continues to work and is
25
+ kept as a deprecated alias.
26
+
3
27
  ## 2.1.1-next.0
4
28
 
5
29
  ### Patch Changes
@@ -223,7 +223,7 @@ var allOf = [
223
223
  }
224
224
  }
225
225
  },
226
- EXPERIMENTAL_formDecorators: {
226
+ formDecorators: {
227
227
  type: "array",
228
228
  description: "A list of decorators and their inputs that the form should trigger before submitting the job",
229
229
  items: {
@@ -231,11 +231,29 @@ var allOf = [
231
231
  properties: {
232
232
  id: {
233
233
  type: "string",
234
- description: "The form hook ID"
234
+ description: "The form decorator ID"
235
+ },
236
+ input: {
237
+ type: "object",
238
+ description: "An object describing the inputs to the form decorator."
239
+ }
240
+ }
241
+ }
242
+ },
243
+ EXPERIMENTAL_formDecorators: {
244
+ type: "array",
245
+ deprecated: true,
246
+ description: "Deprecated, use formDecorators instead.",
247
+ items: {
248
+ type: "object",
249
+ properties: {
250
+ id: {
251
+ type: "string",
252
+ description: "The form decorator ID"
235
253
  },
236
254
  input: {
237
255
  type: "object",
238
- description: "A object describing the inputs to the form hook."
256
+ description: "An object describing the inputs to the form decorator."
239
257
  }
240
258
  }
241
259
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Template.v1beta3.schema.json.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Template.v1beta3.schema.json.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -219,7 +219,7 @@ var allOf = [
219
219
  }
220
220
  }
221
221
  },
222
- EXPERIMENTAL_formDecorators: {
222
+ formDecorators: {
223
223
  type: "array",
224
224
  description: "A list of decorators and their inputs that the form should trigger before submitting the job",
225
225
  items: {
@@ -227,11 +227,29 @@ var allOf = [
227
227
  properties: {
228
228
  id: {
229
229
  type: "string",
230
- description: "The form hook ID"
230
+ description: "The form decorator ID"
231
+ },
232
+ input: {
233
+ type: "object",
234
+ description: "An object describing the inputs to the form decorator."
235
+ }
236
+ }
237
+ }
238
+ },
239
+ EXPERIMENTAL_formDecorators: {
240
+ type: "array",
241
+ deprecated: true,
242
+ description: "Deprecated, use formDecorators instead.",
243
+ items: {
244
+ type: "object",
245
+ properties: {
246
+ id: {
247
+ type: "string",
248
+ description: "The form decorator ID"
231
249
  },
232
250
  input: {
233
251
  type: "object",
234
- description: "A object describing the inputs to the form hook."
252
+ description: "An object describing the inputs to the form decorator."
235
253
  }
236
254
  }
237
255
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Template.v1beta3.schema.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Template.v1beta3.schema.json.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateEntityV1beta3.cjs.js","sources":["../src/TemplateEntityV1beta3.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 */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * Form hooks to be run\n */\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * Configuration for secrets that are passed during task creation.\n * The schema field contains a JSONSchema used to validate secrets.\n */\n secrets?: {\n schema?: JsonObject;\n };\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n /**\n * Specifies the lifecycle phase of the TemplateEntity\n */\n lifecycle?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * The shape of each entry of parameters which gets rendered\n * as a separate step in the wizard input\n *\n * @public\n */\nexport type TemplateParameterSchema = {\n title: string;\n description?: string;\n presentation?: TemplatePresentationV1beta3;\n steps: Array<{\n title: string;\n description?: string;\n schema: JsonObject;\n }>;\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n};\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":["entityKindSchemaValidator","schema"],"mappings":";;;;;AA2LA,MAAM,SAAA,GAAYA,uCAA0BC,+BAAM,CAAA;AAO3C,MAAM,8BAAA,GAAgD;AAAA;AAAA,EAE3D,MAAM,MAAM,IAAA,EAAc;AACxB,IAAA,OAAO,SAAA,CAAU,IAAI,CAAA,KAAM,IAAA;AAAA,EAC7B;AACF;AAMO,MAAM,0BAA0B,CACrC,MAAA,KAEA,OAAO,UAAA,KAAe,iCAAA,IACtB,OAAO,IAAA,KAAS;;;;;"}
1
+ {"version":3,"file":"TemplateEntityV1beta3.cjs.js","sources":["../src/TemplateEntityV1beta3.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 */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * Form decorators to be run before submission.\n */\n formDecorators?: { id: string; input?: JsonObject }[];\n\n /**\n * Form decorators to be run before submission.\n *\n * @deprecated Use `spec.formDecorators` instead.\n */\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * Configuration for secrets that are passed during task creation.\n * The schema field contains a JSONSchema used to validate secrets.\n */\n secrets?: {\n schema?: JsonObject;\n };\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n /**\n * Specifies the lifecycle phase of the TemplateEntity\n */\n lifecycle?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * The shape of each entry of parameters which gets rendered\n * as a separate step in the wizard input\n *\n * @public\n */\nexport type TemplateParameterSchema = {\n title: string;\n description?: string;\n presentation?: TemplatePresentationV1beta3;\n steps: Array<{\n title: string;\n description?: string;\n schema: JsonObject;\n }>;\n formDecorators?: { id: string; input?: JsonObject }[];\n /**\n * @deprecated Use {@link TemplateParameterSchema.formDecorators} instead.\n */\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n};\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":["entityKindSchemaValidator","schema"],"mappings":";;;;;AAsMA,MAAM,SAAA,GAAYA,uCAA0BC,+BAAM,CAAA;AAO3C,MAAM,8BAAA,GAAgD;AAAA;AAAA,EAE3D,MAAM,MAAM,IAAA,EAAc;AACxB,IAAA,OAAO,SAAA,CAAU,IAAI,CAAA,KAAM,IAAA;AAAA,EAC7B;AACF;AAMO,MAAM,0BAA0B,CACrC,MAAA,KAEA,OAAO,UAAA,KAAe,iCAAA,IACtB,OAAO,IAAA,KAAS;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"TemplateEntityV1beta3.esm.js","sources":["../src/TemplateEntityV1beta3.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 */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * Form hooks to be run\n */\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * Configuration for secrets that are passed during task creation.\n * The schema field contains a JSONSchema used to validate secrets.\n */\n secrets?: {\n schema?: JsonObject;\n };\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n /**\n * Specifies the lifecycle phase of the TemplateEntity\n */\n lifecycle?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * The shape of each entry of parameters which gets rendered\n * as a separate step in the wizard input\n *\n * @public\n */\nexport type TemplateParameterSchema = {\n title: string;\n description?: string;\n presentation?: TemplatePresentationV1beta3;\n steps: Array<{\n title: string;\n description?: string;\n schema: JsonObject;\n }>;\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n};\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":["schema"],"mappings":";;;AA2LA,MAAM,SAAA,GAAY,0BAA0BA,UAAM,CAAA;AAO3C,MAAM,8BAAA,GAAgD;AAAA;AAAA,EAE3D,MAAM,MAAM,IAAA,EAAc;AACxB,IAAA,OAAO,SAAA,CAAU,IAAI,CAAA,KAAM,IAAA;AAAA,EAC7B;AACF;AAMO,MAAM,0BAA0B,CACrC,MAAA,KAEA,OAAO,UAAA,KAAe,iCAAA,IACtB,OAAO,IAAA,KAAS;;;;"}
1
+ {"version":3,"file":"TemplateEntityV1beta3.esm.js","sources":["../src/TemplateEntityV1beta3.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 */\n\nimport {\n Entity,\n entityKindSchemaValidator,\n KindValidator,\n} from '@backstage/catalog-model';\nimport { JsonObject } from '@backstage/types';\nimport schema from './Template.v1beta3.schema.json';\n\n/**\n * Backstage catalog Template kind Entity. Templates are used by the Scaffolder\n * plugin to create new entities, such as Components.\n *\n * @public\n */\nexport interface TemplateEntityV1beta3 extends Entity {\n /**\n * The apiVersion string of the TaskSpec.\n */\n apiVersion: 'scaffolder.backstage.io/v1beta3';\n /**\n * The kind of the entity\n */\n kind: 'Template';\n /**\n * The specification of the Template Entity\n */\n spec: {\n /**\n * The type that the Template will create. For example service, website or library.\n */\n type: string;\n\n /**\n * Template specific configuration of the presentation layer.\n */\n presentation?: TemplatePresentationV1beta3;\n\n /**\n * Recovery strategy for the template\n */\n EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;\n\n /**\n * Form decorators to be run before submission.\n */\n formDecorators?: { id: string; input?: JsonObject }[];\n\n /**\n * Form decorators to be run before submission.\n *\n * @deprecated Use `spec.formDecorators` instead.\n */\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n\n /**\n * This is a JSONSchema or an array of JSONSchema's which is used to render a form in the frontend\n * to collect user input and validate it against that schema. This can then be used in the `steps` part below to template\n * variables passed from the user into each action in the template.\n */\n parameters?: TemplateParametersV1beta3 | TemplateParametersV1beta3[];\n /**\n * Configuration for secrets that are passed during task creation.\n * The schema field contains a JSONSchema used to validate secrets.\n */\n secrets?: {\n schema?: JsonObject;\n };\n /**\n * A list of steps to be executed in sequence which are defined by the template. These steps are a list of the underlying\n * javascript action and some optional input parameters that may or may not have been collected from the end user.\n */\n steps: Array<TemplateEntityStepV1beta3>;\n /**\n * The output is an object where template authors can pull out information from template actions and return them in a known standard way.\n */\n output?: { [name: string]: string };\n /**\n * The owner entityRef of the TemplateEntity\n */\n owner?: string;\n /**\n * Specifies the lifecycle phase of the TemplateEntity\n */\n lifecycle?: string;\n };\n}\n\n/**\n * Depends on how you designed your task you might tailor the behaviour for each of them.\n *\n * @public\n */\nexport interface TemplateRecoveryV1beta3 extends JsonObject {\n /**\n *\n * none - not recover, let the task be marked as failed\n * startOver - do recover, start the execution of the task from the first step.\n *\n * @public\n */\n EXPERIMENTAL_strategy?: 'none' | 'startOver';\n}\n\n/**\n * The presentation of the template.\n *\n * @public\n */\nexport interface TemplatePresentationV1beta3 extends JsonObject {\n /**\n * Overrides default buttons' text\n */\n buttonLabels?: {\n /**\n * The text for the button which leads to the previous template page\n */\n backButtonText?: string;\n /**\n * The text for the button which starts the execution of the template\n */\n createButtonText?: string;\n /**\n * The text for the button which opens template's review/summary\n */\n reviewButtonText?: string;\n };\n}\n\n/**\n * Step that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateEntityStepV1beta3 extends JsonObject {\n id?: string;\n name?: string;\n action: string;\n input?: JsonObject;\n if?: string | boolean;\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * The shape of each entry of parameters which gets rendered\n * as a separate step in the wizard input\n *\n * @public\n */\nexport type TemplateParameterSchema = {\n title: string;\n description?: string;\n presentation?: TemplatePresentationV1beta3;\n steps: Array<{\n title: string;\n description?: string;\n schema: JsonObject;\n }>;\n formDecorators?: { id: string; input?: JsonObject }[];\n /**\n * @deprecated Use {@link TemplateParameterSchema.formDecorators} instead.\n */\n EXPERIMENTAL_formDecorators?: { id: string; input?: JsonObject }[];\n};\n\n/**\n * Parameter that is part of a Template Entity.\n *\n * @public\n */\nexport interface TemplateParametersV1beta3 extends JsonObject {\n 'backstage:permissions'?: TemplatePermissionsV1beta3;\n}\n\n/**\n * Access control properties for parts of a template.\n *\n * @public\n */\nexport interface TemplatePermissionsV1beta3 extends JsonObject {\n tags?: string[];\n}\n\nconst validator = entityKindSchemaValidator(schema);\n\n/**\n * Entity data validator for {@link TemplateEntityV1beta3}.\n *\n * @public\n */\nexport const templateEntityV1beta3Validator: KindValidator = {\n // TODO(freben): Emulate the old KindValidator until we fix that type\n async check(data: Entity) {\n return validator(data) === data;\n },\n};\n\n/**\n * Typeguard for filtering entities and ensuring v1beta3 entities\n * @public\n */\nexport const isTemplateEntityV1beta3 = (\n entity: Entity,\n): entity is TemplateEntityV1beta3 =>\n entity.apiVersion === 'scaffolder.backstage.io/v1beta3' &&\n entity.kind === 'Template';\n"],"names":["schema"],"mappings":";;;AAsMA,MAAM,SAAA,GAAY,0BAA0BA,UAAM,CAAA;AAO3C,MAAM,8BAAA,GAAgD;AAAA;AAAA,EAE3D,MAAM,MAAM,IAAA,EAAc;AACxB,IAAA,OAAO,SAAA,CAAU,IAAI,CAAA,KAAM,IAAA;AAAA,EAC7B;AACF;AAMO,MAAM,0BAA0B,CACrC,MAAA,KAEA,OAAO,UAAA,KAAe,iCAAA,IACtB,OAAO,IAAA,KAAS;;;;"}
package/dist/index.d.ts CHANGED
@@ -170,7 +170,16 @@ interface TemplateEntityV1beta3 extends Entity {
170
170
  */
171
171
  EXPERIMENTAL_recovery?: TemplateRecoveryV1beta3;
172
172
  /**
173
- * Form hooks to be run
173
+ * Form decorators to be run before submission.
174
+ */
175
+ formDecorators?: {
176
+ id: string;
177
+ input?: JsonObject;
178
+ }[];
179
+ /**
180
+ * Form decorators to be run before submission.
181
+ *
182
+ * @deprecated Use `spec.formDecorators` instead.
174
183
  */
175
184
  EXPERIMENTAL_formDecorators?: {
176
185
  id: string;
@@ -277,6 +286,13 @@ type TemplateParameterSchema = {
277
286
  description?: string;
278
287
  schema: JsonObject;
279
288
  }>;
289
+ formDecorators?: {
290
+ id: string;
291
+ input?: JsonObject;
292
+ }[];
293
+ /**
294
+ * @deprecated Use {@link TemplateParameterSchema.formDecorators} instead.
295
+ */
280
296
  EXPERIMENTAL_formDecorators?: {
281
297
  id: string;
282
298
  input?: JsonObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-common",
3
- "version": "2.1.1-next.0",
3
+ "version": "2.2.0",
4
4
  "description": "Common functionalities for the scaffolder, to be shared between scaffolder and scaffolder-backend plugin",
5
5
  "backstage": {
6
6
  "role": "common-library",
@@ -70,11 +70,11 @@
70
70
  "test": "backstage-cli package test"
71
71
  },
72
72
  "dependencies": {
73
- "@backstage/catalog-model": "1.8.1-next.0",
74
- "@backstage/errors": "1.3.1-next.0",
75
- "@backstage/integration": "2.0.2-next.0",
76
- "@backstage/plugin-permission-common": "0.9.9-next.0",
77
- "@backstage/types": "1.2.2",
73
+ "@backstage/catalog-model": "^1.9.0",
74
+ "@backstage/errors": "^1.3.1",
75
+ "@backstage/integration": "^2.0.2",
76
+ "@backstage/plugin-permission-common": "^0.9.9",
77
+ "@backstage/types": "^1.2.2",
78
78
  "@microsoft/fetch-event-source": "^2.0.1",
79
79
  "@types/json-schema": "^7.0.9",
80
80
  "cross-fetch": "^4.0.0",
@@ -83,8 +83,8 @@
83
83
  "zen-observable": "^0.10.0"
84
84
  },
85
85
  "devDependencies": {
86
- "@backstage/cli": "0.36.2-next.0",
87
- "@backstage/test-utils": "1.7.18-next.0",
86
+ "@backstage/cli": "^0.36.2",
87
+ "@backstage/test-utils": "^1.7.18",
88
88
  "msw": "^1.0.0"
89
89
  },
90
90
  "module": "./dist/index.esm.js"