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
@@ -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;
}