File size: 3,761 Bytes
5ef6e9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
/**
 * Generated by orval v8.5.3 🍺
 * Do not edit manually.
 * Api
 * API specification
 * OpenAPI spec version: 0.1.0
 */
export interface TokenStatusResponse {
  configured: boolean;
  token?: string | null;
}

export interface SetTokenBody {
  token: string;
}

export interface HealthStatus {
  status: string;
}

/**
 * Style of image to generate
 */
export type GenerateImageBodyStyle =
  (typeof GenerateImageBodyStyle)[keyof typeof GenerateImageBodyStyle];

export const GenerateImageBodyStyle = {
  none: "none",
  realistic: "realistic",
  anime: "anime",
  artistic: "artistic",
  cartoon: "cartoon",
  sketch: "sketch",
  oil_painting: "oil_painting",
  watercolor: "watercolor",
  digital_art: "digital_art",
} as const;

/**
 * Aspect ratio for the image
 */
export type GenerateImageBodyAspectRatio =
  (typeof GenerateImageBodyAspectRatio)[keyof typeof GenerateImageBodyAspectRatio];

export const GenerateImageBodyAspectRatio = {
  "1:1": "1:1",
  "16:9": "16:9",
  "9:16": "9:16",
  "4:3": "4:3",
  "3:4": "3:4",
  "2:3": "2:3",
  "3:2": "3:2",
} as const;

/**
 * AI model to use
 */
export type GenerateImageBodyModel =
  (typeof GenerateImageBodyModel)[keyof typeof GenerateImageBodyModel];

export const GenerateImageBodyModel = {
  grok: "grok",
  meta: "meta",
  "imagen-pro": "imagen-pro",
  "imagen-4": "imagen-4",
  "imagen-flash": "imagen-flash",
  "nano-banana-pro": "nano-banana-pro",
  "nano-banana-2": "nano-banana-2",
} as const;

/**
 * Output resolution for supported models (Nano Banana Pro / Nano Banana 2)
 */
export type GenerateImageBodyResolution =
  (typeof GenerateImageBodyResolution)[keyof typeof GenerateImageBodyResolution];

export const GenerateImageBodyResolution = {
  "1K": "1K",
  "2K": "2K",
  "4K": "4K",
} as const;

export interface GenerateImageBody {
  /** Text description for image generation */
  prompt: string;
  /** Style of image to generate */
  style?: GenerateImageBodyStyle;
  /** Aspect ratio for the image */
  aspectRatio?: GenerateImageBodyAspectRatio;
  /** AI model to use */
  model?: GenerateImageBodyModel;
  /** Output resolution for supported models (Nano Banana Pro / Nano Banana 2) */
  resolution?: GenerateImageBodyResolution;
  /** Base64-encoded reference image for image-to-image generation (optional) */
  referenceImageBase64?: string;
  /** MIME type of the reference image (e.g. image/jpeg) */
  referenceImageMime?: string;
  /** Whether this image should be private (only visible to the creator) */
  isPrivate?: boolean;
}

export type ApiDebugInfoRequestHeaders = { [key: string]: string };

export type ApiDebugInfoRequestBody = { [key: string]: unknown };

export type ApiDebugInfoResponseBody = { [key: string]: unknown };

export interface ApiDebugInfo {
  requestUrl: string;
  requestMethod: string;
  requestHeaders: ApiDebugInfoRequestHeaders;
  requestBody: ApiDebugInfoRequestBody;
  responseStatus: number;
  responseBody: ApiDebugInfoResponseBody;
  durationMs: number;
  usedFallback: boolean;
  fallbackReason?: string;
}

export interface GenerateImageResponse {
  id: number;
  imageUrl: string;
  prompt: string;
  style: string;
  aspectRatio: string;
  model: string;
  createdAt: string;
  apiDebug: ApiDebugInfo;
}

export interface ImageRecord {
  id: number;
  imageUrl: string;
  prompt: string;
  style: string;
  aspectRatio: string;
  model: string;
  isPrivate: boolean;
  userId?: number | null;
  createdAt: string;
}

export interface ImageHistoryResponse {
  images: ImageRecord[];
  total: number;
}

export interface SuccessResponse {
  success: boolean;
  message?: string;
}

export interface ErrorResponse {
  error: string;
  message: string;
}

export type GetImageHistoryParams = {
  limit?: number;
  offset?: number;
};