ugcinc 3.50.0 → 3.51.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.
- package/dist/index.d.ts +1 -1
- package/dist/render.d.ts +57 -0
- package/dist/render.js +131 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -16,6 +16,6 @@ export { portId, isValidPortId, portIdToTitle, normalizeToPortId, PortIdSchema }
|
|
|
16
16
|
export type { PortId } from './port-id';
|
|
17
17
|
export { MediaClient } from './media';
|
|
18
18
|
export { CommentsClient } from './comments';
|
|
19
|
-
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, RenderVideoEditorConfig, } from './render';
|
|
19
|
+
export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, SubmitScreenshotAnimationRenderJobParams, SubmitInstagramDmRenderJobParams, SubmitIMessageDmRenderJobParams, IgDmMessage, ImDmMessage, RenderVideoEditorConfig, } from './render';
|
|
20
20
|
export type { ClientConfig, } from './base';
|
|
21
21
|
export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStatus, PostStat, ApiKey, EditorConfig, VideoEditorNodeConfig, VideoEditorChannel, VideoEditorSegment, VideoEditorVideoSegment, VideoEditorAudioSegment, VideoEditorImageSegment, VideoEditorTextSegment, TimeMode, SegmentTimelinePosition, ImageEditorNodeConfig, ImageEditorElement, ImageEditorNodeInput, ImageEditorNodeOutput, DimensionPresetKey, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, PositionAnchor, RelativePositionConfig, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, DailyAggregatedStat, GetDailyAggregatedStatsParams, DailyPostStat, GetDailyPostStatsParams, TopAccount, GetTopAccountsParams, TopPost, GetTopPostsParams, MediaType, NodePort, ResolvedPorts, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, TemplateNode, AutomationTemplate, AutomationRun, NodeRun, ExecutorNode, ExecutionEdge, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, NodeOutputValues, OutputInput, OutputNodeConfig, ManualTriggerOutput, ManualTriggerNodeConfig, TriggerIterationMode, IterationExhaustionBehavior, CollectionSelectionMode, TriggerCollectionConfig, DayOfWeek, RecurrenceMediaOutput, RecurrenceMediaConfig, RecurrenceNodeConfig, AccountNodeConfig, MediaNodeEnabledType, RecurrenceMediaEnabledType, MediaNodeOutput, MediaNodeConfig, PostSchedulingMode, PostSchedulingConfig, AutoPostMode, AutoPostInputType, AutoPostInput, AutoPostNodeConfig, SaveToMediaInput, SaveToMediaNodeConfig, DeduplicateNodeConfig, ForEachOutputProperty, ForEachInputPort, ForEachNodeConfig, RandomValueType, RandomInputPort, RandomNodeMode, RandomNodeConfig, IfLogicOperator, IfBooleanInput, IfPassthroughInput, IfNodeConfig, RandomRouteBranch, RandomRoutePassthroughInput, RandomRouteObjectField, RandomRouteNodeConfig, VideoImportPlatform, VideoImportQuality, VideoImportNodeConfig, AutoCaptionPreset, AutoCaptionFontWeight, AutoCaptionPosition, AutoCaptionNodeConfig, ScreenshotAnimationNodeConfig, VideoGenerationNodeConfig, ArrayType, PortType, LLMOutputField, LLMNodeConfig, UserMedia, SocialAudio, Media, MediaUse, GetMediaParams, CreateSocialAudioParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateMediaFromUrlParams, ImportTextParams, ImportTextResponse, GetMediaUseParams, GetMediaUseResponse, Comment, CommentStatus, CreateCommentParams, CreateCommentResponse, GetCommentsParams, ValidationErrorType, ValidationError, ExportedNode, ExportedConnection, ExportedTemplate, AutomationExport, ExportedExecutor, ExportedEdge, ExportedRun, AutomationRunExport, } from './types';
|
package/dist/render.d.ts
CHANGED
|
@@ -59,6 +59,53 @@ export interface SubmitScreenshotAnimationRenderJobParams {
|
|
|
59
59
|
/** Duration to hold at end after animation completes (ms) - default 500 */
|
|
60
60
|
holdDurationMs?: number;
|
|
61
61
|
}
|
|
62
|
+
export interface IgDmMessage {
|
|
63
|
+
text: string;
|
|
64
|
+
sender: 'user' | 'recipient';
|
|
65
|
+
isStoryReply?: boolean;
|
|
66
|
+
groupWithPrevious?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface SubmitInstagramDmRenderJobParams {
|
|
69
|
+
/** Receiver's username (shown in header) */
|
|
70
|
+
receiverUsername: string;
|
|
71
|
+
/** Receiver's profile picture URL */
|
|
72
|
+
receiverProfilePicUrl: string;
|
|
73
|
+
/** Theme - light or dark mode */
|
|
74
|
+
theme: 'light' | 'dark';
|
|
75
|
+
/** Messages in the conversation */
|
|
76
|
+
messages: IgDmMessage[];
|
|
77
|
+
/** Story image URL for story reply messages */
|
|
78
|
+
storyImageUrl?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface ImDmMessage {
|
|
81
|
+
id: string;
|
|
82
|
+
sender: 'user' | 'recipient';
|
|
83
|
+
text: string;
|
|
84
|
+
imageUrl?: string;
|
|
85
|
+
groupWithPrevious?: boolean;
|
|
86
|
+
}
|
|
87
|
+
export interface SubmitIMessageDmRenderJobParams {
|
|
88
|
+
/** Username displayed in header */
|
|
89
|
+
username: string;
|
|
90
|
+
/** Profile picture URL */
|
|
91
|
+
profilePicUrl: string;
|
|
92
|
+
/** Light or dark theme */
|
|
93
|
+
theme: 'light' | 'dark';
|
|
94
|
+
/** Status bar time */
|
|
95
|
+
time: string;
|
|
96
|
+
/** Messages in the conversation */
|
|
97
|
+
messages: ImDmMessage[];
|
|
98
|
+
/** Sender bubble color (default blue) */
|
|
99
|
+
senderBubbleColor?: string;
|
|
100
|
+
/** Whether to show read receipt */
|
|
101
|
+
showReadReceipt?: boolean;
|
|
102
|
+
/** Read receipt text (e.g., "Read 2:30 PM") */
|
|
103
|
+
readReceiptText?: string;
|
|
104
|
+
/** Unread badge text (number of unread messages) */
|
|
105
|
+
unreadBadgeText?: string;
|
|
106
|
+
/** Message header timestamp text (e.g., "Today 2:15 PM") */
|
|
107
|
+
messageHeaderTimestampText?: string;
|
|
108
|
+
}
|
|
62
109
|
/**
|
|
63
110
|
* Client for rendering operations
|
|
64
111
|
* Note: This calls Modal endpoints directly, not the UGC Inc API
|
|
@@ -87,4 +134,14 @@ export declare class RenderClient {
|
|
|
87
134
|
* Renders an iPhone screenshot animation video from a source image
|
|
88
135
|
*/
|
|
89
136
|
submitScreenshotAnimationRenderJob(params: SubmitScreenshotAnimationRenderJobParams): Promise<ApiResponse<RenderJobResponse>>;
|
|
137
|
+
/**
|
|
138
|
+
* Submit an Instagram DM render job to the Modal renderer
|
|
139
|
+
* Renders a fake Instagram DM conversation image
|
|
140
|
+
*/
|
|
141
|
+
submitInstagramDmRenderJob(params: SubmitInstagramDmRenderJobParams): Promise<ApiResponse<RenderJobResponse>>;
|
|
142
|
+
/**
|
|
143
|
+
* Submit an iMessage DM render job to the Modal renderer
|
|
144
|
+
* Renders a fake iMessage conversation image
|
|
145
|
+
*/
|
|
146
|
+
submitIMessageDmRenderJob(params: SubmitIMessageDmRenderJobParams): Promise<ApiResponse<RenderJobResponse>>;
|
|
90
147
|
}
|
package/dist/render.js
CHANGED
|
@@ -305,5 +305,136 @@ class RenderClient {
|
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Submit an Instagram DM render job to the Modal renderer
|
|
310
|
+
* Renders a fake Instagram DM conversation image
|
|
311
|
+
*/
|
|
312
|
+
async submitInstagramDmRenderJob(params) {
|
|
313
|
+
try {
|
|
314
|
+
const response = await fetch(RENDER_SUBMIT_URL, {
|
|
315
|
+
method: 'POST',
|
|
316
|
+
headers: {
|
|
317
|
+
'Content-Type': 'application/json',
|
|
318
|
+
},
|
|
319
|
+
body: JSON.stringify({
|
|
320
|
+
config: {
|
|
321
|
+
_compositionType: 'instagram-dm',
|
|
322
|
+
input: {
|
|
323
|
+
receiverUsername: params.receiverUsername,
|
|
324
|
+
receiverProfilePicUrl: params.receiverProfilePicUrl,
|
|
325
|
+
theme: params.theme,
|
|
326
|
+
messages: params.messages,
|
|
327
|
+
storyImageUrl: params.storyImageUrl,
|
|
328
|
+
},
|
|
329
|
+
},
|
|
330
|
+
output_type: 'image',
|
|
331
|
+
image_format: 'png',
|
|
332
|
+
})
|
|
333
|
+
});
|
|
334
|
+
const text = await response.text();
|
|
335
|
+
let data;
|
|
336
|
+
try {
|
|
337
|
+
data = JSON.parse(text);
|
|
338
|
+
}
|
|
339
|
+
catch (jsonError) {
|
|
340
|
+
console.error('[Render] JSON parse error:', text.substring(0, 200));
|
|
341
|
+
return {
|
|
342
|
+
ok: false,
|
|
343
|
+
code: response.status || 500,
|
|
344
|
+
message: `Modal endpoint error: ${text.substring(0, 100)}`,
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
if (data.status === 'error' || !response.ok) {
|
|
348
|
+
return {
|
|
349
|
+
ok: false,
|
|
350
|
+
code: response.status,
|
|
351
|
+
message: data.error ?? data.message ?? 'Failed to submit Instagram DM job',
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
ok: true,
|
|
356
|
+
code: 200,
|
|
357
|
+
message: "Instagram DM job submitted",
|
|
358
|
+
data,
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
catch (error) {
|
|
362
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
363
|
+
console.error('[Render] Submit Instagram DM error:', error);
|
|
364
|
+
return {
|
|
365
|
+
ok: false,
|
|
366
|
+
code: 500,
|
|
367
|
+
message: `Failed to submit Instagram DM job: ${errorMessage}`,
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Submit an iMessage DM render job to the Modal renderer
|
|
373
|
+
* Renders a fake iMessage conversation image
|
|
374
|
+
*/
|
|
375
|
+
async submitIMessageDmRenderJob(params) {
|
|
376
|
+
try {
|
|
377
|
+
const response = await fetch(RENDER_SUBMIT_URL, {
|
|
378
|
+
method: 'POST',
|
|
379
|
+
headers: {
|
|
380
|
+
'Content-Type': 'application/json',
|
|
381
|
+
},
|
|
382
|
+
body: JSON.stringify({
|
|
383
|
+
config: {
|
|
384
|
+
_compositionType: 'imessage-dm',
|
|
385
|
+
input: {
|
|
386
|
+
username: params.username,
|
|
387
|
+
profilePicUrl: params.profilePicUrl,
|
|
388
|
+
theme: params.theme,
|
|
389
|
+
time: params.time,
|
|
390
|
+
messages: params.messages,
|
|
391
|
+
senderBubbleColor: params.senderBubbleColor,
|
|
392
|
+
showReadReceipt: params.showReadReceipt,
|
|
393
|
+
readReceiptText: params.readReceiptText,
|
|
394
|
+
unreadBadgeText: params.unreadBadgeText,
|
|
395
|
+
messageHeaderTimestampText: params.messageHeaderTimestampText,
|
|
396
|
+
},
|
|
397
|
+
},
|
|
398
|
+
output_type: 'image',
|
|
399
|
+
image_format: 'png',
|
|
400
|
+
})
|
|
401
|
+
});
|
|
402
|
+
const text = await response.text();
|
|
403
|
+
let data;
|
|
404
|
+
try {
|
|
405
|
+
data = JSON.parse(text);
|
|
406
|
+
}
|
|
407
|
+
catch (jsonError) {
|
|
408
|
+
console.error('[Render] JSON parse error:', text.substring(0, 200));
|
|
409
|
+
return {
|
|
410
|
+
ok: false,
|
|
411
|
+
code: response.status || 500,
|
|
412
|
+
message: `Modal endpoint error: ${text.substring(0, 100)}`,
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
if (data.status === 'error' || !response.ok) {
|
|
416
|
+
return {
|
|
417
|
+
ok: false,
|
|
418
|
+
code: response.status,
|
|
419
|
+
message: data.error ?? data.message ?? 'Failed to submit iMessage DM job',
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
return {
|
|
423
|
+
ok: true,
|
|
424
|
+
code: 200,
|
|
425
|
+
message: "iMessage DM job submitted",
|
|
426
|
+
data,
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
catch (error) {
|
|
430
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
431
|
+
console.error('[Render] Submit iMessage DM error:', error);
|
|
432
|
+
return {
|
|
433
|
+
ok: false,
|
|
434
|
+
code: 500,
|
|
435
|
+
message: `Failed to submit iMessage DM job: ${errorMessage}`,
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
}
|
|
308
439
|
}
|
|
309
440
|
exports.RenderClient = RenderClient;
|