Backstage
    Preparing search index...
    • This function is used to create new template actions to get type safety. Will convert zod schemas to json schemas for use throughout the system.

      Type Parameters

      • TInputSchema extends { [key: string]: (zImpl: __module) => ZodType } | ((zImpl: __module) => ZodType)
      • TOutputSchema extends { [key: string]: (zImpl: __module) => ZodType } | ((zImpl: __module) => ZodType)

      Parameters

      • action: TemplateActionOptions<
            TInputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                ? {
                    [key in string | number | symbol]: TypeOf<
                        ReturnType<TInputSchema<TInputSchema>[key]>,
                    >
                }
                : TInputSchema extends (zImpl: __module) => ZodType
                    ? TypeOf<ReturnType<TInputSchema<TInputSchema>>>
                    : never,
            TOutputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                ? {
                    [key in string | number | symbol]: TypeOf<
                        ReturnType<TOutputSchema<TOutputSchema>[key]>,
                    >
                }
                : TOutputSchema extends (zImpl: __module) => ZodType
                    ? TypeOf<ReturnType<TOutputSchema<TOutputSchema>>>
                    : never,
            TInputSchema,
            TOutputSchema,
            "v2",
        >

      Returns TemplateAction<
          Expand<
              {
                  [K in string
                  | number
                  | symbol as undefined extends (
                      TInputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<ReturnType<(...)[(...)]>>
                          }
                          : TInputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TInputSchema<(...)>>>
                              : never
                  )[K]
                      ? never
                      : K]: (
                      TInputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<
                                  ReturnType<TInputSchema<(...)>[key]>,
                              >
                          }
                          : TInputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TInputSchema<TInputSchema>>>
                              : never
                  )[K]
              } & {
                  [K in string
                  | number
                  | symbol as undefined extends (
                      TInputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<ReturnType<(...)[(...)]>>
                          }
                          : TInputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TInputSchema<(...)>>>
                              : never
                  )[K]
                      ? K
                      : never]?: (
                      TInputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<ReturnType<(...)[(...)]>>
                          }
                          : TInputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TInputSchema<(...)>>>
                              : never
                  )[K]
              },
          >,
          Expand<
              {
                  [K in string
                  | number
                  | symbol as undefined extends (
                      TOutputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<ReturnType<(...)[(...)]>>
                          }
                          : TOutputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TOutputSchema<(...)>>>
                              : never
                  )[K]
                      ? never
                      : K]: (
                      TOutputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<
                                  ReturnType<TOutputSchema<(...)>[key]>,
                              >
                          }
                          : TOutputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TOutputSchema<TOutputSchema>>>
                              : never
                  )[K]
              } & {
                  [K in string
                  | number
                  | symbol as undefined extends (
                      TOutputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<ReturnType<(...)[(...)]>>
                          }
                          : TOutputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TOutputSchema<(...)>>>
                              : never
                  )[K]
                      ? K
                      : never]?: (
                      TOutputSchema extends { [key: string]: (zImpl: __module) => ZodType }
                          ? {
                              [key in string | number | symbol]: output<ReturnType<(...)[(...)]>>
                          }
                          : TOutputSchema extends (zImpl: __module) => ZodType
                              ? output<ReturnType<TOutputSchema<(...)>>>
                              : never
                  )[K]
              },
          >,
          "v2",
      >