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 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
@@ -18,6 +18,7 @@ export declare class PostsClient extends BaseClient {
18
18
  getStatus(params: GetPostStatusParams): Promise<ApiResponse<{
19
19
  post_id: string;
20
20
  status: string;
21
+ postUrl?: string;
21
22
  }>>;
22
23
  /**
23
24
  * Create a video post
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "1.2.2",
3
+ "version": "1.4.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",