ugcinc 2.66.0 → 2.67.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.
@@ -1,5 +1,5 @@
1
1
  import { BaseClient } from './base';
2
- import type { CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, ApiResponse } from './types';
2
+ import type { CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, GetCommentsParams, Comment, ApiResponse } from './types';
3
3
  /**
4
4
  * Client for managing comments
5
5
  */
@@ -8,7 +8,7 @@ export declare class CommentsClient extends BaseClient {
8
8
  * Create a comment task
9
9
  *
10
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.
11
+ * Returns a commentId that can be used to check the status of the comment.
12
12
  *
13
13
  * @example
14
14
  * ```typescript
@@ -19,21 +19,21 @@ export declare class CommentsClient extends BaseClient {
19
19
  * });
20
20
  *
21
21
  * if (response.ok) {
22
- * console.log('Task ID:', response.data.taskId);
22
+ * console.log('Comment ID:', response.data.commentId);
23
23
  * }
24
24
  * ```
25
25
  */
26
26
  createComment(params: CreateCommentParams): Promise<ApiResponse<CreateCommentResponse>>;
27
27
  /**
28
- * Get comment task status
28
+ * Get comment status (live check)
29
29
  *
30
- * Check the status of a previously created comment task.
30
+ * Check the current status of a comment by querying the automation API.
31
31
  * Returns the current status and comment URL if completed.
32
32
  *
33
33
  * @example
34
34
  * ```typescript
35
35
  * const response = await client.comments.getStatus({
36
- * taskId: 'task-123'
36
+ * commentId: 'comment-123'
37
37
  * });
38
38
  *
39
39
  * if (response.ok) {
@@ -46,4 +46,25 @@ export declare class CommentsClient extends BaseClient {
46
46
  * ```
47
47
  */
48
48
  getStatus(params: GetCommentStatusParams): Promise<ApiResponse<CommentStatusResponse>>;
49
+ /**
50
+ * Get comments
51
+ *
52
+ * Get comments for the organization, optionally filtered by commentIds, accountIds, or tag.
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * // Get all comments
57
+ * const response = await client.comments.getComments();
58
+ *
59
+ * // Get specific comments by IDs
60
+ * const response = await client.comments.getComments({ commentIds: ['id1', 'id2'] });
61
+ *
62
+ * // Get comments for specific accounts
63
+ * const response = await client.comments.getComments({ accountIds: ['acc1', 'acc2'] });
64
+ *
65
+ * // Get comments for accounts with a specific tag
66
+ * const response = await client.comments.getComments({ tag: 'campaign-1' });
67
+ * ```
68
+ */
69
+ getComments(params?: GetCommentsParams): Promise<ApiResponse<Comment[]>>;
49
70
  }
package/dist/comments.js CHANGED
@@ -10,7 +10,7 @@ class CommentsClient extends base_1.BaseClient {
10
10
  * Create a comment task
11
11
  *
12
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.
13
+ * Returns a commentId that can be used to check the status of the comment.
14
14
  *
15
15
  * @example
16
16
  * ```typescript
@@ -21,7 +21,7 @@ class CommentsClient extends base_1.BaseClient {
21
21
  * });
22
22
  *
23
23
  * if (response.ok) {
24
- * console.log('Task ID:', response.data.taskId);
24
+ * console.log('Comment ID:', response.data.commentId);
25
25
  * }
26
26
  * ```
27
27
  */
@@ -29,15 +29,15 @@ class CommentsClient extends base_1.BaseClient {
29
29
  return this.post('/comment/create', params);
30
30
  }
31
31
  /**
32
- * Get comment task status
32
+ * Get comment status (live check)
33
33
  *
34
- * Check the status of a previously created comment task.
34
+ * Check the current status of a comment by querying the automation API.
35
35
  * Returns the current status and comment URL if completed.
36
36
  *
37
37
  * @example
38
38
  * ```typescript
39
39
  * const response = await client.comments.getStatus({
40
- * taskId: 'task-123'
40
+ * commentId: 'comment-123'
41
41
  * });
42
42
  *
43
43
  * if (response.ok) {
@@ -50,7 +50,30 @@ class CommentsClient extends base_1.BaseClient {
50
50
  * ```
51
51
  */
52
52
  async getStatus(params) {
53
- return this.post('/comment', params);
53
+ return this.post('/comment/status', params);
54
+ }
55
+ /**
56
+ * Get comments
57
+ *
58
+ * Get comments for the organization, optionally filtered by commentIds, accountIds, or tag.
59
+ *
60
+ * @example
61
+ * ```typescript
62
+ * // Get all comments
63
+ * const response = await client.comments.getComments();
64
+ *
65
+ * // Get specific comments by IDs
66
+ * const response = await client.comments.getComments({ commentIds: ['id1', 'id2'] });
67
+ *
68
+ * // Get comments for specific accounts
69
+ * const response = await client.comments.getComments({ accountIds: ['acc1', 'acc2'] });
70
+ *
71
+ * // Get comments for accounts with a specific tag
72
+ * const response = await client.comments.getComments({ tag: 'campaign-1' });
73
+ * ```
74
+ */
75
+ async getComments(params) {
76
+ return this.post('/comment', params ?? {});
54
77
  }
55
78
  }
56
79
  exports.CommentsClient = CommentsClient;
package/dist/index.d.ts CHANGED
@@ -15,4 +15,4 @@ export { MediaClient } from './media';
15
15
  export { CommentsClient } from './comments';
16
16
  export type { RenderJobResponse, RenderJobStatus, SubmitImageRenderJobParams, SubmitVideoRenderJobParams, RenderVideoEditorConfig, } from './render';
17
17
  export type { ClientConfig, } from './base';
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';
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, Comment, CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, GetCommentsParams, } from './types';
package/dist/types.d.ts CHANGED
@@ -880,16 +880,27 @@ export interface UploadTokenResponse {
880
880
  /**
881
881
  * Comment types
882
882
  */
883
+ export interface Comment {
884
+ id: string;
885
+ accountId: string;
886
+ postUrl: string;
887
+ commentText: string;
888
+ status: 'pending' | 'running' | 'completed' | 'failed';
889
+ commentUrl?: string | null;
890
+ error?: string | null;
891
+ createdAt?: string;
892
+ completedAt?: string | null;
893
+ }
883
894
  export interface CreateCommentParams {
884
895
  accountId: string;
885
896
  postUrl: string;
886
897
  commentText: string;
887
898
  }
888
899
  export interface CreateCommentResponse {
889
- taskId: string;
900
+ commentId: string;
890
901
  }
891
902
  export interface GetCommentStatusParams {
892
- taskId: string;
903
+ commentId: string;
893
904
  }
894
905
  export type CommentStatusResponse = {
895
906
  status: "pending";
@@ -902,3 +913,8 @@ export type CommentStatusResponse = {
902
913
  status: "completed";
903
914
  commentUrl: string;
904
915
  };
916
+ export interface GetCommentsParams {
917
+ commentIds?: string[];
918
+ accountIds?: string[];
919
+ tag?: string;
920
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "2.66.0",
3
+ "version": "2.67.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",