ugcinc 4.8.1 → 4.10.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 +18 -0
- package/dist/posts.d.ts +27 -0
- package/dist/tools/posts.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -109,6 +109,24 @@ await client.posts.createVideo({
|
|
|
109
109
|
});
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
## Post Tags
|
|
113
|
+
|
|
114
|
+
Posts carry an optional custom `tag` for categorization (independent of account tags). Set it with
|
|
115
|
+
the `post_tag` param on `posts.createVideo()`, `posts.createSlideshow()`, `posts.createDraft()`, and
|
|
116
|
+
`posts.updatePost()`; it is returned as `tag` on the `Post` object. Note: on the create endpoints,
|
|
117
|
+
the separate `tag` param filters account auto-selection by ACCOUNT tag and is not stored on the post.
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
await client.posts.createVideo({
|
|
121
|
+
accountId: "acc_123",
|
|
122
|
+
videoUrl: "https://example.com/video.mp4",
|
|
123
|
+
caption: "Post description",
|
|
124
|
+
post_tag: "campaign-july",
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
await client.posts.updatePost({ postId: "post_123", post_tag: "campaign-august" });
|
|
128
|
+
```
|
|
129
|
+
|
|
112
130
|
## Useful Exports
|
|
113
131
|
|
|
114
132
|
- `UGCClient` for API access
|
package/dist/posts.d.ts
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
2
|
import type { ApiResponse } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Why a post failed, as a stable, client-safe category.
|
|
5
|
+
*
|
|
6
|
+
* - `device_error` — the posting device was unavailable or did not respond
|
|
7
|
+
* - `network_error` — the connection dropped while posting
|
|
8
|
+
* - `upload_interrupted` — the upload started but could not be confirmed finished
|
|
9
|
+
* - `account_issue` — the social account was not in a usable state
|
|
10
|
+
* - `capacity_deferred` — no posting capacity was available; the post will be retried
|
|
11
|
+
* - `platform_change` — the social app's interface changed and the post could not complete
|
|
12
|
+
* - `unconfirmed` — posting finished but publication could not be confirmed
|
|
13
|
+
* - `unknown` — the post failed for an unrecognized reason
|
|
14
|
+
*/
|
|
15
|
+
export type PostFailCategory = 'device_error' | 'network_error' | 'upload_interrupted' | 'account_issue' | 'capacity_deferred' | 'platform_change' | 'unconfirmed' | 'unknown';
|
|
3
16
|
export type PostType = 'video' | 'slideshow';
|
|
4
17
|
export type PostStatus = 'draft' | 'scheduled' | 'pending' | 'complete' | 'failed' | 'retrying' | 'deleting' | 'deleted' | 'hidden' | 'require-approval';
|
|
5
18
|
/**
|
|
@@ -20,6 +33,8 @@ export interface Post {
|
|
|
20
33
|
status: PostStatus;
|
|
21
34
|
social_id: string | null;
|
|
22
35
|
caption: string | null;
|
|
36
|
+
/** Custom tag stored on the post itself (set via `post_tag` on create/update) */
|
|
37
|
+
tag: string | null;
|
|
23
38
|
/** Only returned by createVideo; other post endpoints omit it */
|
|
24
39
|
caption_overlays?: CaptionOverlay[] | null;
|
|
25
40
|
title: string | null;
|
|
@@ -59,9 +74,12 @@ export interface CreateSlideshowParams {
|
|
|
59
74
|
imageUrls: string[];
|
|
60
75
|
strict?: boolean;
|
|
61
76
|
mustPostBy?: string;
|
|
77
|
+
/** Account auto-selection filter: only pick accounts whose ACCOUNT tag matches (not stored on the post) */
|
|
62
78
|
tag?: string;
|
|
63
79
|
user_group?: string;
|
|
64
80
|
org_group?: string;
|
|
81
|
+
/** Tag stored on the created POST itself (returned as `tag` on the Post object) */
|
|
82
|
+
post_tag?: string;
|
|
65
83
|
}
|
|
66
84
|
export interface GetPostStatsParams {
|
|
67
85
|
postIds?: string[];
|
|
@@ -81,9 +99,12 @@ export interface CreateVideoParams {
|
|
|
81
99
|
videoUrl: string;
|
|
82
100
|
strict?: boolean;
|
|
83
101
|
mustPostBy?: string;
|
|
102
|
+
/** Account auto-selection filter: only pick accounts whose ACCOUNT tag matches (not stored on the post) */
|
|
84
103
|
tag?: string;
|
|
85
104
|
user_group?: string;
|
|
86
105
|
org_group?: string;
|
|
106
|
+
/** Tag stored on the created POST itself (returned as `tag` on the Post object) */
|
|
107
|
+
post_tag?: string;
|
|
87
108
|
}
|
|
88
109
|
export interface DeletePostsParams {
|
|
89
110
|
postIds: string[];
|
|
@@ -109,6 +130,8 @@ export interface UpdatePostParams {
|
|
|
109
130
|
postTime?: string;
|
|
110
131
|
accountId?: string;
|
|
111
132
|
mediaUrls?: string[];
|
|
133
|
+
/** New tag stored on the post (returned as `tag` on the Post object) */
|
|
134
|
+
post_tag?: string;
|
|
112
135
|
excludePostIds?: string[];
|
|
113
136
|
}
|
|
114
137
|
export interface SetPostStatusParams {
|
|
@@ -130,6 +153,8 @@ export interface CreateDraftParams {
|
|
|
130
153
|
caption?: string;
|
|
131
154
|
title?: string;
|
|
132
155
|
socialAudioId?: string;
|
|
156
|
+
/** Tag stored on the created POST itself (returned as `tag` on the Post object) */
|
|
157
|
+
post_tag?: string;
|
|
133
158
|
}
|
|
134
159
|
export interface PreviewScheduleParams {
|
|
135
160
|
entries: PreviewScheduleEntry[];
|
|
@@ -172,6 +197,8 @@ export declare class PostsClient extends BaseClient {
|
|
|
172
197
|
post_id: string;
|
|
173
198
|
status: string;
|
|
174
199
|
postUrl?: string;
|
|
200
|
+
/** Set when status is "failed"; null otherwise. */
|
|
201
|
+
fail_category: PostFailCategory | null;
|
|
175
202
|
}>>;
|
|
176
203
|
/**
|
|
177
204
|
* Create a video post
|
package/dist/tools/posts.js
CHANGED
|
@@ -32,6 +32,7 @@ exports.postTools = [
|
|
|
32
32
|
tag: zod_1.z.string().optional().describe('Filter accounts by tag (for auto-selection)'),
|
|
33
33
|
user_group: zod_1.z.string().optional().describe('Filter accounts by user group (for auto-selection)'),
|
|
34
34
|
org_group: zod_1.z.string().optional().describe('Filter accounts by org group (for auto-selection)'),
|
|
35
|
+
post_tag: zod_1.z.string().optional().describe('Tag stored on the created post itself (distinct from the account-filter tag)'),
|
|
35
36
|
}),
|
|
36
37
|
execute: async (client, params) => {
|
|
37
38
|
return client.posts.createVideo(params);
|
|
@@ -52,6 +53,7 @@ exports.postTools = [
|
|
|
52
53
|
tag: zod_1.z.string().optional().describe('Filter accounts by tag (for auto-selection)'),
|
|
53
54
|
user_group: zod_1.z.string().optional().describe('Filter accounts by user group (for auto-selection)'),
|
|
54
55
|
org_group: zod_1.z.string().optional().describe('Filter accounts by org group (for auto-selection)'),
|
|
56
|
+
post_tag: zod_1.z.string().optional().describe('Tag stored on the created post itself (distinct from the account-filter tag)'),
|
|
55
57
|
}),
|
|
56
58
|
execute: async (client, params) => {
|
|
57
59
|
return client.posts.createSlideshow(params);
|
|
@@ -66,6 +68,7 @@ exports.postTools = [
|
|
|
66
68
|
caption: zod_1.z.string().optional().describe('Post caption'),
|
|
67
69
|
title: zod_1.z.string().optional().describe('Slideshow title'),
|
|
68
70
|
socialAudioId: zod_1.z.string().optional().describe('Social audio ID'),
|
|
71
|
+
post_tag: zod_1.z.string().optional().describe('Tag stored on the created post'),
|
|
69
72
|
}),
|
|
70
73
|
execute: async (client, params) => {
|
|
71
74
|
return client.posts.createDraft(params);
|
|
@@ -92,6 +95,7 @@ exports.postTools = [
|
|
|
92
95
|
postTime: zod_1.z.string().optional().describe('New scheduled time (ISO 8601)'),
|
|
93
96
|
accountId: zod_1.z.string().optional().describe('Move post to different account'),
|
|
94
97
|
mediaUrls: zod_1.z.array(zod_1.z.string()).optional().describe('New media URLs'),
|
|
98
|
+
post_tag: zod_1.z.string().optional().describe('New tag stored on the post'),
|
|
95
99
|
}),
|
|
96
100
|
execute: async (client, params) => {
|
|
97
101
|
return client.posts.updatePost(params);
|