@blinkdotnew/sdk 2.1.1 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -481,6 +481,45 @@ interface TranscriptionRequest {
481
481
  response_format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
482
482
  signal?: AbortSignal;
483
483
  }
484
+ interface VideoGenerationRequest {
485
+ prompt: string;
486
+ model?: string;
487
+ image_url?: string;
488
+ duration?: string;
489
+ aspect_ratio?: string;
490
+ resolution?: string;
491
+ negative_prompt?: string;
492
+ generate_audio?: boolean;
493
+ seed?: number;
494
+ cfg_scale?: number;
495
+ signal?: AbortSignal;
496
+ }
497
+ interface VideoGenerationResponse {
498
+ result: {
499
+ video: {
500
+ url: string;
501
+ content_type?: string;
502
+ file_name?: string;
503
+ file_size?: number;
504
+ };
505
+ seed?: number;
506
+ video_id?: string;
507
+ thumbnail?: {
508
+ url: string;
509
+ };
510
+ };
511
+ metadata?: {
512
+ projectId: string;
513
+ timestamp: string;
514
+ provider: string;
515
+ model: string;
516
+ };
517
+ usage?: {
518
+ creditsCharged: number;
519
+ costUSD: number;
520
+ model: string;
521
+ };
522
+ }
484
523
  interface TranscriptionResponse {
485
524
  text: string;
486
525
  transcript?: string;
@@ -519,6 +558,7 @@ interface BlinkAI {
519
558
  background?: "auto" | "transparent" | "opaque";
520
559
  signal?: AbortSignal;
521
560
  }): Promise<ImageGenerationResponse>;
561
+ generateVideo(options: VideoGenerationRequest): Promise<VideoGenerationResponse>;
522
562
  generateSpeech(options: SpeechGenerationRequest): Promise<SpeechGenerationResponse>;
523
563
  transcribeAudio(options: TranscriptionRequest): Promise<TranscriptionResponse>;
524
564
  }
@@ -767,6 +807,54 @@ interface BlinkNotifications {
767
807
  email(params: SendEmailRequest): Promise<SendEmailResponse>;
768
808
  }
769
809
 
810
+ type ConnectorProvider = 'discord' | 'notion' | 'google_drive' | 'google_calendar' | 'ai';
811
+ type ConnectorAuthMode = 'oauth' | 'api_key' | 'blink_managed' | 'hybrid';
812
+ interface ConnectorStatusData {
813
+ connected: boolean;
814
+ provider: ConnectorProvider;
815
+ auth_mode?: ConnectorAuthMode;
816
+ account_id?: string;
817
+ metadata?: Record<string, unknown>;
818
+ expires_at?: any;
819
+ scopes?: string[];
820
+ }
821
+ interface ConnectorStatusResponse {
822
+ success: boolean;
823
+ data: ConnectorStatusData;
824
+ }
825
+ interface ConnectorExecuteRequest<TParams = Record<string, unknown>> {
826
+ method: string;
827
+ params?: TParams;
828
+ account_id?: string;
829
+ http_method?: string;
830
+ }
831
+ interface ConnectorExecuteResponse<TData = any> {
832
+ success: boolean;
833
+ data: TData;
834
+ }
835
+ interface ConnectorApiKeyRequest<TMetadata = Record<string, unknown>> {
836
+ api_key: string;
837
+ account_id?: string;
838
+ metadata?: TMetadata;
839
+ }
840
+ interface ConnectorApiKeyResponse {
841
+ success: boolean;
842
+ data: {
843
+ id: string;
844
+ account_id?: string;
845
+ };
846
+ }
847
+ interface BlinkConnectors {
848
+ status(provider: ConnectorProvider, options?: {
849
+ account_id?: string;
850
+ }): Promise<ConnectorStatusResponse>;
851
+ execute<TParams = Record<string, unknown>, TData = any>(provider: ConnectorProvider, request: ConnectorExecuteRequest<TParams>): Promise<ConnectorExecuteResponse<TData>>;
852
+ saveApiKey<TMetadata = Record<string, unknown>>(provider: ConnectorProvider, request: ConnectorApiKeyRequest<TMetadata>): Promise<ConnectorApiKeyResponse>;
853
+ }
854
+ declare class BlinkConnectorError extends BlinkError {
855
+ constructor(message: string, status?: number, details?: any);
856
+ }
857
+
770
858
  /**
771
859
  * HTTP client for Blink API requests
772
860
  * Handles authentication, error handling, and request/response processing
@@ -936,6 +1024,18 @@ declare class HttpClient {
936
1024
  response_format?: string;
937
1025
  signal?: AbortSignal;
938
1026
  }): Promise<BlinkResponse<any>>;
1027
+ aiVideo(prompt: string, options?: {
1028
+ model?: string;
1029
+ image_url?: string;
1030
+ duration?: string;
1031
+ aspect_ratio?: string;
1032
+ resolution?: string;
1033
+ negative_prompt?: string;
1034
+ generate_audio?: boolean;
1035
+ seed?: number;
1036
+ cfg_scale?: number;
1037
+ signal?: AbortSignal;
1038
+ }): Promise<BlinkResponse<any>>;
939
1039
  /**
940
1040
  * Data-specific requests
941
1041
  */
@@ -945,6 +1045,13 @@ declare class HttpClient {
945
1045
  dataScreenshot(projectId: string, request: ScreenshotRequest): Promise<BlinkResponse<ScreenshotResponse>>;
946
1046
  dataFetch(projectId: string, request: FetchRequest): Promise<BlinkResponse<FetchResponse | AsyncFetchResponse>>;
947
1047
  dataSearch(projectId: string, request: SearchRequest): Promise<BlinkResponse<SearchResponse>>;
1048
+ /**
1049
+ * Connector requests
1050
+ */
1051
+ private formatProviderForPath;
1052
+ connectorStatus(provider: ConnectorProvider): Promise<BlinkResponse<ConnectorStatusResponse>>;
1053
+ connectorExecute<TParams = Record<string, unknown>, TData = any>(provider: ConnectorProvider, request: ConnectorExecuteRequest<TParams>): Promise<BlinkResponse<ConnectorExecuteResponse<TData>>>;
1054
+ connectorSaveApiKey<TMetadata = Record<string, unknown>>(provider: ConnectorProvider, request: ConnectorApiKeyRequest<TMetadata>): Promise<BlinkResponse<ConnectorApiKeyResponse>>;
948
1055
  /**
949
1056
  * Realtime-specific requests
950
1057
  */
@@ -1734,6 +1841,7 @@ interface BlinkClient {
1734
1841
  realtime: BlinkRealtime;
1735
1842
  notifications: BlinkNotifications;
1736
1843
  analytics: BlinkAnalytics;
1844
+ connectors: BlinkConnectors;
1737
1845
  functions: BlinkFunctions;
1738
1846
  }
1739
1847
  /**
@@ -2209,6 +2317,82 @@ declare class BlinkAIImpl implements BlinkAI {
2209
2317
  n?: number;
2210
2318
  signal?: AbortSignal;
2211
2319
  }): Promise<ImageGenerationResponse>;
2320
+ /**
2321
+ * Generates videos from text prompts or images using AI video generation models.
2322
+ *
2323
+ * @param options - Object containing:
2324
+ * - `prompt`: Text description of the video to generate (required)
2325
+ * - `model`: Video model to use (optional). Available models:
2326
+ * **Text-to-Video Models:**
2327
+ * - `"fal-ai/veo3.1"` - Google Veo 3.1 (best quality)
2328
+ * - `"fal-ai/veo3.1/fast"` (default) - Veo 3.1 fast mode (faster, cheaper)
2329
+ * - `"fal-ai/sora-2/text-to-video/pro"` - OpenAI Sora 2
2330
+ * - `"fal-ai/kling-video/v2.6/pro/text-to-video"` - Kling 2.6
2331
+ * **Image-to-Video Models:**
2332
+ * - `"fal-ai/veo3.1/image-to-video"` - Veo 3.1 I2V
2333
+ * - `"fal-ai/veo3.1/fast/image-to-video"` - Veo 3.1 fast I2V
2334
+ * - `"fal-ai/sora-2/image-to-video/pro"` - Sora 2 I2V
2335
+ * - `"fal-ai/kling-video/v2.6/pro/image-to-video"` - Kling 2.6 I2V
2336
+ * - `image_url`: Source image URL for image-to-video (required for I2V models)
2337
+ * - `duration`: Video duration ("4s", "5s", "6s", "8s", "10s", "12s")
2338
+ * - `aspect_ratio`: Aspect ratio ("16:9", "9:16", "1:1")
2339
+ * - `resolution`: Resolution ("720p", "1080p") - Veo/Sora only
2340
+ * - `negative_prompt`: What to avoid in generation - Veo/Kling only
2341
+ * - `generate_audio`: Generate audio with video (default: true)
2342
+ * - `seed`: For reproducibility - Veo only
2343
+ * - `cfg_scale`: Guidance scale (0-1) - Kling only
2344
+ * - Plus optional signal parameter
2345
+ *
2346
+ * @example
2347
+ * ```ts
2348
+ * // Basic text-to-video generation (uses default fast model)
2349
+ * const { result } = await blink.ai.generateVideo({
2350
+ * prompt: "A serene sunset over the ocean with gentle waves"
2351
+ * });
2352
+ * console.log("Video URL:", result.video.url);
2353
+ *
2354
+ * // High quality with Veo 3.1
2355
+ * const { result } = await blink.ai.generateVideo({
2356
+ * prompt: "A cinematic shot of a futuristic city at night",
2357
+ * model: "fal-ai/veo3.1",
2358
+ * resolution: "1080p",
2359
+ * aspect_ratio: "16:9"
2360
+ * });
2361
+ *
2362
+ * // Image-to-video animation
2363
+ * const { result } = await blink.ai.generateVideo({
2364
+ * prompt: "Animate this image with gentle camera movement",
2365
+ * model: "fal-ai/veo3.1/fast/image-to-video",
2366
+ * image_url: "https://example.com/my-image.jpg",
2367
+ * duration: "5s"
2368
+ * });
2369
+ *
2370
+ * // Using Sora 2 for creative videos
2371
+ * const { result } = await blink.ai.generateVideo({
2372
+ * prompt: "A magical forest with glowing fireflies",
2373
+ * model: "fal-ai/sora-2/text-to-video/pro",
2374
+ * duration: "8s"
2375
+ * });
2376
+ *
2377
+ * // Using Kling for detailed videos
2378
+ * const { result, usage } = await blink.ai.generateVideo({
2379
+ * prompt: "A professional cooking tutorial scene",
2380
+ * model: "fal-ai/kling-video/v2.6/pro/text-to-video",
2381
+ * negative_prompt: "blur, distort, low quality",
2382
+ * cfg_scale: 0.7
2383
+ * });
2384
+ * console.log("Credits charged:", usage?.creditsCharged);
2385
+ * ```
2386
+ *
2387
+ * @returns Promise<VideoGenerationResponse> - Object containing:
2388
+ * - `result.video.url`: URL to the generated video
2389
+ * - `result.video.content_type`: MIME type (video/mp4)
2390
+ * - `result.video.file_name`: Generated filename
2391
+ * - `result.video.file_size`: File size in bytes
2392
+ * - `metadata`: Generation metadata (projectId, timestamp, model)
2393
+ * - `usage`: Credits charged and cost information
2394
+ */
2395
+ generateVideo(options: VideoGenerationRequest): Promise<VideoGenerationResponse>;
2212
2396
  /**
2213
2397
  * Converts text to speech using AI voice synthesis models.
2214
2398
  *
@@ -2384,4 +2568,14 @@ declare class BlinkRealtimeImpl implements BlinkRealtime {
2384
2568
  onPresence(channelName: string, callback: (users: PresenceUser[]) => void): () => void;
2385
2569
  }
2386
2570
 
2387
- export { type AnalyticsEvent, AsyncStorageAdapter, type AuthState, type AuthStateChangeCallback, type AuthTokens, type BlinkAI, BlinkAIImpl, type BlinkAnalytics, BlinkAnalyticsImpl, type BlinkClient, type BlinkClientConfig, type BlinkData, BlinkDataImpl, BlinkDatabase, type BlinkRealtime, BlinkRealtimeChannel, BlinkRealtimeError, BlinkRealtimeImpl, type BlinkStorage, BlinkStorageImpl, BlinkTable, type BlinkUser, type CreateOptions, type DataExtraction, type FileObject, type FilterCondition, type ImageGenerationRequest, type ImageGenerationResponse, type Message, NoOpStorageAdapter, type ObjectGenerationRequest, type ObjectGenerationResponse, type PresenceUser, type QueryOptions, type RealtimeChannel, type RealtimeGetMessagesOptions, type RealtimeMessage, type RealtimePublishOptions, type RealtimeSubscribeOptions, type SearchRequest, type SearchResponse, type SpeechGenerationRequest, type SpeechGenerationResponse, type StorageAdapter, type StorageUploadOptions, type StorageUploadResponse, type TableOperations, type TextGenerationRequest, type TextGenerationResponse, type TokenUsage, type TranscriptionRequest, type TranscriptionResponse, type UpdateOptions, type UpsertOptions, type WebBrowserModule, WebStorageAdapter, createClient, getDefaultStorageAdapter, isBrowser, isDeno, isNode, isReactNative, isServer, isWeb, platform };
2571
+ declare class BlinkConnectorsImpl implements BlinkConnectors {
2572
+ private httpClient;
2573
+ constructor(httpClient: HttpClient);
2574
+ status(provider: ConnectorProvider, options?: {
2575
+ account_id?: string;
2576
+ }): Promise<ConnectorStatusResponse>;
2577
+ execute<TParams = Record<string, unknown>, TData = any>(provider: ConnectorProvider, request: ConnectorExecuteRequest<TParams>): Promise<ConnectorExecuteResponse<TData>>;
2578
+ saveApiKey<TMetadata = Record<string, unknown>>(provider: ConnectorProvider, request: ConnectorApiKeyRequest<TMetadata>): Promise<ConnectorApiKeyResponse>;
2579
+ }
2580
+
2581
+ export { type AnalyticsEvent, AsyncStorageAdapter, type AuthState, type AuthStateChangeCallback, type AuthTokens, type BlinkAI, BlinkAIImpl, type BlinkAnalytics, BlinkAnalyticsImpl, type BlinkClient, type BlinkClientConfig, BlinkConnectorError, type BlinkConnectors, BlinkConnectorsImpl, type BlinkData, BlinkDataImpl, BlinkDatabase, type BlinkRealtime, BlinkRealtimeChannel, BlinkRealtimeError, BlinkRealtimeImpl, type BlinkStorage, BlinkStorageImpl, BlinkTable, type BlinkUser, type ConnectorApiKeyRequest, type ConnectorApiKeyResponse, type ConnectorAuthMode, type ConnectorExecuteRequest, type ConnectorExecuteResponse, type ConnectorProvider, type ConnectorStatusResponse, type CreateOptions, type DataExtraction, type FileObject, type FilterCondition, type ImageGenerationRequest, type ImageGenerationResponse, type Message, NoOpStorageAdapter, type ObjectGenerationRequest, type ObjectGenerationResponse, type PresenceUser, type QueryOptions, type RealtimeChannel, type RealtimeGetMessagesOptions, type RealtimeMessage, type RealtimePublishOptions, type RealtimeSubscribeOptions, type SearchRequest, type SearchResponse, type SpeechGenerationRequest, type SpeechGenerationResponse, type StorageAdapter, type StorageUploadOptions, type StorageUploadResponse, type TableOperations, type TextGenerationRequest, type TextGenerationResponse, type TokenUsage, type TranscriptionRequest, type TranscriptionResponse, type UpdateOptions, type UpsertOptions, type WebBrowserModule, WebStorageAdapter, createClient, getDefaultStorageAdapter, isBrowser, isDeno, isNode, isReactNative, isServer, isWeb, platform };
package/dist/index.d.ts CHANGED
@@ -481,6 +481,45 @@ interface TranscriptionRequest {
481
481
  response_format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt';
482
482
  signal?: AbortSignal;
483
483
  }
484
+ interface VideoGenerationRequest {
485
+ prompt: string;
486
+ model?: string;
487
+ image_url?: string;
488
+ duration?: string;
489
+ aspect_ratio?: string;
490
+ resolution?: string;
491
+ negative_prompt?: string;
492
+ generate_audio?: boolean;
493
+ seed?: number;
494
+ cfg_scale?: number;
495
+ signal?: AbortSignal;
496
+ }
497
+ interface VideoGenerationResponse {
498
+ result: {
499
+ video: {
500
+ url: string;
501
+ content_type?: string;
502
+ file_name?: string;
503
+ file_size?: number;
504
+ };
505
+ seed?: number;
506
+ video_id?: string;
507
+ thumbnail?: {
508
+ url: string;
509
+ };
510
+ };
511
+ metadata?: {
512
+ projectId: string;
513
+ timestamp: string;
514
+ provider: string;
515
+ model: string;
516
+ };
517
+ usage?: {
518
+ creditsCharged: number;
519
+ costUSD: number;
520
+ model: string;
521
+ };
522
+ }
484
523
  interface TranscriptionResponse {
485
524
  text: string;
486
525
  transcript?: string;
@@ -519,6 +558,7 @@ interface BlinkAI {
519
558
  background?: "auto" | "transparent" | "opaque";
520
559
  signal?: AbortSignal;
521
560
  }): Promise<ImageGenerationResponse>;
561
+ generateVideo(options: VideoGenerationRequest): Promise<VideoGenerationResponse>;
522
562
  generateSpeech(options: SpeechGenerationRequest): Promise<SpeechGenerationResponse>;
523
563
  transcribeAudio(options: TranscriptionRequest): Promise<TranscriptionResponse>;
524
564
  }
@@ -767,6 +807,54 @@ interface BlinkNotifications {
767
807
  email(params: SendEmailRequest): Promise<SendEmailResponse>;
768
808
  }
769
809
 
810
+ type ConnectorProvider = 'discord' | 'notion' | 'google_drive' | 'google_calendar' | 'ai';
811
+ type ConnectorAuthMode = 'oauth' | 'api_key' | 'blink_managed' | 'hybrid';
812
+ interface ConnectorStatusData {
813
+ connected: boolean;
814
+ provider: ConnectorProvider;
815
+ auth_mode?: ConnectorAuthMode;
816
+ account_id?: string;
817
+ metadata?: Record<string, unknown>;
818
+ expires_at?: any;
819
+ scopes?: string[];
820
+ }
821
+ interface ConnectorStatusResponse {
822
+ success: boolean;
823
+ data: ConnectorStatusData;
824
+ }
825
+ interface ConnectorExecuteRequest<TParams = Record<string, unknown>> {
826
+ method: string;
827
+ params?: TParams;
828
+ account_id?: string;
829
+ http_method?: string;
830
+ }
831
+ interface ConnectorExecuteResponse<TData = any> {
832
+ success: boolean;
833
+ data: TData;
834
+ }
835
+ interface ConnectorApiKeyRequest<TMetadata = Record<string, unknown>> {
836
+ api_key: string;
837
+ account_id?: string;
838
+ metadata?: TMetadata;
839
+ }
840
+ interface ConnectorApiKeyResponse {
841
+ success: boolean;
842
+ data: {
843
+ id: string;
844
+ account_id?: string;
845
+ };
846
+ }
847
+ interface BlinkConnectors {
848
+ status(provider: ConnectorProvider, options?: {
849
+ account_id?: string;
850
+ }): Promise<ConnectorStatusResponse>;
851
+ execute<TParams = Record<string, unknown>, TData = any>(provider: ConnectorProvider, request: ConnectorExecuteRequest<TParams>): Promise<ConnectorExecuteResponse<TData>>;
852
+ saveApiKey<TMetadata = Record<string, unknown>>(provider: ConnectorProvider, request: ConnectorApiKeyRequest<TMetadata>): Promise<ConnectorApiKeyResponse>;
853
+ }
854
+ declare class BlinkConnectorError extends BlinkError {
855
+ constructor(message: string, status?: number, details?: any);
856
+ }
857
+
770
858
  /**
771
859
  * HTTP client for Blink API requests
772
860
  * Handles authentication, error handling, and request/response processing
@@ -936,6 +1024,18 @@ declare class HttpClient {
936
1024
  response_format?: string;
937
1025
  signal?: AbortSignal;
938
1026
  }): Promise<BlinkResponse<any>>;
1027
+ aiVideo(prompt: string, options?: {
1028
+ model?: string;
1029
+ image_url?: string;
1030
+ duration?: string;
1031
+ aspect_ratio?: string;
1032
+ resolution?: string;
1033
+ negative_prompt?: string;
1034
+ generate_audio?: boolean;
1035
+ seed?: number;
1036
+ cfg_scale?: number;
1037
+ signal?: AbortSignal;
1038
+ }): Promise<BlinkResponse<any>>;
939
1039
  /**
940
1040
  * Data-specific requests
941
1041
  */
@@ -945,6 +1045,13 @@ declare class HttpClient {
945
1045
  dataScreenshot(projectId: string, request: ScreenshotRequest): Promise<BlinkResponse<ScreenshotResponse>>;
946
1046
  dataFetch(projectId: string, request: FetchRequest): Promise<BlinkResponse<FetchResponse | AsyncFetchResponse>>;
947
1047
  dataSearch(projectId: string, request: SearchRequest): Promise<BlinkResponse<SearchResponse>>;
1048
+ /**
1049
+ * Connector requests
1050
+ */
1051
+ private formatProviderForPath;
1052
+ connectorStatus(provider: ConnectorProvider): Promise<BlinkResponse<ConnectorStatusResponse>>;
1053
+ connectorExecute<TParams = Record<string, unknown>, TData = any>(provider: ConnectorProvider, request: ConnectorExecuteRequest<TParams>): Promise<BlinkResponse<ConnectorExecuteResponse<TData>>>;
1054
+ connectorSaveApiKey<TMetadata = Record<string, unknown>>(provider: ConnectorProvider, request: ConnectorApiKeyRequest<TMetadata>): Promise<BlinkResponse<ConnectorApiKeyResponse>>;
948
1055
  /**
949
1056
  * Realtime-specific requests
950
1057
  */
@@ -1734,6 +1841,7 @@ interface BlinkClient {
1734
1841
  realtime: BlinkRealtime;
1735
1842
  notifications: BlinkNotifications;
1736
1843
  analytics: BlinkAnalytics;
1844
+ connectors: BlinkConnectors;
1737
1845
  functions: BlinkFunctions;
1738
1846
  }
1739
1847
  /**
@@ -2209,6 +2317,82 @@ declare class BlinkAIImpl implements BlinkAI {
2209
2317
  n?: number;
2210
2318
  signal?: AbortSignal;
2211
2319
  }): Promise<ImageGenerationResponse>;
2320
+ /**
2321
+ * Generates videos from text prompts or images using AI video generation models.
2322
+ *
2323
+ * @param options - Object containing:
2324
+ * - `prompt`: Text description of the video to generate (required)
2325
+ * - `model`: Video model to use (optional). Available models:
2326
+ * **Text-to-Video Models:**
2327
+ * - `"fal-ai/veo3.1"` - Google Veo 3.1 (best quality)
2328
+ * - `"fal-ai/veo3.1/fast"` (default) - Veo 3.1 fast mode (faster, cheaper)
2329
+ * - `"fal-ai/sora-2/text-to-video/pro"` - OpenAI Sora 2
2330
+ * - `"fal-ai/kling-video/v2.6/pro/text-to-video"` - Kling 2.6
2331
+ * **Image-to-Video Models:**
2332
+ * - `"fal-ai/veo3.1/image-to-video"` - Veo 3.1 I2V
2333
+ * - `"fal-ai/veo3.1/fast/image-to-video"` - Veo 3.1 fast I2V
2334
+ * - `"fal-ai/sora-2/image-to-video/pro"` - Sora 2 I2V
2335
+ * - `"fal-ai/kling-video/v2.6/pro/image-to-video"` - Kling 2.6 I2V
2336
+ * - `image_url`: Source image URL for image-to-video (required for I2V models)
2337
+ * - `duration`: Video duration ("4s", "5s", "6s", "8s", "10s", "12s")
2338
+ * - `aspect_ratio`: Aspect ratio ("16:9", "9:16", "1:1")
2339
+ * - `resolution`: Resolution ("720p", "1080p") - Veo/Sora only
2340
+ * - `negative_prompt`: What to avoid in generation - Veo/Kling only
2341
+ * - `generate_audio`: Generate audio with video (default: true)
2342
+ * - `seed`: For reproducibility - Veo only
2343
+ * - `cfg_scale`: Guidance scale (0-1) - Kling only
2344
+ * - Plus optional signal parameter
2345
+ *
2346
+ * @example
2347
+ * ```ts
2348
+ * // Basic text-to-video generation (uses default fast model)
2349
+ * const { result } = await blink.ai.generateVideo({
2350
+ * prompt: "A serene sunset over the ocean with gentle waves"
2351
+ * });
2352
+ * console.log("Video URL:", result.video.url);
2353
+ *
2354
+ * // High quality with Veo 3.1
2355
+ * const { result } = await blink.ai.generateVideo({
2356
+ * prompt: "A cinematic shot of a futuristic city at night",
2357
+ * model: "fal-ai/veo3.1",
2358
+ * resolution: "1080p",
2359
+ * aspect_ratio: "16:9"
2360
+ * });
2361
+ *
2362
+ * // Image-to-video animation
2363
+ * const { result } = await blink.ai.generateVideo({
2364
+ * prompt: "Animate this image with gentle camera movement",
2365
+ * model: "fal-ai/veo3.1/fast/image-to-video",
2366
+ * image_url: "https://example.com/my-image.jpg",
2367
+ * duration: "5s"
2368
+ * });
2369
+ *
2370
+ * // Using Sora 2 for creative videos
2371
+ * const { result } = await blink.ai.generateVideo({
2372
+ * prompt: "A magical forest with glowing fireflies",
2373
+ * model: "fal-ai/sora-2/text-to-video/pro",
2374
+ * duration: "8s"
2375
+ * });
2376
+ *
2377
+ * // Using Kling for detailed videos
2378
+ * const { result, usage } = await blink.ai.generateVideo({
2379
+ * prompt: "A professional cooking tutorial scene",
2380
+ * model: "fal-ai/kling-video/v2.6/pro/text-to-video",
2381
+ * negative_prompt: "blur, distort, low quality",
2382
+ * cfg_scale: 0.7
2383
+ * });
2384
+ * console.log("Credits charged:", usage?.creditsCharged);
2385
+ * ```
2386
+ *
2387
+ * @returns Promise<VideoGenerationResponse> - Object containing:
2388
+ * - `result.video.url`: URL to the generated video
2389
+ * - `result.video.content_type`: MIME type (video/mp4)
2390
+ * - `result.video.file_name`: Generated filename
2391
+ * - `result.video.file_size`: File size in bytes
2392
+ * - `metadata`: Generation metadata (projectId, timestamp, model)
2393
+ * - `usage`: Credits charged and cost information
2394
+ */
2395
+ generateVideo(options: VideoGenerationRequest): Promise<VideoGenerationResponse>;
2212
2396
  /**
2213
2397
  * Converts text to speech using AI voice synthesis models.
2214
2398
  *
@@ -2384,4 +2568,14 @@ declare class BlinkRealtimeImpl implements BlinkRealtime {
2384
2568
  onPresence(channelName: string, callback: (users: PresenceUser[]) => void): () => void;
2385
2569
  }
2386
2570
 
2387
- export { type AnalyticsEvent, AsyncStorageAdapter, type AuthState, type AuthStateChangeCallback, type AuthTokens, type BlinkAI, BlinkAIImpl, type BlinkAnalytics, BlinkAnalyticsImpl, type BlinkClient, type BlinkClientConfig, type BlinkData, BlinkDataImpl, BlinkDatabase, type BlinkRealtime, BlinkRealtimeChannel, BlinkRealtimeError, BlinkRealtimeImpl, type BlinkStorage, BlinkStorageImpl, BlinkTable, type BlinkUser, type CreateOptions, type DataExtraction, type FileObject, type FilterCondition, type ImageGenerationRequest, type ImageGenerationResponse, type Message, NoOpStorageAdapter, type ObjectGenerationRequest, type ObjectGenerationResponse, type PresenceUser, type QueryOptions, type RealtimeChannel, type RealtimeGetMessagesOptions, type RealtimeMessage, type RealtimePublishOptions, type RealtimeSubscribeOptions, type SearchRequest, type SearchResponse, type SpeechGenerationRequest, type SpeechGenerationResponse, type StorageAdapter, type StorageUploadOptions, type StorageUploadResponse, type TableOperations, type TextGenerationRequest, type TextGenerationResponse, type TokenUsage, type TranscriptionRequest, type TranscriptionResponse, type UpdateOptions, type UpsertOptions, type WebBrowserModule, WebStorageAdapter, createClient, getDefaultStorageAdapter, isBrowser, isDeno, isNode, isReactNative, isServer, isWeb, platform };
2571
+ declare class BlinkConnectorsImpl implements BlinkConnectors {
2572
+ private httpClient;
2573
+ constructor(httpClient: HttpClient);
2574
+ status(provider: ConnectorProvider, options?: {
2575
+ account_id?: string;
2576
+ }): Promise<ConnectorStatusResponse>;
2577
+ execute<TParams = Record<string, unknown>, TData = any>(provider: ConnectorProvider, request: ConnectorExecuteRequest<TParams>): Promise<ConnectorExecuteResponse<TData>>;
2578
+ saveApiKey<TMetadata = Record<string, unknown>>(provider: ConnectorProvider, request: ConnectorApiKeyRequest<TMetadata>): Promise<ConnectorApiKeyResponse>;
2579
+ }
2580
+
2581
+ export { type AnalyticsEvent, AsyncStorageAdapter, type AuthState, type AuthStateChangeCallback, type AuthTokens, type BlinkAI, BlinkAIImpl, type BlinkAnalytics, BlinkAnalyticsImpl, type BlinkClient, type BlinkClientConfig, BlinkConnectorError, type BlinkConnectors, BlinkConnectorsImpl, type BlinkData, BlinkDataImpl, BlinkDatabase, type BlinkRealtime, BlinkRealtimeChannel, BlinkRealtimeError, BlinkRealtimeImpl, type BlinkStorage, BlinkStorageImpl, BlinkTable, type BlinkUser, type ConnectorApiKeyRequest, type ConnectorApiKeyResponse, type ConnectorAuthMode, type ConnectorExecuteRequest, type ConnectorExecuteResponse, type ConnectorProvider, type ConnectorStatusResponse, type CreateOptions, type DataExtraction, type FileObject, type FilterCondition, type ImageGenerationRequest, type ImageGenerationResponse, type Message, NoOpStorageAdapter, type ObjectGenerationRequest, type ObjectGenerationResponse, type PresenceUser, type QueryOptions, type RealtimeChannel, type RealtimeGetMessagesOptions, type RealtimeMessage, type RealtimePublishOptions, type RealtimeSubscribeOptions, type SearchRequest, type SearchResponse, type SpeechGenerationRequest, type SpeechGenerationResponse, type StorageAdapter, type StorageUploadOptions, type StorageUploadResponse, type TableOperations, type TextGenerationRequest, type TextGenerationResponse, type TokenUsage, type TranscriptionRequest, type TranscriptionResponse, type UpdateOptions, type UpsertOptions, type WebBrowserModule, WebStorageAdapter, createClient, getDefaultStorageAdapter, isBrowser, isDeno, isNode, isReactNative, isServer, isWeb, platform };
package/dist/index.js CHANGED
@@ -885,6 +885,17 @@ var HttpClient = class {
885
885
  signal
886
886
  });
887
887
  }
888
+ async aiVideo(prompt, options = {}) {
889
+ const { signal, ...body } = options;
890
+ return this.request(`/api/ai/${this.projectId}/video`, {
891
+ method: "POST",
892
+ body: {
893
+ prompt,
894
+ ...body
895
+ },
896
+ signal
897
+ });
898
+ }
888
899
  /**
889
900
  * Data-specific requests
890
901
  */
@@ -926,6 +937,38 @@ var HttpClient = class {
926
937
  async dataSearch(projectId, request) {
927
938
  return this.post(`/api/data/${projectId}/search`, request);
928
939
  }
940
+ /**
941
+ * Connector requests
942
+ */
943
+ formatProviderForPath(provider) {
944
+ return provider.replace("_", "-");
945
+ }
946
+ async connectorStatus(provider) {
947
+ return this.request(`/api/connectors/${this.formatProviderForPath(provider)}/${this.projectId}/status`, {
948
+ method: "GET"
949
+ });
950
+ }
951
+ async connectorExecute(provider, request) {
952
+ const path = request.method.startsWith("/") ? request.method : `/${request.method}`;
953
+ const url = `/api/connectors/${this.formatProviderForPath(provider)}/${this.projectId}${path}`;
954
+ const method = (request.http_method || "GET").toUpperCase();
955
+ if (method === "GET") {
956
+ return this.request(url, {
957
+ method: "GET",
958
+ searchParams: request.params
959
+ });
960
+ }
961
+ return this.request(url, {
962
+ method,
963
+ body: request.params || {}
964
+ });
965
+ }
966
+ async connectorSaveApiKey(provider, request) {
967
+ return this.request(`/api/connectors/${this.formatProviderForPath(provider)}/${this.projectId}/api-key`, {
968
+ method: "POST",
969
+ body: request
970
+ });
971
+ }
929
972
  /**
930
973
  * Realtime-specific requests
931
974
  */
@@ -4279,6 +4322,131 @@ var BlinkAIImpl = class {
4279
4322
  );
4280
4323
  }
4281
4324
  }
4325
+ /**
4326
+ * Generates videos from text prompts or images using AI video generation models.
4327
+ *
4328
+ * @param options - Object containing:
4329
+ * - `prompt`: Text description of the video to generate (required)
4330
+ * - `model`: Video model to use (optional). Available models:
4331
+ * **Text-to-Video Models:**
4332
+ * - `"fal-ai/veo3.1"` - Google Veo 3.1 (best quality)
4333
+ * - `"fal-ai/veo3.1/fast"` (default) - Veo 3.1 fast mode (faster, cheaper)
4334
+ * - `"fal-ai/sora-2/text-to-video/pro"` - OpenAI Sora 2
4335
+ * - `"fal-ai/kling-video/v2.6/pro/text-to-video"` - Kling 2.6
4336
+ * **Image-to-Video Models:**
4337
+ * - `"fal-ai/veo3.1/image-to-video"` - Veo 3.1 I2V
4338
+ * - `"fal-ai/veo3.1/fast/image-to-video"` - Veo 3.1 fast I2V
4339
+ * - `"fal-ai/sora-2/image-to-video/pro"` - Sora 2 I2V
4340
+ * - `"fal-ai/kling-video/v2.6/pro/image-to-video"` - Kling 2.6 I2V
4341
+ * - `image_url`: Source image URL for image-to-video (required for I2V models)
4342
+ * - `duration`: Video duration ("4s", "5s", "6s", "8s", "10s", "12s")
4343
+ * - `aspect_ratio`: Aspect ratio ("16:9", "9:16", "1:1")
4344
+ * - `resolution`: Resolution ("720p", "1080p") - Veo/Sora only
4345
+ * - `negative_prompt`: What to avoid in generation - Veo/Kling only
4346
+ * - `generate_audio`: Generate audio with video (default: true)
4347
+ * - `seed`: For reproducibility - Veo only
4348
+ * - `cfg_scale`: Guidance scale (0-1) - Kling only
4349
+ * - Plus optional signal parameter
4350
+ *
4351
+ * @example
4352
+ * ```ts
4353
+ * // Basic text-to-video generation (uses default fast model)
4354
+ * const { result } = await blink.ai.generateVideo({
4355
+ * prompt: "A serene sunset over the ocean with gentle waves"
4356
+ * });
4357
+ * console.log("Video URL:", result.video.url);
4358
+ *
4359
+ * // High quality with Veo 3.1
4360
+ * const { result } = await blink.ai.generateVideo({
4361
+ * prompt: "A cinematic shot of a futuristic city at night",
4362
+ * model: "fal-ai/veo3.1",
4363
+ * resolution: "1080p",
4364
+ * aspect_ratio: "16:9"
4365
+ * });
4366
+ *
4367
+ * // Image-to-video animation
4368
+ * const { result } = await blink.ai.generateVideo({
4369
+ * prompt: "Animate this image with gentle camera movement",
4370
+ * model: "fal-ai/veo3.1/fast/image-to-video",
4371
+ * image_url: "https://example.com/my-image.jpg",
4372
+ * duration: "5s"
4373
+ * });
4374
+ *
4375
+ * // Using Sora 2 for creative videos
4376
+ * const { result } = await blink.ai.generateVideo({
4377
+ * prompt: "A magical forest with glowing fireflies",
4378
+ * model: "fal-ai/sora-2/text-to-video/pro",
4379
+ * duration: "8s"
4380
+ * });
4381
+ *
4382
+ * // Using Kling for detailed videos
4383
+ * const { result, usage } = await blink.ai.generateVideo({
4384
+ * prompt: "A professional cooking tutorial scene",
4385
+ * model: "fal-ai/kling-video/v2.6/pro/text-to-video",
4386
+ * negative_prompt: "blur, distort, low quality",
4387
+ * cfg_scale: 0.7
4388
+ * });
4389
+ * console.log("Credits charged:", usage?.creditsCharged);
4390
+ * ```
4391
+ *
4392
+ * @returns Promise<VideoGenerationResponse> - Object containing:
4393
+ * - `result.video.url`: URL to the generated video
4394
+ * - `result.video.content_type`: MIME type (video/mp4)
4395
+ * - `result.video.file_name`: Generated filename
4396
+ * - `result.video.file_size`: File size in bytes
4397
+ * - `metadata`: Generation metadata (projectId, timestamp, model)
4398
+ * - `usage`: Credits charged and cost information
4399
+ */
4400
+ async generateVideo(options) {
4401
+ try {
4402
+ if (!options.prompt) {
4403
+ throw new BlinkAIError("Prompt is required");
4404
+ }
4405
+ const i2vModels = [
4406
+ "fal-ai/veo3.1/image-to-video",
4407
+ "fal-ai/veo3.1/fast/image-to-video",
4408
+ "fal-ai/sora-2/image-to-video/pro",
4409
+ "fal-ai/kling-video/v2.6/pro/image-to-video"
4410
+ ];
4411
+ if (options.model && i2vModels.includes(options.model) && !options.image_url) {
4412
+ throw new BlinkAIError("image_url is required for image-to-video models");
4413
+ }
4414
+ if (options.image_url) {
4415
+ const validation = this.validateImageUrl(options.image_url);
4416
+ if (!validation.isValid) {
4417
+ throw new BlinkAIError(`Invalid image_url: ${validation.error}`);
4418
+ }
4419
+ }
4420
+ const response = await this.httpClient.aiVideo(
4421
+ options.prompt,
4422
+ {
4423
+ model: options.model,
4424
+ image_url: options.image_url,
4425
+ duration: options.duration,
4426
+ aspect_ratio: options.aspect_ratio,
4427
+ resolution: options.resolution,
4428
+ negative_prompt: options.negative_prompt,
4429
+ generate_audio: options.generate_audio,
4430
+ seed: options.seed,
4431
+ cfg_scale: options.cfg_scale,
4432
+ signal: options.signal
4433
+ }
4434
+ );
4435
+ if (!response.data?.result?.video?.url) {
4436
+ throw new BlinkAIError("Invalid response format: missing video URL");
4437
+ }
4438
+ return response.data;
4439
+ } catch (error) {
4440
+ if (error instanceof BlinkAIError) {
4441
+ throw error;
4442
+ }
4443
+ throw new BlinkAIError(
4444
+ `Video generation failed: ${error instanceof Error ? error.message : "Unknown error"}`,
4445
+ void 0,
4446
+ { originalError: error }
4447
+ );
4448
+ }
4449
+ }
4282
4450
  /**
4283
4451
  * Converts text to speech using AI voice synthesis models.
4284
4452
  *
@@ -5527,6 +5695,25 @@ var BlinkAnalyticsImpl = class {
5527
5695
  }
5528
5696
  };
5529
5697
 
5698
+ // src/connectors.ts
5699
+ var BlinkConnectorsImpl = class {
5700
+ constructor(httpClient) {
5701
+ this.httpClient = httpClient;
5702
+ }
5703
+ async status(provider, options) {
5704
+ const response = await this.httpClient.connectorStatus(provider);
5705
+ return response.data;
5706
+ }
5707
+ async execute(provider, request) {
5708
+ const response = await this.httpClient.connectorExecute(provider, request);
5709
+ return response.data;
5710
+ }
5711
+ async saveApiKey(provider, request) {
5712
+ const response = await this.httpClient.connectorSaveApiKey(provider, request);
5713
+ return response.data;
5714
+ }
5715
+ };
5716
+
5530
5717
  // src/functions.ts
5531
5718
  var BlinkFunctionsImpl = class {
5532
5719
  httpClient;
@@ -5576,6 +5763,7 @@ var BlinkClientImpl = class {
5576
5763
  realtime;
5577
5764
  notifications;
5578
5765
  analytics;
5766
+ connectors;
5579
5767
  functions;
5580
5768
  httpClient;
5581
5769
  constructor(config) {
@@ -5595,6 +5783,7 @@ var BlinkClientImpl = class {
5595
5783
  this.realtime = new BlinkRealtimeImpl(this.httpClient, config.projectId);
5596
5784
  this.notifications = new BlinkNotificationsImpl(this.httpClient);
5597
5785
  this.analytics = new BlinkAnalyticsImpl(this.httpClient, config.projectId);
5786
+ this.connectors = new BlinkConnectorsImpl(this.httpClient);
5598
5787
  this.functions = new BlinkFunctionsImpl(
5599
5788
  this.httpClient,
5600
5789
  config.projectId,
@@ -5621,6 +5810,7 @@ function createClient(config) {
5621
5810
  exports.AsyncStorageAdapter = AsyncStorageAdapter;
5622
5811
  exports.BlinkAIImpl = BlinkAIImpl;
5623
5812
  exports.BlinkAnalyticsImpl = BlinkAnalyticsImpl;
5813
+ exports.BlinkConnectorsImpl = BlinkConnectorsImpl;
5624
5814
  exports.BlinkDataImpl = BlinkDataImpl;
5625
5815
  exports.BlinkDatabase = BlinkDatabase;
5626
5816
  exports.BlinkRealtimeChannel = BlinkRealtimeChannel;
package/dist/index.mjs CHANGED
@@ -883,6 +883,17 @@ var HttpClient = class {
883
883
  signal
884
884
  });
885
885
  }
886
+ async aiVideo(prompt, options = {}) {
887
+ const { signal, ...body } = options;
888
+ return this.request(`/api/ai/${this.projectId}/video`, {
889
+ method: "POST",
890
+ body: {
891
+ prompt,
892
+ ...body
893
+ },
894
+ signal
895
+ });
896
+ }
886
897
  /**
887
898
  * Data-specific requests
888
899
  */
@@ -924,6 +935,38 @@ var HttpClient = class {
924
935
  async dataSearch(projectId, request) {
925
936
  return this.post(`/api/data/${projectId}/search`, request);
926
937
  }
938
+ /**
939
+ * Connector requests
940
+ */
941
+ formatProviderForPath(provider) {
942
+ return provider.replace("_", "-");
943
+ }
944
+ async connectorStatus(provider) {
945
+ return this.request(`/api/connectors/${this.formatProviderForPath(provider)}/${this.projectId}/status`, {
946
+ method: "GET"
947
+ });
948
+ }
949
+ async connectorExecute(provider, request) {
950
+ const path = request.method.startsWith("/") ? request.method : `/${request.method}`;
951
+ const url = `/api/connectors/${this.formatProviderForPath(provider)}/${this.projectId}${path}`;
952
+ const method = (request.http_method || "GET").toUpperCase();
953
+ if (method === "GET") {
954
+ return this.request(url, {
955
+ method: "GET",
956
+ searchParams: request.params
957
+ });
958
+ }
959
+ return this.request(url, {
960
+ method,
961
+ body: request.params || {}
962
+ });
963
+ }
964
+ async connectorSaveApiKey(provider, request) {
965
+ return this.request(`/api/connectors/${this.formatProviderForPath(provider)}/${this.projectId}/api-key`, {
966
+ method: "POST",
967
+ body: request
968
+ });
969
+ }
927
970
  /**
928
971
  * Realtime-specific requests
929
972
  */
@@ -4277,6 +4320,131 @@ var BlinkAIImpl = class {
4277
4320
  );
4278
4321
  }
4279
4322
  }
4323
+ /**
4324
+ * Generates videos from text prompts or images using AI video generation models.
4325
+ *
4326
+ * @param options - Object containing:
4327
+ * - `prompt`: Text description of the video to generate (required)
4328
+ * - `model`: Video model to use (optional). Available models:
4329
+ * **Text-to-Video Models:**
4330
+ * - `"fal-ai/veo3.1"` - Google Veo 3.1 (best quality)
4331
+ * - `"fal-ai/veo3.1/fast"` (default) - Veo 3.1 fast mode (faster, cheaper)
4332
+ * - `"fal-ai/sora-2/text-to-video/pro"` - OpenAI Sora 2
4333
+ * - `"fal-ai/kling-video/v2.6/pro/text-to-video"` - Kling 2.6
4334
+ * **Image-to-Video Models:**
4335
+ * - `"fal-ai/veo3.1/image-to-video"` - Veo 3.1 I2V
4336
+ * - `"fal-ai/veo3.1/fast/image-to-video"` - Veo 3.1 fast I2V
4337
+ * - `"fal-ai/sora-2/image-to-video/pro"` - Sora 2 I2V
4338
+ * - `"fal-ai/kling-video/v2.6/pro/image-to-video"` - Kling 2.6 I2V
4339
+ * - `image_url`: Source image URL for image-to-video (required for I2V models)
4340
+ * - `duration`: Video duration ("4s", "5s", "6s", "8s", "10s", "12s")
4341
+ * - `aspect_ratio`: Aspect ratio ("16:9", "9:16", "1:1")
4342
+ * - `resolution`: Resolution ("720p", "1080p") - Veo/Sora only
4343
+ * - `negative_prompt`: What to avoid in generation - Veo/Kling only
4344
+ * - `generate_audio`: Generate audio with video (default: true)
4345
+ * - `seed`: For reproducibility - Veo only
4346
+ * - `cfg_scale`: Guidance scale (0-1) - Kling only
4347
+ * - Plus optional signal parameter
4348
+ *
4349
+ * @example
4350
+ * ```ts
4351
+ * // Basic text-to-video generation (uses default fast model)
4352
+ * const { result } = await blink.ai.generateVideo({
4353
+ * prompt: "A serene sunset over the ocean with gentle waves"
4354
+ * });
4355
+ * console.log("Video URL:", result.video.url);
4356
+ *
4357
+ * // High quality with Veo 3.1
4358
+ * const { result } = await blink.ai.generateVideo({
4359
+ * prompt: "A cinematic shot of a futuristic city at night",
4360
+ * model: "fal-ai/veo3.1",
4361
+ * resolution: "1080p",
4362
+ * aspect_ratio: "16:9"
4363
+ * });
4364
+ *
4365
+ * // Image-to-video animation
4366
+ * const { result } = await blink.ai.generateVideo({
4367
+ * prompt: "Animate this image with gentle camera movement",
4368
+ * model: "fal-ai/veo3.1/fast/image-to-video",
4369
+ * image_url: "https://example.com/my-image.jpg",
4370
+ * duration: "5s"
4371
+ * });
4372
+ *
4373
+ * // Using Sora 2 for creative videos
4374
+ * const { result } = await blink.ai.generateVideo({
4375
+ * prompt: "A magical forest with glowing fireflies",
4376
+ * model: "fal-ai/sora-2/text-to-video/pro",
4377
+ * duration: "8s"
4378
+ * });
4379
+ *
4380
+ * // Using Kling for detailed videos
4381
+ * const { result, usage } = await blink.ai.generateVideo({
4382
+ * prompt: "A professional cooking tutorial scene",
4383
+ * model: "fal-ai/kling-video/v2.6/pro/text-to-video",
4384
+ * negative_prompt: "blur, distort, low quality",
4385
+ * cfg_scale: 0.7
4386
+ * });
4387
+ * console.log("Credits charged:", usage?.creditsCharged);
4388
+ * ```
4389
+ *
4390
+ * @returns Promise<VideoGenerationResponse> - Object containing:
4391
+ * - `result.video.url`: URL to the generated video
4392
+ * - `result.video.content_type`: MIME type (video/mp4)
4393
+ * - `result.video.file_name`: Generated filename
4394
+ * - `result.video.file_size`: File size in bytes
4395
+ * - `metadata`: Generation metadata (projectId, timestamp, model)
4396
+ * - `usage`: Credits charged and cost information
4397
+ */
4398
+ async generateVideo(options) {
4399
+ try {
4400
+ if (!options.prompt) {
4401
+ throw new BlinkAIError("Prompt is required");
4402
+ }
4403
+ const i2vModels = [
4404
+ "fal-ai/veo3.1/image-to-video",
4405
+ "fal-ai/veo3.1/fast/image-to-video",
4406
+ "fal-ai/sora-2/image-to-video/pro",
4407
+ "fal-ai/kling-video/v2.6/pro/image-to-video"
4408
+ ];
4409
+ if (options.model && i2vModels.includes(options.model) && !options.image_url) {
4410
+ throw new BlinkAIError("image_url is required for image-to-video models");
4411
+ }
4412
+ if (options.image_url) {
4413
+ const validation = this.validateImageUrl(options.image_url);
4414
+ if (!validation.isValid) {
4415
+ throw new BlinkAIError(`Invalid image_url: ${validation.error}`);
4416
+ }
4417
+ }
4418
+ const response = await this.httpClient.aiVideo(
4419
+ options.prompt,
4420
+ {
4421
+ model: options.model,
4422
+ image_url: options.image_url,
4423
+ duration: options.duration,
4424
+ aspect_ratio: options.aspect_ratio,
4425
+ resolution: options.resolution,
4426
+ negative_prompt: options.negative_prompt,
4427
+ generate_audio: options.generate_audio,
4428
+ seed: options.seed,
4429
+ cfg_scale: options.cfg_scale,
4430
+ signal: options.signal
4431
+ }
4432
+ );
4433
+ if (!response.data?.result?.video?.url) {
4434
+ throw new BlinkAIError("Invalid response format: missing video URL");
4435
+ }
4436
+ return response.data;
4437
+ } catch (error) {
4438
+ if (error instanceof BlinkAIError) {
4439
+ throw error;
4440
+ }
4441
+ throw new BlinkAIError(
4442
+ `Video generation failed: ${error instanceof Error ? error.message : "Unknown error"}`,
4443
+ void 0,
4444
+ { originalError: error }
4445
+ );
4446
+ }
4447
+ }
4280
4448
  /**
4281
4449
  * Converts text to speech using AI voice synthesis models.
4282
4450
  *
@@ -5525,6 +5693,25 @@ var BlinkAnalyticsImpl = class {
5525
5693
  }
5526
5694
  };
5527
5695
 
5696
+ // src/connectors.ts
5697
+ var BlinkConnectorsImpl = class {
5698
+ constructor(httpClient) {
5699
+ this.httpClient = httpClient;
5700
+ }
5701
+ async status(provider, options) {
5702
+ const response = await this.httpClient.connectorStatus(provider);
5703
+ return response.data;
5704
+ }
5705
+ async execute(provider, request) {
5706
+ const response = await this.httpClient.connectorExecute(provider, request);
5707
+ return response.data;
5708
+ }
5709
+ async saveApiKey(provider, request) {
5710
+ const response = await this.httpClient.connectorSaveApiKey(provider, request);
5711
+ return response.data;
5712
+ }
5713
+ };
5714
+
5528
5715
  // src/functions.ts
5529
5716
  var BlinkFunctionsImpl = class {
5530
5717
  httpClient;
@@ -5574,6 +5761,7 @@ var BlinkClientImpl = class {
5574
5761
  realtime;
5575
5762
  notifications;
5576
5763
  analytics;
5764
+ connectors;
5577
5765
  functions;
5578
5766
  httpClient;
5579
5767
  constructor(config) {
@@ -5593,6 +5781,7 @@ var BlinkClientImpl = class {
5593
5781
  this.realtime = new BlinkRealtimeImpl(this.httpClient, config.projectId);
5594
5782
  this.notifications = new BlinkNotificationsImpl(this.httpClient);
5595
5783
  this.analytics = new BlinkAnalyticsImpl(this.httpClient, config.projectId);
5784
+ this.connectors = new BlinkConnectorsImpl(this.httpClient);
5596
5785
  this.functions = new BlinkFunctionsImpl(
5597
5786
  this.httpClient,
5598
5787
  config.projectId,
@@ -5616,6 +5805,6 @@ function createClient(config) {
5616
5805
  return new BlinkClientImpl(config);
5617
5806
  }
5618
5807
 
5619
- export { AsyncStorageAdapter, BlinkAIImpl, BlinkAnalyticsImpl, BlinkDataImpl, BlinkDatabase, BlinkRealtimeChannel, BlinkRealtimeImpl, BlinkStorageImpl, BlinkTable, NoOpStorageAdapter, WebStorageAdapter, createClient, getDefaultStorageAdapter, isBrowser, isDeno, isNode, isReactNative, isServer, isWeb, platform };
5808
+ export { AsyncStorageAdapter, BlinkAIImpl, BlinkAnalyticsImpl, BlinkConnectorsImpl, BlinkDataImpl, BlinkDatabase, BlinkRealtimeChannel, BlinkRealtimeImpl, BlinkStorageImpl, BlinkTable, NoOpStorageAdapter, WebStorageAdapter, createClient, getDefaultStorageAdapter, isBrowser, isDeno, isNode, isReactNative, isServer, isWeb, platform };
5620
5809
  //# sourceMappingURL=index.mjs.map
5621
5810
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blinkdotnew/sdk",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "Blink TypeScript SDK for client-side applications - Zero-boilerplate CRUD + auth + AI + analytics + notifications for modern SaaS/AI apps",
5
5
  "keywords": [
6
6
  "blink",
@@ -53,7 +53,8 @@
53
53
  "devDependencies": {
54
54
  "@blink/core": "0.4.1",
55
55
  "tsup": "^8.0.0",
56
- "typescript": "^5.0.0"
56
+ "typescript": "^5.0.0",
57
+ "@blinkdotnew/dev-sdk": "workspace:*"
57
58
  },
58
59
  "peerDependencies": {},
59
60
  "publishConfig": {