feat: tweak actions registry format

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-06-11 19:06:35 +02:00
parent f7e7469944
commit 320d12b726
4 changed files with 25 additions and 15 deletions
+8 -5
View File
@@ -3,6 +3,7 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { AnyZodObject } from 'zod';
import { AuthorizePermissionRequest } from '@backstage/plugin-permission-common';
import { AuthorizePermissionResponse } from '@backstage/plugin-permission-common';
import { Config } from '@backstage/config';
@@ -27,10 +28,9 @@ import { Readable } from 'stream';
import type { Request as Request_2 } from 'express';
import type { Response as Response_2 } from 'express';
import { z } from 'zod';
import { ZodType } from 'zod';
// @public (undocumented)
export type ActionsRegistryActionContext<TInputSchema extends ZodType> = {
export type ActionsRegistryActionContext<TInputSchema extends AnyZodObject> = {
input: z.infer<TInputSchema>;
logger: LoggerService;
credentials: BackstageCredentials;
@@ -38,8 +38,8 @@ export type ActionsRegistryActionContext<TInputSchema extends ZodType> = {
// @public (undocumented)
export type ActionsRegistryActionOptions<
TInputSchema extends ZodType,
TOutputSchema extends ZodType,
TInputSchema extends AnyZodObject,
TOutputSchema extends AnyZodObject,
> = {
name: string;
title: string;
@@ -60,7 +60,10 @@ export type ActionsRegistryActionOptions<
// @public (undocumented)
export interface ActionsRegistryService {
// (undocumented)
register<TInputSchema extends ZodType, TOutputSchema extends ZodType>(
register<
TInputSchema extends AnyZodObject,
TOutputSchema extends AnyZodObject,
>(
options: ActionsRegistryActionOptions<TInputSchema, TOutputSchema>,
): void;
}
@@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { z, ZodType } from 'zod';
import { z, AnyZodObject } from 'zod';
import { LoggerService } from './LoggerService';
import { BackstageCredentials } from './AuthService';
/**
* @public
*/
export type ActionsRegistryActionContext<TInputSchema extends ZodType> = {
export type ActionsRegistryActionContext<TInputSchema extends AnyZodObject> = {
input: z.infer<TInputSchema>;
logger: LoggerService;
credentials: BackstageCredentials;
@@ -30,8 +30,8 @@ export type ActionsRegistryActionContext<TInputSchema extends ZodType> = {
* @public
*/
export type ActionsRegistryActionOptions<
TInputSchema extends ZodType,
TOutputSchema extends ZodType,
TInputSchema extends AnyZodObject,
TOutputSchema extends AnyZodObject,
> = {
name: string;
title: string;
@@ -53,7 +53,10 @@ export type ActionsRegistryActionOptions<
* @public
*/
export interface ActionsRegistryService {
register<TInputSchema extends ZodType, TOutputSchema extends ZodType>(
register<
TInputSchema extends AnyZodObject,
TOutputSchema extends AnyZodObject,
>(
options: ActionsRegistryActionOptions<TInputSchema, TOutputSchema>,
): void;
}