#Importing Zod type inferred by z.infer into trigger

1 messages · Page 1 of 1 (latest)

fossil ridge
#

Hello - I have a problem where I'm extending a base item like so in my package /embeddings:

const BaseUpsertItemSchema = z.object({
text: z.string(),
id: z.string().uuid(),
})

type BaseUpsertItem = z.infer<typeof BaseUpsertItemSchema>

export interface UpsertItem<T extends ValidIndexNames> extends BaseUpsertItem {
metadata: MetadataTypeMap[T]
}

and then trying to use UpsertItem in my package for trigger jobs. This doesn't work - I've verified this type of logic works within the package where it is defined

bold trail
#

When you say it doesn't work can you be a bit more specific?

#

What error are you seeing? Is it an error in your editor or when the code runs?