ugcinc 2.5.1 → 2.6.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.
@@ -0,0 +1,46 @@
1
+ import type { NodeControlConfig, MediaType, NodePort, NodeTypeEnum, WorkflowDefinition, AutomationRun, NodeRun, ApiResponse } from './types';
2
+ import { BaseClient } from './base';
3
+ export declare class AutomationsClient extends BaseClient {
4
+ /**
5
+ * Create a new automation template
6
+ */
7
+ createTemplate(params: {
8
+ orgId: string;
9
+ name: string;
10
+ description?: string;
11
+ workflowDefinition: WorkflowDefinition;
12
+ }): Promise<ApiResponse<string>>;
13
+ /**
14
+ * Delete an automation template
15
+ */
16
+ deleteTemplate(params: {
17
+ templateId: string;
18
+ }): Promise<ApiResponse<null>>;
19
+ /**
20
+ * Run an automation template
21
+ */
22
+ run(params: {
23
+ templateId: string;
24
+ orgId: string;
25
+ }): Promise<ApiResponse<{
26
+ runId: string;
27
+ }>>;
28
+ /**
29
+ * Get automation run status
30
+ */
31
+ getStatus(params: {
32
+ runId: string;
33
+ }): Promise<ApiResponse<{
34
+ run: AutomationRun;
35
+ nodes: NodeRun[];
36
+ }>>;
37
+ }
38
+ /**
39
+ * Get all available automation nodes
40
+ */
41
+ export declare function getAllNodes(): NodeControlConfig[];
42
+ /**
43
+ * Get a specific node by type
44
+ */
45
+ export declare function getNodeByType(type: string): NodeControlConfig | undefined;
46
+ export type { NodeControlConfig, MediaType, NodePort, NodeTypeEnum };
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AutomationsClient = void 0;
4
+ exports.getAllNodes = getAllNodes;
5
+ exports.getNodeByType = getNodeByType;
6
+ const base_1 = require("./base");
7
+ class AutomationsClient extends base_1.BaseClient {
8
+ /**
9
+ * Create a new automation template
10
+ */
11
+ async createTemplate(params) {
12
+ return this.request('/automations/create', {
13
+ method: 'POST',
14
+ body: JSON.stringify(params),
15
+ });
16
+ }
17
+ /**
18
+ * Delete an automation template
19
+ */
20
+ async deleteTemplate(params) {
21
+ return this.request('/automations/delete', {
22
+ method: 'DELETE',
23
+ body: JSON.stringify(params),
24
+ });
25
+ }
26
+ /**
27
+ * Run an automation template
28
+ */
29
+ async run(params) {
30
+ return this.request('/automations/run', {
31
+ method: 'POST',
32
+ body: JSON.stringify(params),
33
+ });
34
+ }
35
+ /**
36
+ * Get automation run status
37
+ */
38
+ async getStatus(params) {
39
+ return this.request('/automations/status', {
40
+ method: 'POST',
41
+ body: JSON.stringify(params),
42
+ });
43
+ }
44
+ }
45
+ exports.AutomationsClient = AutomationsClient;
46
+ /**
47
+ * Get all available automation nodes
48
+ */
49
+ function getAllNodes() {
50
+ return [
51
+ {
52
+ type: "image",
53
+ label: "Image",
54
+ description: "Import image files",
55
+ category: "Input",
56
+ inputs: [],
57
+ outputs: [
58
+ {
59
+ id: "outputImage",
60
+ title: "Image",
61
+ type: "image",
62
+ required: true,
63
+ },
64
+ ],
65
+ },
66
+ {
67
+ type: "video",
68
+ label: "Video",
69
+ description: "Import video files",
70
+ category: "Input",
71
+ inputs: [],
72
+ outputs: [
73
+ {
74
+ id: "outputVideo",
75
+ title: "Video",
76
+ type: "video",
77
+ required: true,
78
+ },
79
+ ],
80
+ },
81
+ {
82
+ type: "audio",
83
+ label: "Audio",
84
+ description: "Import audio files",
85
+ category: "Input",
86
+ inputs: [],
87
+ outputs: [
88
+ {
89
+ id: "outputAudio",
90
+ title: "Audio",
91
+ type: "audio",
92
+ required: true,
93
+ },
94
+ ],
95
+ },
96
+ {
97
+ type: "image-editor",
98
+ label: "Image Editor",
99
+ description: "Edit and transform images",
100
+ category: "Input",
101
+ inputs: [
102
+ {
103
+ id: "inputImage",
104
+ title: "Image",
105
+ type: "image",
106
+ required: true,
107
+ },
108
+ ],
109
+ outputs: [
110
+ {
111
+ id: "outputImage",
112
+ title: "Edited Image",
113
+ type: "image",
114
+ required: true,
115
+ },
116
+ ],
117
+ },
118
+ {
119
+ type: "video-editor",
120
+ label: "Video Editor",
121
+ description: "Edit and transform videos",
122
+ category: "Input",
123
+ inputs: [
124
+ {
125
+ id: "inputVideo",
126
+ title: "Video",
127
+ type: "video",
128
+ required: true,
129
+ },
130
+ ],
131
+ outputs: [
132
+ {
133
+ id: "outputVideo",
134
+ title: "Edited Video",
135
+ type: "video",
136
+ required: true,
137
+ },
138
+ ],
139
+ },
140
+ {
141
+ type: "llm",
142
+ label: "LLM",
143
+ description: "Process input with a Large Language Model",
144
+ category: "Input",
145
+ inputs: [
146
+ {
147
+ id: "inputPrompt",
148
+ title: "Prompt",
149
+ type: "text",
150
+ required: true,
151
+ },
152
+ ],
153
+ outputs: [
154
+ {
155
+ id: "outputResponse",
156
+ title: "Response",
157
+ type: "text",
158
+ required: true,
159
+ },
160
+ ],
161
+ },
162
+ ];
163
+ }
164
+ /**
165
+ * Get a specific node by type
166
+ */
167
+ function getNodeByType(type) {
168
+ return getAllNodes().find(node => node.type === type);
169
+ }
package/dist/client.d.ts CHANGED
@@ -4,6 +4,7 @@ import { PostsClient } from './posts';
4
4
  import { StatsClient } from './stats';
5
5
  import { OrganizationClient } from './org';
6
6
  import { RenderClient } from './render';
7
+ import { AutomationsClient } from './automations';
7
8
  import type { ClientConfig } from './base';
8
9
  /**
9
10
  * Main UGC Inc API Client
@@ -55,5 +56,9 @@ export declare class UGCClient {
55
56
  * Client for video rendering operations
56
57
  */
57
58
  render: RenderClient;
59
+ /**
60
+ * Client for automation workflow operations
61
+ */
62
+ automations: AutomationsClient;
58
63
  constructor(config: ClientConfig);
59
64
  }
package/dist/client.js CHANGED
@@ -7,6 +7,7 @@ const posts_1 = require("./posts");
7
7
  const stats_1 = require("./stats");
8
8
  const org_1 = require("./org");
9
9
  const render_1 = require("./render");
10
+ const automations_1 = require("./automations");
10
11
  /**
11
12
  * Main UGC Inc API Client
12
13
  *
@@ -40,6 +41,7 @@ class UGCClient {
40
41
  this.stats = new stats_1.StatsClient(config);
41
42
  this.org = new org_1.OrganizationClient(config);
42
43
  this.render = new render_1.RenderClient(config);
44
+ this.automations = new automations_1.AutomationsClient(config);
43
45
  }
44
46
  }
45
47
  exports.UGCClient = UGCClient;
package/dist/index.d.ts CHANGED
@@ -10,5 +10,6 @@ export { PostsClient } from './posts';
10
10
  export { StatsClient } from './stats';
11
11
  export { OrganizationClient } from './org';
12
12
  export { RenderClient } from './render';
13
+ export { AutomationsClient, getAllNodes, getNodeByType } from './automations';
13
14
  export type { ClientConfig, } from './base';
14
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, RenderJobSubmit, RenderVideoRequest, RenderImageRequest, RenderJobResponse, RenderJobStatus, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, } from './types';
15
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, EditorConfig, VideoEditorConfig, ImageEditorConfig, EditorChannel, TimeValue, BaseSegmentProps, VisualSegmentProps, EditorSegment, VideoSegment, AudioSegment, ImageSegment, TextSegment, StaticSegment, RenderJobSubmit, RenderVideoRequest, RenderImageRequest, RenderJobResponse, RenderJobStatus, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, MediaType, NodePort, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, AutomationTemplate, AutomationRun, NodeRun, } from './types';
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * Official TypeScript/JavaScript client for the UGC Inc API
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
8
+ exports.getNodeByType = exports.getAllNodes = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
9
9
  var client_1 = require("./client");
10
10
  Object.defineProperty(exports, "UGCClient", { enumerable: true, get: function () { return client_1.UGCClient; } });
11
11
  var accounts_1 = require("./accounts");
@@ -20,3 +20,7 @@ var org_1 = require("./org");
20
20
  Object.defineProperty(exports, "OrganizationClient", { enumerable: true, get: function () { return org_1.OrganizationClient; } });
21
21
  var render_1 = require("./render");
22
22
  Object.defineProperty(exports, "RenderClient", { enumerable: true, get: function () { return render_1.RenderClient; } });
23
+ var automations_1 = require("./automations");
24
+ Object.defineProperty(exports, "AutomationsClient", { enumerable: true, get: function () { return automations_1.AutomationsClient; } });
25
+ Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function () { return automations_1.getAllNodes; } });
26
+ Object.defineProperty(exports, "getNodeByType", { enumerable: true, get: function () { return automations_1.getNodeByType; } });
package/dist/types.d.ts CHANGED
@@ -463,4 +463,61 @@ export interface RenderJobStatus {
463
463
  completed_at?: number;
464
464
  error?: string;
465
465
  }
466
+ /**
467
+ * Automation types
468
+ */
469
+ export type MediaType = 'video' | 'image' | 'audio' | 'text';
470
+ export interface NodePort {
471
+ id: string;
472
+ title: string;
473
+ type: MediaType | MediaType[];
474
+ required: boolean;
475
+ }
476
+ export interface NodeControlConfig {
477
+ type: string;
478
+ label: string;
479
+ description: string;
480
+ category: string;
481
+ inputs: NodePort[];
482
+ outputs: NodePort[];
483
+ }
484
+ export type NodeTypeEnum = 'image' | 'video' | 'audio' | 'image-editor' | 'video-editor' | 'llm';
485
+ export interface WorkflowNodeDefinition {
486
+ id: string;
487
+ type: NodeTypeEnum;
488
+ inputs: Record<string, {
489
+ sourceNodeId: string;
490
+ sourceOutputId: string;
491
+ }>;
492
+ }
493
+ export interface WorkflowDefinition {
494
+ nodes: WorkflowNodeDefinition[];
495
+ }
496
+ export interface AutomationTemplate {
497
+ id: string;
498
+ org_id: string;
499
+ name: string;
500
+ description: string | null;
501
+ workflow_definition: WorkflowDefinition;
502
+ created_at: string;
503
+ }
504
+ export interface AutomationRun {
505
+ id: string;
506
+ template_id: string;
507
+ org_id: string;
508
+ status: 'pending' | 'running' | 'completed' | 'failed';
509
+ created_at: string;
510
+ completed_at: string | null;
511
+ }
512
+ export interface NodeRun {
513
+ id: string;
514
+ automation_run_id: string;
515
+ template_node_id: string;
516
+ type: NodeTypeEnum;
517
+ status: 'pending' | 'running' | 'completed' | 'failed';
518
+ input_data: Record<string, unknown> | null;
519
+ output_data: Record<string, unknown> | null;
520
+ created_at: string;
521
+ completed_at: string | null;
522
+ }
466
523
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.5.1",
3
+ "version": "2.6.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",