ugcinc 1.8.0 → 2.1.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
@@ -50,8 +50,12 @@ For complete API documentation, including all endpoints, parameters, and example
50
50
  - Update social profile (avatar, nickname, bio)
51
51
 
52
52
  ### Posts
53
- - Create video posts
54
- - Create slideshow posts
53
+ - Create video posts (with specific account or auto-select)
54
+ - Create slideshow posts (with specific account or auto-select)
55
+ - **Auto-selection modes:**
56
+ - `strict: true` - Picks least recently posted account, must post at exact time
57
+ - `strict: false` - Picks account with closest available time slot
58
+ - Auto-account selection supports filtering by tag, user_group, and org_group
55
59
  - Get post status (includes platform URL when complete - TikTok or Instagram)
56
60
  - Get posts with filters (by accountIds, postIds, date range)
57
61
  - Get post statistics
@@ -132,11 +136,73 @@ if (response.ok) {
132
136
 
133
137
  **Create a video post:**
134
138
  ```typescript
139
+ // Create video post with specific account
135
140
  const response = await client.posts.createVideo({
136
141
  accountId: 'account-uuid',
137
142
  videoUrl: 'https://example.com/video.mp4',
138
143
  caption: 'Check out this video!',
139
144
  });
145
+
146
+ // Auto-select with strict=true: picks least recently posted account, must post at exact time
147
+ const response = await client.posts.createVideo({
148
+ accountId: null,
149
+ videoUrl: 'https://example.com/video.mp4',
150
+ caption: 'Auto-selected account!',
151
+ postTime: '2024-01-15T10:00:00Z',
152
+ strict: true // Will error if that account can't post at exactly 10:00 AM
153
+ });
154
+
155
+ // Auto-select with strict=false: picks account with closest available time slot
156
+ const response = await client.posts.createVideo({
157
+ accountId: null,
158
+ videoUrl: 'https://example.com/video.mp4',
159
+ caption: 'Posts as soon as possible!',
160
+ postTime: '2024-01-15T10:00:00Z',
161
+ strict: false // Finds account that can post closest to 10:00 AM
162
+ });
163
+
164
+ // Auto-select with filters (tag, user_group, org_group)
165
+ const response = await client.posts.createVideo({
166
+ accountId: null,
167
+ videoUrl: 'https://example.com/video.mp4',
168
+ caption: 'Filtered auto-selection!',
169
+ tag: 'production',
170
+ org_group: 'group1',
171
+ strict: false
172
+ });
173
+ ```
174
+
175
+ **Create a slideshow post:**
176
+ ```typescript
177
+ // Create slideshow with specific account
178
+ const response = await client.posts.createSlideshow({
179
+ accountId: 'account-uuid',
180
+ imageUrls: [
181
+ 'https://example.com/image1.jpg',
182
+ 'https://example.com/image2.jpg',
183
+ 'https://example.com/image3.jpg'
184
+ ],
185
+ caption: 'Amazing slideshow!',
186
+ });
187
+
188
+ // Auto-select with strict=true: picks least recently posted account
189
+ const response = await client.posts.createSlideshow({
190
+ accountId: null,
191
+ imageUrls: ['image1.jpg', 'image2.jpg'],
192
+ caption: 'Posts at exact time or errors',
193
+ postTime: '2024-01-15T14:00:00Z',
194
+ strict: true,
195
+ user_group: 'creators'
196
+ });
197
+
198
+ // Auto-select with strict=false: picks account with closest available time
199
+ const response = await client.posts.createSlideshow({
200
+ accountId: null,
201
+ imageUrls: ['image1.jpg', 'image2.jpg'],
202
+ caption: 'Posts at nearest available time',
203
+ postTime: '2024-01-15T14:00:00Z',
204
+ strict: false
205
+ });
140
206
  ```
141
207
 
142
208
  **Get posts with filters:**
package/dist/types.d.ts CHANGED
@@ -142,12 +142,15 @@ export interface GetPostsParams {
142
142
  endDate?: string;
143
143
  }
144
144
  export interface CreateSlideshowParams {
145
- accountId: string;
145
+ accountId: string | null;
146
146
  caption?: string;
147
147
  musicPostId?: string;
148
148
  postTime?: string;
149
149
  imageUrls: string[];
150
150
  strict?: boolean;
151
+ tag?: string;
152
+ user_group?: string;
153
+ org_group?: string;
151
154
  }
152
155
  export interface GetPostStatsParams {
153
156
  postIds?: string[];
@@ -158,12 +161,15 @@ export interface GetPostStatusParams {
158
161
  postId: string;
159
162
  }
160
163
  export interface CreateVideoParams {
161
- accountId: string;
164
+ accountId: string | null;
162
165
  caption?: string;
163
166
  musicPostId?: string;
164
167
  postTime?: string;
165
168
  videoUrl: string;
166
169
  strict?: boolean;
170
+ tag?: string;
171
+ user_group?: string;
172
+ org_group?: string;
167
173
  }
168
174
  export interface DeletePostsParams {
169
175
  postIds: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "1.8.0",
3
+ "version": "2.1.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",