Repository navigation
Expand file tree
/
Copy pathtypes.ts
More file actions
325 lines (276 loc) · 7.62 KB
/
Copy pathtypes.ts
File metadata and controls
325 lines (276 loc) · 7.62 KB
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
export type ImageSize = '1K' | '2K' | '4K';
export type VideoResolution = '720p' | '1080p';
export type AspectRatio = '16:9' | '1:1' | '3:4' | '4:3' | '9:16';
export type MediaType = 'image' | 'video' | 'analyze' | 'speech';
export type AIProvider = 'google' | 'openai' | 'anthropic' | 'xai' | 'deepseek' | 'openrouter';
export type ImageModelId = 'gemini-3-pro-image-preview' | 'gemini-2.5-flash-image';
export type VideoModelId = 'veo-3.1-generate-preview' | 'veo-3.1-fast-generate-preview';
export type VideoDuration = 'auto' | '5' | '10';
export interface GenerationConfig {
prompt: string;
size: ImageSize;
aspectRatio: AspectRatio;
}
export interface GeneratedImage {
url: string;
prompt: string;
timestamp: number;
}
export interface Attachment {
base64: string;
mimeType: string;
name: string;
preview: string; // Data URL for UI display
}
export interface ApiError {
message: string;
}
export interface AIStudioClient {
hasSelectedApiKey: () => Promise<boolean>;
openSelectKey: () => Promise<void>;
}
export type SubscriptionTier = 'free' | 'paid' | 'reseller';
export type UserRole = 'user' | 'admin' | 'superuser' | 'beta';
export interface UserApiKeys {
google?: string;
openai?: string;
anthropic?: string;
xai?: string;
deepseek?: string;
openrouter?: string;
}
export interface User {
id: string;
name: string;
email: string;
avatar?: string;
subscriptionTier: SubscriptionTier;
role: UserRole;
joinedAt: number;
permissions?: AdminPermission[];
apiKeys?: UserApiKeys;
}
export type AdminPermission = 'manage_users' | 'manage_ads' | 'manage_finance' | 'edit_landing' | 'manage_settings';
// --- Animation Types ---
export interface AnimationSettings {
fps: '24' | '30' | '60';
duration: '5' | '10';
motionBlur: 'none' | 'low' | 'high';
}
export interface Creation {
id: string;
type: MediaType;
url: string; // Unified URL for image or video
thumbnailUrl: string; // Smaller for storage efficiency
prompt: string;
timestamp: number;
size: ImageSize | VideoResolution;
aspectRatio: AspectRatio;
modelId?: string;
provider?: AIProvider;
animationSettings?: AnimationSettings;
}
export interface GenerationHistory {
count: number;
postProductionCount: number; // Separate limit for editing
lastReset: number; // Timestamp of month start
}
export type StorageType = 'local' | 'google-drive' | 'onedrive';
export interface StorageConnection {
type: StorageType;
isConnected: boolean;
name: string;
icon: string;
}
// --- Editor Types ---
export type FilterType = 'none' | 'noir' | 'vogue' | 'platinum' | 'golden' | 'cyber';
export type AudioTrack = 'none' | 'cinematic' | 'ambient' | 'phonk' | 'orchestral' | 'voiceover';
export type SnapLensId = 'none' | 'dog-ears' | 'cyber-mask' | 'neon-glasses' | 'glitter';
export interface EditorState {
filter: FilterType;
audio: AudioTrack;
showCaptions: boolean;
stickers: string[];
lens: SnapLensId;
voiceUrl?: string;
}
// --- Analysis & Speech Types ---
export interface AnalysisResult {
text: string;
timestamp: number;
}
export interface VoiceConfig {
voiceName: 'Puck' | 'Charon' | 'Kore' | 'Fenrir' | 'Zephyr';
speed: number;
}
// --- Advertising Types ---
export type AdPlacement = 'dashboard-main' | 'studio-sidebar' | 'landing-footer';
export interface Advertisement {
id: string;
clientName: string;
imageUrl: string;
linkUrl: string;
placement: AdPlacement;
isActive: boolean;
impressions: number;
clicks: number;
revenue: number;
}
export interface AdAnalytics {
impressions: number;
clicks: number;
ctr: number;
}
// --- Admin & Global Settings Types ---
export interface GlobalSettings {
// White Label
appName: string;
brandColor: string;
inkColor?: string; // Background color
logoUrl?: string;
// Integrations
stripePublicKey: string;
stripeSecretKey: string;
figmaToken: string;
canvaId: string;
snapchatAppId: string;
supabaseUrl?: string;
supabaseKey?: string;
// Module Toggles
enableFilters: boolean;
enableAudio: boolean;
enableSnapLenses: boolean;
enableCloudImport: boolean;
enabledProviders?: AIProvider[]; // Which providers are allowed globally
// Contact & Domain
emailRouting?: EmailRouting;
domainConfig?: DomainConfig;
socialLinks?: SocialLink[];
}
export interface EmailRouting {
waitlistEmail: string;
newsEmail: string;
contactEmail: string;
abuseEmail: string;
}
export interface DomainConfig {
customDomain: string;
dnsVerified: boolean;
}
export type SocialPlatform = 'Twitter' | 'Instagram' | 'LinkedIn' | 'Discord' | 'TikTok' | 'YouTube';
export interface SocialLink {
id: string;
platform: SocialPlatform;
url: string;
}
export interface LandingPageFeature {
id: string;
title: string;
description: string;
icon?: string;
}
export interface FooterLink {
id: string;
label: string;
url: string;
isVisible: boolean;
}
export interface LandingPageContent {
heroHeadline: string;
heroSubheadline: string;
ctaText: string;
features: LandingPageFeature[];
footerLinks: FooterLink[];
}
export interface WaitlistEntry {
email: string;
timestamp: number;
}
export interface StudioState {
provider: AIProvider;
mode: MediaType | 'animate' | 'editor';
prompt: string;
imageSize: ImageSize;
videoRes: VideoResolution;
aspectRatio: AspectRatio;
videoDuration: VideoDuration;
attachments: Attachment[];
imageModel: ImageModelId;
videoModel: VideoModelId;
editor: EditorState;
animation: AnimationSettings;
analysis?: AnalysisResult;
voice: VoiceConfig;
}
export interface MuseMessage {
id: string;
role: 'user' | 'model';
text: string;
isThinking?: boolean;
}
export interface AgentActions {
setMode: (mode: MediaType | 'animate' | 'editor') => void;
setPrompt: (prompt: string) => void;
setSettings: (settings: { size?: string; aspectRatio?: string; videoRes?: string }) => void;
navigate: (view: 'studio' | 'dashboard' | 'admin') => void;
}
export type IntegrationCategory = 'payment' | 'design' | 'effects' | 'social';
export type IntegrationProvider = 'Stripe' | 'Figma' | 'Canva' | 'Snapchat' | 'YouTube' | 'TikTok' | 'Shopify' | 'Webhook';
export interface Integration {
id: string;
provider: IntegrationProvider;
category: IntegrationCategory;
name: string;
isConnected: boolean;
config?: any;
}
// --- Subscription Types ---
export type BillingPeriod = 'monthly' | 'annual';
export interface SubscriptionPlan {
tier: SubscriptionTier;
name: string;
priceMonthly: number;
priceAnnual: number;
features: string[];
}
export interface Invoice {
id: string;
userId: string;
amount: number;
date: number;
status: 'paid' | 'pending';
planName: string;
}
export interface EmailTemplate {
id: 'welcome' | 'invoice_receipt';
subject: string;
body: string;
}
export interface GatewayConfig {
stripeEnabled: boolean;
testMode: boolean;
webhookSecret: string;
}
// --- Affiliate Types ---
export interface AffiliateSettings {
programEnabled: boolean;
commissionRate: number; // Percentage
cookieDuration: number; // Days
payoutThreshold: number; // Currency
}
export interface AffiliatePartner {
id: string;
userId: string;
name: string;
status: 'active' | 'pending' | 'rejected';
totalEarnings: number;
referralLink: string;
}
// --- Beta Program ---
export interface BetaInvite {
code: string;
maxUses: number;
usedCount: number;
expiresAt?: number;
createdAt: number;
}