From 6c6fb4a73bb474dfc3e1999fc75ac1860dfd382f Mon Sep 17 00:00:00 2001 From: benjdlambert Date: Wed, 4 Jun 2025 08:19:22 +0200 Subject: [PATCH] chore: migrate to new actions format Signed-off-by: benjdlambert Signed-off-by: benjdlambert --- .changeset/mighty-windows-boil.md | 5 ++ .../report.api.md | 11 ++-- .../src/actions/createProject.ts | 60 +++++++++---------- 3 files changed, 38 insertions(+), 38 deletions(-) create mode 100644 .changeset/mighty-windows-boil.md diff --git a/.changeset/mighty-windows-boil.md b/.changeset/mighty-windows-boil.md new file mode 100644 index 0000000000..52eb024db1 --- /dev/null +++ b/.changeset/mighty-windows-boil.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend-module-sentry': patch +--- + +Migrate to new actions format diff --git a/plugins/scaffolder-backend-module-sentry/report.api.md b/plugins/scaffolder-backend-module-sentry/report.api.md index 973ef9844c..8c716b3ab3 100644 --- a/plugins/scaffolder-backend-module-sentry/report.api.md +++ b/plugins/scaffolder-backend-module-sentry/report.api.md @@ -5,7 +5,6 @@ ```ts import { BackendFeature } from '@backstage/backend-plugin-api'; import { Config } from '@backstage/config'; -import { JsonObject } from '@backstage/types'; import { TemplateAction } from '@backstage/plugin-scaffolder-node'; // @public @@ -16,11 +15,13 @@ export function createSentryCreateProjectAction(options: { organizationSlug: string; teamSlug: string; name: string; - slug?: string; - authToken?: string; + slug?: string | undefined; + authToken?: string | undefined; }, - JsonObject, - 'v1' + { + [x: string]: any; + }, + 'v2' >; // @public diff --git a/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts b/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts index 6c173deb59..226c31bd05 100644 --- a/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts +++ b/plugins/scaffolder-backend-module-sentry/src/actions/createProject.ts @@ -31,42 +31,36 @@ import { Config } from '@backstage/config'; export function createSentryCreateProjectAction(options: { config: Config }) { const { config } = options; - return createTemplateAction<{ - organizationSlug: string; - teamSlug: string; - name: string; - slug?: string; - authToken?: string; - }>({ + return createTemplateAction({ id: 'sentry:project:create', schema: { input: { - required: ['organizationSlug', 'teamSlug', 'name'], - type: 'object', - properties: { - organizationSlug: { - title: 'The slug of the organization the team belongs to', - type: 'string', - }, - teamSlug: { - title: 'The slug of the team to create a new project for', - type: 'string', - }, - name: { - title: 'The name for the new project', - type: 'string', - }, - slug: { - title: - 'Optional slug for the new project. If not provided a slug is generated from the name', - type: 'string', - }, - authToken: { - title: - 'authenticate via bearer auth token. Requires scope: project:write', - type: 'string', - }, - }, + organizationSlug: z => + z.string({ + description: 'The slug of the organization the team belongs to', + }), + teamSlug: z => + z.string({ + description: 'The slug of the team to create a new project for', + }), + name: z => + z.string({ + description: 'The name for the new project', + }), + slug: z => + z + .string({ + description: + 'Optional slug for the new project. If not provided a slug is generated from the name', + }) + .optional(), + authToken: z => + z + .string({ + description: + 'authenticate via bearer auth token. Requires scope: project:write', + }) + .optional(), }, }, async handler(ctx) {