ugcinc 1.2.2 → 1.4.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 +40 -1
- package/dist/posts.d.ts +1 -0
- package/dist/types.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -52,7 +52,8 @@ For complete API documentation, including all endpoints, parameters, and example
|
|
|
52
52
|
### Posts
|
|
53
53
|
- Create video posts
|
|
54
54
|
- Create slideshow posts
|
|
55
|
-
- Get post status
|
|
55
|
+
- Get post status (includes TikTok URL when complete)
|
|
56
|
+
- Get posts with filters (by accountIds, postIds, date range)
|
|
56
57
|
- Get post statistics
|
|
57
58
|
|
|
58
59
|
### Tasks
|
|
@@ -112,6 +113,44 @@ const response = await client.posts.createVideo({
|
|
|
112
113
|
});
|
|
113
114
|
```
|
|
114
115
|
|
|
116
|
+
**Get posts with filters:**
|
|
117
|
+
```typescript
|
|
118
|
+
// Get specific posts by ID
|
|
119
|
+
const response = await client.posts.getPosts({
|
|
120
|
+
postIds: ['post-uuid-1', 'post-uuid-2']
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
// Get posts by account
|
|
124
|
+
const response = await client.posts.getPosts({
|
|
125
|
+
accountIds: ['account-uuid']
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (response.ok) {
|
|
129
|
+
response.data.forEach(post => {
|
|
130
|
+
console.log(`Post ${post.id}: ${post.status}`);
|
|
131
|
+
// For complete posts, postUrl will contain the TikTok video link
|
|
132
|
+
if (post.postUrl) {
|
|
133
|
+
console.log(`Watch at: ${post.postUrl}`);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Check post status:**
|
|
140
|
+
```typescript
|
|
141
|
+
const response = await client.posts.getStatus({
|
|
142
|
+
postId: 'post-uuid'
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
if (response.ok) {
|
|
146
|
+
console.log(`Status: ${response.data.status}`);
|
|
147
|
+
// postUrl is available when status is "complete"
|
|
148
|
+
if (response.data.postUrl) {
|
|
149
|
+
console.log(`TikTok URL: ${response.data.postUrl}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
115
154
|
## TypeScript Support
|
|
116
155
|
|
|
117
156
|
This package is written in TypeScript and provides full type definitions:
|
package/dist/posts.d.ts
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -81,6 +81,8 @@ export interface Post {
|
|
|
81
81
|
caption: string | null;
|
|
82
82
|
media_urls: string[] | null;
|
|
83
83
|
music_post_id: string | null;
|
|
84
|
+
scheduled_at: string | null;
|
|
85
|
+
postUrl?: string;
|
|
84
86
|
}
|
|
85
87
|
export interface PostStat {
|
|
86
88
|
id: string;
|
|
@@ -132,6 +134,7 @@ export interface GetTasksParams {
|
|
|
132
134
|
}
|
|
133
135
|
export interface GetPostsParams {
|
|
134
136
|
accountIds?: string[];
|
|
137
|
+
postIds?: string[];
|
|
135
138
|
startDate?: string;
|
|
136
139
|
endDate?: string;
|
|
137
140
|
}
|