@backstage/plugin-scaffolder-backend 3.3.0-next.1 → 3.3.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.
@@ -1 +0,0 @@
1
- {"version":3,"file":"createExecuteTemplateAction.cjs.js","sources":["../../src/actions/createExecuteTemplateAction.ts"],"sourcesContent":["/*\n * Copyright 2026 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 { ActionsRegistryService } from '@backstage/backend-plugin-api/alpha';\nimport { ScaffolderService } from '@backstage/plugin-scaffolder-node';\nimport { JsonValue } from '@backstage/types';\n\nexport const createExecuteTemplateAction = ({\n actionsRegistry,\n scaffolderService,\n}: {\n actionsRegistry: ActionsRegistryService;\n scaffolderService: ScaffolderService;\n}) => {\n actionsRegistry.register({\n name: 'execute-template',\n title: 'Execute Scaffolder Template',\n attributes: {\n destructive: true,\n readOnly: false,\n idempotent: false,\n },\n description: `Executes a Scaffolder template with its template ref and input parameter values.\nThe template is run using the credentials provided to this action, and respects any RBAC permissions associated with those credentials.\nReturns a taskId that can be used to track execution progress.\nUse the catalog.get-catalog-entity action to fetch the Template entity and discover its parameter schema and secrets definition before calling this action.`,\n schema: {\n input: z =>\n z.object({\n templateRef: z\n .string()\n .describe(\n 'The template entity reference to execute, e.g. \"template:default/my-template\"',\n ),\n values: z\n .record(z.unknown())\n .describe(\n 'Input parameter values required by the template. Use catalog.get-catalog-entity to discover the required parameters for the template.',\n ),\n secrets: z\n .record(z.string())\n .optional()\n .describe(\n 'Optional secrets to pass to the template execution. Use catalog.get-catalog-entity to discover the secrets definition on the Template entity.',\n ),\n }),\n output: z =>\n z.object({\n taskId: z\n .string()\n .describe(\n 'The task ID for the scaffolder execution. Use this to track progress or retrieve logs.',\n ),\n }),\n },\n action: async ({ input, credentials }) => {\n const { taskId } = await scaffolderService.scaffold(\n {\n templateRef: input.templateRef,\n values: input.values as Record<string, JsonValue>,\n ...(input.secrets && { secrets: input.secrets }),\n },\n { credentials },\n );\n\n return { output: { taskId } };\n },\n });\n};\n"],"names":[],"mappings":";;AAmBO,MAAM,8BAA8B,CAAC;AAAA,EAC1C,eAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,eAAA,CAAgB,QAAA,CAAS;AAAA,IACvB,IAAA,EAAM,kBAAA;AAAA,IACN,KAAA,EAAO,6BAAA;AAAA,IACP,UAAA,EAAY;AAAA,MACV,WAAA,EAAa,IAAA;AAAA,MACb,QAAA,EAAU,KAAA;AAAA,MACV,UAAA,EAAY;AAAA,KACd;AAAA,IACA,WAAA,EAAa,CAAA;AAAA;AAAA;AAAA,2JAAA,CAAA;AAAA,IAIb,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,CAAA,CAAA,KACL,CAAA,CAAE,MAAA,CAAO;AAAA,QACP,WAAA,EAAa,CAAA,CACV,MAAA,EAAO,CACP,QAAA;AAAA,UACC;AAAA,SACF;AAAA,QACF,QAAQ,CAAA,CACL,MAAA,CAAO,CAAA,CAAE,OAAA,EAAS,CAAA,CAClB,QAAA;AAAA,UACC;AAAA,SACF;AAAA,QACF,OAAA,EAAS,EACN,MAAA,CAAO,CAAA,CAAE,QAAQ,CAAA,CACjB,UAAS,CACT,QAAA;AAAA,UACC;AAAA;AACF,OACH,CAAA;AAAA,MACH,MAAA,EAAQ,CAAA,CAAA,KACN,CAAA,CAAE,MAAA,CAAO;AAAA,QACP,MAAA,EAAQ,CAAA,CACL,MAAA,EAAO,CACP,QAAA;AAAA,UACC;AAAA;AACF,OACH;AAAA,KACL;AAAA,IACA,MAAA,EAAQ,OAAO,EAAE,KAAA,EAA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