ugcinc 2.71.0 → 2.73.0

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.
@@ -186,6 +186,29 @@ function getAllNodes() {
186
186
  },
187
187
  ],
188
188
  },
189
+ {
190
+ type: "image-generation",
191
+ label: "Image Generation",
192
+ description: "Generate images using AI models",
193
+ category: "AI",
194
+ inputs: [
195
+ {
196
+ id: "prompt",
197
+ title: "Prompt",
198
+ type: "text",
199
+ required: true,
200
+ },
201
+ // Image input is dynamically added for edit models
202
+ ],
203
+ outputs: [
204
+ {
205
+ id: "output",
206
+ title: "Generated Image",
207
+ type: "image",
208
+ required: true,
209
+ },
210
+ ],
211
+ },
189
212
  {
190
213
  type: "llm",
191
214
  label: "LLM",
package/dist/base.js CHANGED
@@ -18,21 +18,17 @@ class BaseClient {
18
18
  }
19
19
  async request(endpoint, options = {}) {
20
20
  let url = `${this.baseUrl}${endpoint}`;
21
- // If orgId is provided, treat apiKey as admin key and add orgId as query param
21
+ // If orgId is provided, add it as query param to scope to that org
22
22
  if (this.orgId) {
23
23
  const separator = endpoint.includes('?') ? '&' : '?';
24
24
  url = `${url}${separator}orgId=${encodeURIComponent(this.orgId)}`;
25
25
  }
26
26
  const headers = {
27
27
  'Content-Type': 'application/json',
28
+ // Always use x-api-key header for admin authentication
29
+ // When orgId is provided, scopes to that org; when not provided, accesses all data
30
+ 'x-api-key': this.apiKey,
28
31
  };
29
- // Use admin key header if orgId is provided, otherwise use Bearer token
30
- if (this.orgId) {
31
- headers['x-api-key'] = this.apiKey;
32
- }
33
- else {
34
- headers['Authorization'] = `Bearer ${this.apiKey}`;
35
- }
36
32
  try {
37
33
  const response = await fetch(url, {
38
34
  ...options,
@@ -78,19 +74,16 @@ class BaseClient {
78
74
  }
79
75
  async postFormData(endpoint, formData) {
80
76
  let url = `${this.baseUrl}${endpoint}`;
81
- // If orgId is provided, treat apiKey as admin key and add orgId as query param
77
+ // If orgId is provided, add it as query param to scope to that org
82
78
  if (this.orgId) {
83
79
  const separator = endpoint.includes('?') ? '&' : '?';
84
80
  url = `${url}${separator}orgId=${encodeURIComponent(this.orgId)}`;
85
81
  }
86
- const headers = {};
87
- // Use admin key header if orgId is provided, otherwise use Bearer token
88
- if (this.orgId) {
89
- headers['x-api-key'] = this.apiKey;
90
- }
91
- else {
92
- headers['Authorization'] = `Bearer ${this.apiKey}`;
93
- }
82
+ const headers = {
83
+ // Always use x-api-key header for admin authentication
84
+ // When orgId is provided, scopes to that org; when not provided, accesses all data
85
+ 'x-api-key': this.apiKey,
86
+ };
94
87
  try {
95
88
  const response = await fetch(url, {
96
89
  method: 'POST',
package/dist/types.d.ts CHANGED
@@ -712,7 +712,7 @@ export interface NodeControlConfig {
712
712
  */
713
713
  supportsPerInputMode?: boolean;
714
714
  }
715
- export type NodeTypeEnum = 'image' | 'video' | 'audio' | 'text' | 'image-editor' | 'video-editor' | 'llm' | 'output' | 'variable' | 'workflow';
715
+ export type NodeTypeEnum = 'image' | 'video' | 'audio' | 'text' | 'image-editor' | 'video-editor' | 'image-generation' | 'llm' | 'output' | 'variable' | 'workflow';
716
716
  export interface OutputSchemaProperty {
717
717
  type: 'string' | 'number' | 'boolean' | 'array' | 'object';
718
718
  items?: 'string' | 'number' | 'boolean';
@@ -755,6 +755,26 @@ export interface LLMNodeConfig {
755
755
  videoInputRefs?: string[];
756
756
  apiKeys?: LLMApiKeys;
757
757
  }
758
+ /**
759
+ * Image Generation Model IDs
760
+ * Text-only models take just a prompt, edit models require an image input
761
+ */
762
+ export type ImageGenerationTextModel = 'fal-ai/gemini-3-pro-image-preview' | 'fal-ai/nano-banana-pro' | 'fal-ai/nano-banana' | 'fal-ai/gpt-image-1/text-to-image';
763
+ export type ImageGenerationEditModel = 'fal-ai/gemini-3-pro-image-preview/edit' | 'fal-ai/nano-banana-pro/edit' | 'fal-ai/nano-banana/edit' | 'fal-ai/gpt-image-1/edit-image';
764
+ export type ImageGenerationModel = ImageGenerationTextModel | ImageGenerationEditModel;
765
+ /**
766
+ * Image Generation Node Configuration
767
+ */
768
+ export interface ImageGenerationNodeConfig {
769
+ /** Selected model ID */
770
+ model: ImageGenerationModel;
771
+ /** Custom fal.ai API key (optional - uses platform key if not provided) */
772
+ apiKey?: string;
773
+ /** Image aspect ratio (e.g., "1:1", "16:9", "9:16") */
774
+ aspectRatio?: string;
775
+ /** Number of images to generate (default: 1) */
776
+ numImages?: number;
777
+ }
758
778
  export interface WorkflowNodeDefinition {
759
779
  id: string;
760
780
  type: NodeTypeEnum;
@@ -773,6 +793,7 @@ export interface WorkflowNodeDefinition {
773
793
  textOptions?: string[];
774
794
  videoEditor?: VideoEditorNodeConfig;
775
795
  imageEditor?: ImageEditorNodeConfig;
796
+ imageGeneration?: ImageGenerationNodeConfig;
776
797
  llm?: LLMNodeConfig;
777
798
  outputSchema?: Record<string, OutputSchemaProperty>;
778
799
  provider?: 'groq' | 'openai' | 'claude' | 'gemini';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.71.0",
3
+ "version": "2.73.0",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",