UNPKG

@coursebuilder/core

Version:

Core package for Course Builder

236 lines (233 loc) 8.95 kB
import { z } from 'zod'; declare const productSchema: z.ZodObject<{ id: z.ZodString; organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>; name: z.ZodString; key: z.ZodNullable<z.ZodOptional<z.ZodString>>; type: z.ZodDefault<z.ZodEnum<["live", "self-paced", "membership", "cohort"]>>; fields: z.ZodObject<{ body: z.ZodOptional<z.ZodNullable<z.ZodString>>; description: z.ZodOptional<z.ZodNullable<z.ZodString>>; slug: z.ZodString; image: z.ZodNullable<z.ZodOptional<z.ZodObject<{ url: z.ZodString; alt: z.ZodNullable<z.ZodOptional<z.ZodString>>; width: z.ZodNullable<z.ZodOptional<z.ZodNumber>>; height: z.ZodNullable<z.ZodOptional<z.ZodNumber>>; }, "strip", z.ZodTypeAny, { url: string; alt?: string | null | undefined; width?: number | null | undefined; height?: number | null | undefined; }, { url: string; alt?: string | null | undefined; width?: number | null | undefined; height?: number | null | undefined; }>>>; action: z.ZodDefault<z.ZodNullable<z.ZodOptional<z.ZodString>>>; state: z.ZodDefault<z.ZodEnum<["draft", "published", "archived", "deleted"]>>; visibility: z.ZodDefault<z.ZodEnum<["public", "private", "unlisted"]>>; }, "strip", z.ZodTypeAny, { slug: string; action: string | null; state: "draft" | "published" | "archived" | "deleted"; visibility: "public" | "private" | "unlisted"; body?: string | null | undefined; description?: string | null | undefined; image?: { url: string; alt?: string | null | undefined; width?: number | null | undefined; height?: number | null | undefined; } | null | undefined; }, { slug: string; body?: string | null | undefined; description?: string | null | undefined; image?: { url: string; alt?: string | null | undefined; width?: number | null | undefined; height?: number | null | undefined; } | null | undefined; action?: string | null | undefined; state?: "draft" | "published" | "archived" | "deleted" | undefined; visibility?: "public" | "private" | "unlisted" | undefined; }>; createdAt: z.ZodNullable<z.ZodDate>; status: z.ZodDefault<z.ZodNumber>; quantityAvailable: z.ZodDefault<z.ZodNumber>; price: z.ZodOptional<z.ZodNullable<z.ZodObject<{ id: z.ZodString; productId: z.ZodNullable<z.ZodOptional<z.ZodString>>; organizationId: z.ZodNullable<z.ZodOptional<z.ZodString>>; nickname: z.ZodNullable<z.ZodOptional<z.ZodString>>; status: z.ZodDefault<z.ZodNumber>; unitAmount: z.ZodEffects<z.ZodNumber, number, number>; createdAt: z.ZodNullable<z.ZodDate>; fields: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>; }, "strip", z.ZodTypeAny, { id: string; createdAt: Date | null; fields: Record<string, any>; status: number; unitAmount: number; organizationId?: string | null | undefined; productId?: string | null | undefined; nickname?: string | null | undefined; }, { id: string; createdAt: Date | null; unitAmount: number; fields?: Record<string, any> | undefined; status?: number | undefined; organizationId?: string | null | undefined; productId?: string | null | undefined; nickname?: string | null | undefined; }>>>; resources: z.ZodNullable<z.ZodDefault<z.ZodArray<z.ZodObject<{ resourceId: z.ZodString; productId: z.ZodString; position: z.ZodDefault<z.ZodNumber>; metadata: z.ZodNullable<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodAny>>>; createdAt: z.ZodNullable<z.ZodDate>; updatedAt: z.ZodNullable<z.ZodDate>; deletedAt: z.ZodNullable<z.ZodDate>; resource: z.ZodAny; product: z.ZodAny; }, "strip", z.ZodTypeAny, { createdAt: Date | null; productId: string; resourceId: string; position: number; metadata: Record<string, any> | null; updatedAt: Date | null; deletedAt: Date | null; resource?: any; product?: any; }, { createdAt: Date | null; productId: string; resourceId: string; updatedAt: Date | null; deletedAt: Date | null; position?: number | undefined; metadata?: Record<string, any> | null | undefined; resource?: any; product?: any; }>, "many">>>; }, "strip", z.ZodTypeAny, { type: "live" | "self-paced" | "membership" | "cohort"; name: string; id: string; createdAt: Date | null; fields: { slug: string; action: string | null; state: "draft" | "published" | "archived" | "deleted"; visibility: "public" | "private" | "unlisted"; body?: string | null | undefined; description?: string | null | undefined; image?: { url: string; alt?: string | null | undefined; width?: number | null | undefined; height?: number | null | undefined; } | null | undefined; }; status: number; resources: { createdAt: Date | null; productId: string; resourceId: string; position: number; metadata: Record<string, any> | null; updatedAt: Date | null; deletedAt: Date | null; resource?: any; product?: any; }[] | null; quantityAvailable: number; organizationId?: string | null | undefined; key?: string | null | undefined; price?: { id: string; createdAt: Date | null; fields: Record<string, any>; status: number; unitAmount: number; organizationId?: string | null | undefined; productId?: string | null | undefined; nickname?: string | null | undefined; } | null | undefined; }, { name: string; id: string; createdAt: Date | null; fields: { slug: string; body?: string | null | undefined; description?: string | null | undefined; image?: { url: string; alt?: string | null | undefined; width?: number | null | undefined; height?: number | null | undefined; } | null | undefined; action?: string | null | undefined; state?: "draft" | "published" | "archived" | "deleted" | undefined; visibility?: "public" | "private" | "unlisted" | undefined; }; type?: "live" | "self-paced" | "membership" | "cohort" | undefined; status?: number | undefined; organizationId?: string | null | undefined; resources?: { createdAt: Date | null; productId: string; resourceId: string; updatedAt: Date | null; deletedAt: Date | null; position?: number | undefined; metadata?: Record<string, any> | null | undefined; resource?: any; product?: any; }[] | null | undefined; key?: string | null | undefined; quantityAvailable?: number | undefined; price?: { id: string; createdAt: Date | null; unitAmount: number; fields?: Record<string, any> | undefined; status?: number | undefined; organizationId?: string | null | undefined; productId?: string | null | undefined; nickname?: string | null | undefined; } | null | undefined; }>; type Product = z.infer<typeof productSchema>; declare const NewProductSchema: z.ZodObject<{ name: z.ZodString; quantityAvailable: z.ZodDefault<z.ZodNumber>; price: z.ZodDefault<z.ZodNumber>; type: z.ZodOptional<z.ZodDefault<z.ZodEnum<["live", "self-paced", "membership", "cohort"]>>>; state: z.ZodOptional<z.ZodDefault<z.ZodEnum<["draft", "published", "archived", "deleted"]>>>; visibility: z.ZodOptional<z.ZodDefault<z.ZodEnum<["public", "private", "unlisted"]>>>; }, "strip", z.ZodTypeAny, { name: string; quantityAvailable: number; price: number; type?: "live" | "self-paced" | "membership" | "cohort" | undefined; state?: "draft" | "published" | "archived" | "deleted" | undefined; visibility?: "public" | "private" | "unlisted" | undefined; }, { name: string; type?: "live" | "self-paced" | "membership" | "cohort" | undefined; state?: "draft" | "published" | "archived" | "deleted" | undefined; visibility?: "public" | "private" | "unlisted" | undefined; quantityAvailable?: number | undefined; price?: number | undefined; }>; type NewProduct = z.infer<typeof NewProductSchema>; export { type NewProduct, NewProductSchema, type Product, productSchema };