ugcinc 2.65.1 → 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.
- package/README.md +39 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.js +2 -0
- package/dist/comments.d.ts +70 -0
- package/dist/comments.js +79 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/types.d.ts +41 -0
- package/package.json +1 -1
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,70 @@
|
|
|
1
|
+
import { BaseClient } from './base';
|
|
2
|
+
import type { CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, GetCommentsParams, Comment, 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 commentId 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('Comment ID:', response.data.commentId);
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
createComment(params: CreateCommentParams): Promise<ApiResponse<CreateCommentResponse>>;
|
|
27
|
+
/**
|
|
28
|
+
* Get comment status (live check)
|
|
29
|
+
*
|
|
30
|
+
* Check the current status of a comment by querying the automation API.
|
|
31
|
+
* Returns the current status and comment URL if completed.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const response = await client.comments.getStatus({
|
|
36
|
+
* commentId: 'comment-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
|
+
/**
|
|
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[]>>;
|
|
70
|
+
}
|
package/dist/comments.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
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 commentId 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('Comment ID:', response.data.commentId);
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
async createComment(params) {
|
|
29
|
+
return this.post('/comment/create', params);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get comment status (live check)
|
|
33
|
+
*
|
|
34
|
+
* Check the current status of a comment by querying the automation API.
|
|
35
|
+
* Returns the current status and comment URL if completed.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* const response = await client.comments.getStatus({
|
|
40
|
+
* commentId: 'comment-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/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 ?? {});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
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, Comment, CreateCommentParams, CreateCommentResponse, GetCommentStatusParams, CommentStatusResponse, GetCommentsParams, } 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,44 @@ export interface UploadTokenResponse {
|
|
|
877
877
|
clientToken: string;
|
|
878
878
|
pathname: string;
|
|
879
879
|
}
|
|
880
|
+
/**
|
|
881
|
+
* Comment types
|
|
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
|
+
}
|
|
894
|
+
export interface CreateCommentParams {
|
|
895
|
+
accountId: string;
|
|
896
|
+
postUrl: string;
|
|
897
|
+
commentText: string;
|
|
898
|
+
}
|
|
899
|
+
export interface CreateCommentResponse {
|
|
900
|
+
commentId: string;
|
|
901
|
+
}
|
|
902
|
+
export interface GetCommentStatusParams {
|
|
903
|
+
commentId: string;
|
|
904
|
+
}
|
|
905
|
+
export type CommentStatusResponse = {
|
|
906
|
+
status: "pending";
|
|
907
|
+
} | {
|
|
908
|
+
status: "running";
|
|
909
|
+
} | {
|
|
910
|
+
status: "failed";
|
|
911
|
+
error: string;
|
|
912
|
+
} | {
|
|
913
|
+
status: "completed";
|
|
914
|
+
commentUrl: string;
|
|
915
|
+
};
|
|
916
|
+
export interface GetCommentsParams {
|
|
917
|
+
commentIds?: string[];
|
|
918
|
+
accountIds?: string[];
|
|
919
|
+
tag?: string;
|
|
920
|
+
}
|