ugcinc 2.65.1 → 2.66.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/README.md CHANGED
@@ -62,6 +62,11 @@ For complete API documentation, including all endpoints, parameters, and example
62
62
  - Get posts with filters (by accountIds, postIds, date range)
63
63
  - Get post statistics
64
64
 
65
+ ### Comments
66
+ - Create comment tasks (comment on TikTok posts using your accounts)
67
+ - Get comment task status (check if comment was posted successfully)
68
+ - Returns comment URL when completed
69
+
65
70
  ### Tasks
66
71
  - Get scheduled tasks
67
72
  - View task history
@@ -340,6 +345,40 @@ if (response.ok) {
340
345
  }
341
346
  ```
342
347
 
348
+ **Create a comment task:**
349
+ ```typescript
350
+ // Create a comment on a TikTok post
351
+ const response = await client.comments.createComment({
352
+ accountId: 'account-uuid',
353
+ postUrl: 'https://www.tiktok.com/@user/video/1234567890',
354
+ commentText: 'Great video! 🔥'
355
+ });
356
+
357
+ if (response.ok) {
358
+ console.log('Comment task created:', response.data.taskId);
359
+ // Use taskId to check status later
360
+ }
361
+ ```
362
+
363
+ **Check comment task status:**
364
+ ```typescript
365
+ const response = await client.comments.getStatus({
366
+ taskId: 'task-uuid'
367
+ });
368
+
369
+ if (response.ok) {
370
+ console.log(`Status: ${response.data.status}`);
371
+
372
+ if (response.data.status === 'completed') {
373
+ console.log(`Comment URL: ${response.data.commentUrl}`);
374
+ } else if (response.data.status === 'failed') {
375
+ console.log(`Error: ${response.data.error}`);
376
+ } else if (response.data.status === 'pending' || response.data.status === 'running') {
377
+ console.log('Comment is still being processed...');
378
+ }
379
+ }
380
+ ```
381
+
343
382
  **Retry tasks:**
344
383
  ```typescript
345
384
  const response = await client.tasks.retryTasks({
package/dist/client.d.ts CHANGED
@@ -5,6 +5,7 @@ import { StatsClient } from './stats';
5
5
  import { OrganizationClient } from './org';
6
6
  import { AutomationsClient } from './automations';
7
7
  import { MediaClient } from './media';
8
+ import { CommentsClient } from './comments';
8
9
  import type { ClientConfig } from './base';
9
10
  /**
10
11
  * Main UGC Inc API Client
@@ -60,5 +61,9 @@ export declare class UGCClient {
60
61
  * Client for media operations
61
62
  */
62
63
  media: MediaClient;
64
+ /**
65
+ * Client for comment operations
66
+ */
67
+ comments: CommentsClient;
63
68
  constructor(config: ClientConfig);
64
69
  }
package/dist/client.js CHANGED
@@ -8,6 +8,7 @@ const stats_1 = require("./stats");
8
8
  const org_1 = require("./org");
9
9
  const automations_1 = require("./automations");
10
10
  const media_1 = require("./media");
11
+ const comments_1 = require("./comments");
11
12
  /**
12
13
  * Main UGC Inc API Client
13
14
  *
@@ -42,6 +43,7 @@ class UGCClient {
42
43
  this.org = new org_1.OrganizationClient(config);
43
44
  this.automations = new automations_1.AutomationsClient(config);
44
45
  this.media = new media_1.MediaClient(config);
46
+ this.comments = new comments_1.CommentsClient(config);
45
47
  }
46
48
  }
47
49
  exports.UGCClient = UGCClient;
@@ -0,0 +1,49 @@
1
+ import { BaseClient } from './base';
2
+ import type { CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, ApiResponse } from './types';
3
+ /**
4
+ * Client for managing comments
5
+ */
6
+ export declare class CommentsClient extends BaseClient {
7
+ /**
8
+ * Create a comment task
9
+ *
10
+ * Initiates a comment task on a TikTok post using the specified account.
11
+ * Returns a taskId that can be used to check the status of the comment.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const response = await client.comments.createComment({
16
+ * accountId: 'account-123',
17
+ * postUrl: 'https://www.tiktok.com/@user/video/123',
18
+ * commentText: 'Great video!'
19
+ * });
20
+ *
21
+ * if (response.ok) {
22
+ * console.log('Task ID:', response.data.taskId);
23
+ * }
24
+ * ```
25
+ */
26
+ createComment(params: CreateCommentParams): Promise<ApiResponse<CreateCommentResponse>>;
27
+ /**
28
+ * Get comment task status
29
+ *
30
+ * Check the status of a previously created comment task.
31
+ * Returns the current status and comment URL if completed.
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const response = await client.comments.getStatus({
36
+ * taskId: 'task-123'
37
+ * });
38
+ *
39
+ * if (response.ok) {
40
+ * if (response.data.status === 'completed') {
41
+ * console.log('Comment URL:', response.data.commentUrl);
42
+ * } else if (response.data.status === 'failed') {
43
+ * console.log('Error:', response.data.error);
44
+ * }
45
+ * }
46
+ * ```
47
+ */
48
+ getStatus(params: GetCommentStatusParams): Promise<ApiResponse<CommentStatusResponse>>;
49
+ }
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommentsClient = void 0;
4
+ const base_1 = require("./base");
5
+ /**
6
+ * Client for managing comments
7
+ */
8
+ class CommentsClient extends base_1.BaseClient {
9
+ /**
10
+ * Create a comment task
11
+ *
12
+ * Initiates a comment task on a TikTok post using the specified account.
13
+ * Returns a taskId that can be used to check the status of the comment.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const response = await client.comments.createComment({
18
+ * accountId: 'account-123',
19
+ * postUrl: 'https://www.tiktok.com/@user/video/123',
20
+ * commentText: 'Great video!'
21
+ * });
22
+ *
23
+ * if (response.ok) {
24
+ * console.log('Task ID:', response.data.taskId);
25
+ * }
26
+ * ```
27
+ */
28
+ async createComment(params) {
29
+ return this.post('/comment/create', params);
30
+ }
31
+ /**
32
+ * Get comment task status
33
+ *
34
+ * Check the status of a previously created comment task.
35
+ * Returns the current status and comment URL if completed.
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * const response = await client.comments.getStatus({
40
+ * taskId: 'task-123'
41
+ * });
42
+ *
43
+ * if (response.ok) {
44
+ * if (response.data.status === 'completed') {
45
+ * console.log('Comment URL:', response.data.commentUrl);
46
+ * } else if (response.data.status === 'failed') {
47
+ * console.log('Error:', response.data.error);
48
+ * }
49
+ * }
50
+ * ```
51
+ */
52
+ async getStatus(params) {
53
+ return this.post('/comment', params);
54
+ }
55
+ }
56
+ exports.CommentsClient = CommentsClient;
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { OrganizationClient } from './org';
12
12
  export { RenderClient } from './render';
13
13
  export { AutomationsClient, getAllNodes, getNodeByType } from './automations';
14
14
  export { MediaClient } from './media';
15
+ export { CommentsClient } from './comments';
15
16
  export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, RenderVideoEditorConfig, } from './render';
16
17
  export type { ClientConfig, } from './base';
17
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, 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, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, OutputInput, OutputNodeConfig, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, } from './types';
18
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, 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, NodeControlConfig, NodeTypeEnum, WorkflowNodeDefinition, WorkflowDefinition, CanvasState, AutomationTemplate, AutomationRun, NodeRun, OutputSchemaProperty, SelectionMode, ExhaustionBehavior, SelectionConfig, SelectionState, OutputMode, OutputInput, OutputNodeConfig, UserMedia, SocialAudio, Media, GetMediaParams, UploadMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, } 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.MediaClient = exports.getNodeByType = exports.getAllNodes = exports.AutomationsClient = exports.RenderClient = exports.OrganizationClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
8
+ exports.CommentsClient = exports.MediaClient = 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");
@@ -26,3 +26,5 @@ Object.defineProperty(exports, "getAllNodes", { enumerable: true, get: function
26
26
  Object.defineProperty(exports, "getNodeByType", { enumerable: true, get: function () { return automations_1.getNodeByType; } });
27
27
  var media_1 = require("./media");
28
28
  Object.defineProperty(exports, "MediaClient", { enumerable: true, get: function () { return media_1.MediaClient; } });
29
+ var comments_1 = require("./comments");
30
+ Object.defineProperty(exports, "CommentsClient", { enumerable: true, get: function () { return comments_1.CommentsClient; } });
package/dist/types.d.ts CHANGED
@@ -877,3 +877,28 @@ export interface UploadTokenResponse {
877
877
  clientToken: string;
878
878
  pathname: string;
879
879
  }
880
+ /**
881
+ * Comment types
882
+ */
883
+ export interface CreateCommentParams {
884
+ accountId: string;
885
+ postUrl: string;
886
+ commentText: string;
887
+ }
888
+ export interface CreateCommentResponse {
889
+ taskId: string;
890
+ }
891
+ export interface GetCommentStatusParams {
892
+ taskId: string;
893
+ }
894
+ export type CommentStatusResponse = {
895
+ status: "pending";
896
+ } | {
897
+ status: "running";
898
+ } | {
899
+ status: "failed";
900
+ error: string;
901
+ } | {
902
+ status: "completed";
903
+ commentUrl: string;
904
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.65.1",
3
+ "version": "2.66.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",