| |
| |
| |
| |
| |
| |
| |
| import * as zod from "zod"; |
|
|
| |
| |
| |
| |
| export const HealthCheckResponse = zod.object({ |
| status: zod.string(), |
| }); |
|
|
| |
| |
| |
| |
| export const GetConfigTokenResponse = zod.object({ |
| configured: zod.boolean(), |
| token: zod.string().nullish(), |
| }); |
|
|
| |
| |
| |
| |
| export const SetConfigTokenBody = zod.object({ |
| token: zod.string(), |
| }); |
|
|
| export const SetConfigTokenResponse = zod.object({ |
| success: zod.boolean(), |
| message: zod.string().optional(), |
| }); |
|
|
| |
| |
| |
| |
| export const DeleteConfigTokenResponse = zod.object({ |
| success: zod.boolean(), |
| message: zod.string().optional(), |
| }); |
|
|
| |
| |
| |
| |
| export const generateImageBodyStyleDefault = `realistic`; |
| export const generateImageBodyAspectRatioDefault = `1:1`; |
| export const generateImageBodyModelDefault = `grok`; |
| export const generateImageBodyIsPrivateDefault = false; |
|
|
| export const GenerateImageBody = zod.object({ |
| prompt: zod.string().describe("Text description for image generation"), |
| style: zod |
| .enum([ |
| "none", |
| "realistic", |
| "anime", |
| "artistic", |
| "cartoon", |
| "sketch", |
| "oil_painting", |
| "watercolor", |
| "digital_art", |
| ]) |
| .default(generateImageBodyStyleDefault) |
| .describe("Style of image to generate"), |
| aspectRatio: zod |
| .enum(["1:1", "16:9", "9:16", "4:3", "3:4", "2:3", "3:2"]) |
| .default(generateImageBodyAspectRatioDefault) |
| .describe("Aspect ratio for the image"), |
| model: zod |
| .enum([ |
| "grok", |
| "meta", |
| "imagen-pro", |
| "imagen-4", |
| "imagen-flash", |
| "nano-banana-pro", |
| "nano-banana-2", |
| ]) |
| .default(generateImageBodyModelDefault) |
| .describe("AI model to use"), |
| resolution: zod |
| .enum(["1K", "2K", "4K"]) |
| .optional() |
| .describe( |
| "Output resolution for supported models (Nano Banana Pro \/ Nano Banana 2)", |
| ), |
| referenceImageBase64: zod |
| .string() |
| .optional() |
| .describe( |
| "Base64-encoded reference image for image-to-image generation (optional)", |
| ), |
| referenceImageMime: zod |
| .string() |
| .optional() |
| .describe("MIME type of the reference image (e.g. image\/jpeg)"), |
| isPrivate: zod |
| .boolean() |
| .default(generateImageBodyIsPrivateDefault) |
| .describe( |
| "Whether this image should be private (only visible to the creator)", |
| ), |
| }); |
|
|
| export const GenerateImageResponse = zod.object({ |
| id: zod.number(), |
| imageUrl: zod.string(), |
| prompt: zod.string(), |
| style: zod.string(), |
| aspectRatio: zod.string(), |
| model: zod.string(), |
| createdAt: zod.coerce.date(), |
| apiDebug: zod.object({ |
| requestUrl: zod.string(), |
| requestMethod: zod.string(), |
| requestHeaders: zod.record(zod.string(), zod.string()), |
| requestBody: zod.object({}).passthrough(), |
| responseStatus: zod.number(), |
| responseBody: zod.object({}).passthrough(), |
| durationMs: zod.number(), |
| usedFallback: zod.boolean(), |
| fallbackReason: zod.string().optional(), |
| }), |
| }); |
|
|
| |
| |
| |
| |
| export const getImageHistoryQueryLimitDefault = 20; |
| export const getImageHistoryQueryOffsetDefault = 0; |
|
|
| export const GetImageHistoryQueryParams = zod.object({ |
| limit: zod.coerce.number().default(getImageHistoryQueryLimitDefault), |
| offset: zod.coerce.number().default(getImageHistoryQueryOffsetDefault), |
| }); |
|
|
| export const GetImageHistoryResponse = zod.object({ |
| images: zod.array( |
| zod.object({ |
| id: zod.number(), |
| imageUrl: zod.string(), |
| prompt: zod.string(), |
| style: zod.string(), |
| aspectRatio: zod.string(), |
| model: zod.string(), |
| isPrivate: zod.boolean(), |
| userId: zod.number().nullish(), |
| createdAt: zod.coerce.date(), |
| }), |
| ), |
| total: zod.number(), |
| }); |
|
|
| |
| |
| |
| |
| export const DeleteImageParams = zod.object({ |
| id: zod.coerce.number(), |
| }); |
|
|
| export const DeleteImageResponse = zod.object({ |
| success: zod.boolean(), |
| message: zod.string().optional(), |
| }); |
|
|