ugcinc 1.1.2 → 1.1.4

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
@@ -25,159 +25,74 @@ if (response.ok) {
25
25
  }
26
26
  ```
27
27
 
28
- ## Video Rendering
29
-
30
- The UGC Inc API now includes powerful video rendering capabilities. You can create custom videos by composing multiple layers of video, images, text, and audio.
31
-
32
- ### Basic Video Rendering Example
33
-
34
- ```typescript
35
- import { UGCClient } from 'ugcinc';
36
-
37
- const client = new UGCClient({
38
- apiKey: 'your-api-key-here'
39
- });
40
-
41
- const result = await client.video.render({
42
- editor: {
43
- width: 1080,
44
- height: 1920,
45
- fps: 30,
46
- duration: 5000, // 5 seconds in milliseconds
47
- channels: [
48
- {
49
- id: "background",
50
- segments: [
51
- {
52
- id: "bg-video",
53
- type: "video",
54
- source: "https://example.com/background.mp4",
55
- order: 0,
56
- offset: { type: "absolute", value: 0 },
57
- startTrim: 0,
58
- endTrim: 0,
59
- xOffset: 0,
60
- yOffset: 0,
61
- width: 1080,
62
- height: 1920,
63
- zIndex: 0,
64
- scale: 1,
65
- rotation: 0,
66
- fit: "cover",
67
- speed: 1,
68
- opacity: 100,
69
- volume: 50
70
- }
71
- ]
72
- },
73
- {
74
- id: "text-layer",
75
- segments: [
76
- {
77
- id: "title",
78
- type: "text",
79
- source: "",
80
- order: 0,
81
- offset: { type: "absolute", value: 500 },
82
- startTrim: 0,
83
- endTrim: 0,
84
- duration: { type: "absolute", value: 4000 },
85
- xOffset: 90,
86
- yOffset: 800,
87
- width: 900,
88
- height: 320,
89
- zIndex: 10,
90
- scale: 1,
91
- rotation: 0,
92
- text: "Hello World! 🎉",
93
- alignment: "center",
94
- verticalAlign: "middle",
95
- direction: "ltr",
96
- padding: 20,
97
- fontType: "tiktok",
98
- fontSize: 80,
99
- fontWeight: "bold",
100
- lineHeight: 1.2,
101
- letterSpacing: 0,
102
- textWrap: "word",
103
- wordBreak: "break-word",
104
- hyphenation: "none",
105
- maxLines: 0,
106
- textOverflow: "clip",
107
- ellipsis: "...",
108
- color: "#FFFFFF",
109
- backgroundColor: "#00000080",
110
- strokeColor: "#000000",
111
- strokeWidth: 4
112
- }
113
- ]
114
- }
115
- ]
116
- }
117
- });
118
-
119
- if (result.ok) {
120
- console.log('Video URL:', result.data.video_url);
121
- }
122
- ```
28
+ ## Get Your API Key
123
29
 
124
- ### Segment Types
30
+ To get your API key:
125
31
 
126
- The video renderer supports multiple segment types:
32
+ 1. Visit [ugc.inc](https://ugc.inc)
33
+ 2. Schedule a call with our team
34
+ 3. You'll receive your API key after the call
127
35
 
128
- - **video**: Video clips with playback control
129
- - **image**: Static or animated images (including GIFs)
130
- - **text**: Customizable text overlays with fonts, colors, and effects
131
- - **audio**: Audio tracks that can be mixed together
132
- - **editor**: Nested editors for complex compositions
36
+ **Important:** Keep your API key secure! Never commit it to version control or expose it in client-side code.
133
37
 
134
- ### Time Values
38
+ ## Documentation
135
39
 
136
- Time values can be specified as absolute (milliseconds) or relative (0-1 percentage):
40
+ For complete API documentation, including all endpoints, parameters, and examples, visit:
137
41
 
138
- ```typescript
139
- // Absolute time (500ms)
140
- offset: { type: "absolute", value: 500 }
42
+ **[docs.ugc.inc](https://docs.ugc.inc)**
141
43
 
142
- // Relative time (50% of video duration)
143
- offset: { type: "relative", value: 0.5 }
144
- ```
44
+ ## API Features
145
45
 
146
- ### Layering with Channels
46
+ ### Accounts
47
+ - Get accounts with filters
48
+ - Get account status
49
+ - Update account info (tags, groups)
50
+ - Update social profile (avatar, nickname, bio)
147
51
 
148
- Organize your composition into channels, where each channel can contain multiple segments. Segments are ordered by their `order` property and layered by their `zIndex`.
52
+ ### Posts
53
+ - Create video posts
54
+ - Create slideshow posts
55
+ - Get post status
56
+ - Get post statistics
149
57
 
150
- ## Get Your API Key
58
+ ### Tasks
59
+ - Get scheduled tasks
60
+ - View task history
151
61
 
152
- To get your API key:
62
+ ### Statistics
63
+ - Get account statistics
64
+ - Get post statistics
65
+ - Refresh statistics
153
66
 
154
- 1. Visit [ugc.inc](https://ugc.inc)
155
- 2. Schedule a call with our team
156
- 3. You'll receive your API key after the call
67
+ ### Organization
68
+ - Get API keys (metadata only, excludes key values for security)
157
69
 
158
- **Important:** Keep your API key secure! Never commit it to version control or expose it in client-side code.
70
+ ### Examples
159
71
 
160
- ## Documentation
72
+ **Get your organization's API keys:**
73
+ ```typescript
74
+ const response = await client.org.getApiKeys();
161
75
 
162
- For complete API documentation, including all endpoints, parameters, and examples, visit:
76
+ if (response.ok) {
77
+ console.log(response.data); // [{ id: "...", created_at: "..." }]
78
+ }
79
+ ```
163
80
 
164
- **[docs.ugc.inc](https://docs.ugc.inc)**
81
+ **Create a video post:**
82
+ ```typescript
83
+ const response = await client.posts.createVideo({
84
+ accountId: 'account-uuid',
85
+ videoUrl: 'https://example.com/video.mp4',
86
+ caption: 'Check out this video!',
87
+ });
88
+ ```
165
89
 
166
90
  ## TypeScript Support
167
91
 
168
92
  This package is written in TypeScript and provides full type definitions:
169
93
 
170
94
  ```typescript
171
- import type {
172
- Account,
173
- Post,
174
- Task,
175
- ApiResponse,
176
- Editor,
177
- VideoSegment,
178
- TextSegment,
179
- Channel
180
- } from 'ugcinc';
95
+ import type { Account, Post, Task, ApiKey, ApiResponse } from 'ugcinc';
181
96
  ```
182
97
 
183
98
  ## License
package/dist/base.d.ts CHANGED
@@ -8,4 +8,5 @@ export declare class BaseClient {
8
8
  constructor(config: ClientConfig);
9
9
  protected request<T>(endpoint: string, options?: RequestInit): Promise<ApiResponse<T>>;
10
10
  protected post<T>(endpoint: string, body?: unknown): Promise<ApiResponse<T>>;
11
+ protected get<T>(endpoint: string): Promise<ApiResponse<T>>;
11
12
  }
package/dist/base.js CHANGED
@@ -51,5 +51,10 @@ class BaseClient {
51
51
  body: body ? JSON.stringify(body) : undefined,
52
52
  });
53
53
  }
54
+ async get(endpoint) {
55
+ return this.request(endpoint, {
56
+ method: 'GET',
57
+ });
58
+ }
54
59
  }
55
60
  exports.BaseClient = BaseClient;
package/dist/client.d.ts CHANGED
@@ -2,7 +2,7 @@ import { AccountsClient } from './accounts';
2
2
  import { TasksClient } from './tasks';
3
3
  import { PostsClient } from './posts';
4
4
  import { StatsClient } from './stats';
5
- import { VideoClient } from './video';
5
+ import { OrganizationClient } from './org';
6
6
  import type { ClientConfig } from './base';
7
7
  /**
8
8
  * Main UGC Inc API Client
@@ -27,16 +27,6 @@ import type { ClientConfig } from './base';
27
27
  * videoUrl: 'https://example.com/video.mp4',
28
28
  * caption: 'My awesome video!',
29
29
  * });
30
- *
31
- * // Render a video
32
- * const renderResponse = await client.video.render({
33
- * editor: {
34
- * width: 1080,
35
- * height: 1920,
36
- * fps: 30,
37
- * channels: [...]
38
- * }
39
- * });
40
30
  * ```
41
31
  */
42
32
  export declare class UGCClient {
@@ -57,8 +47,8 @@ export declare class UGCClient {
57
47
  */
58
48
  stats: StatsClient;
59
49
  /**
60
- * Client for video rendering operations
50
+ * Client for organization operations
61
51
  */
62
- video: VideoClient;
52
+ org: OrganizationClient;
63
53
  constructor(config: ClientConfig);
64
54
  }
package/dist/client.js CHANGED
@@ -5,7 +5,7 @@ const accounts_1 = require("./accounts");
5
5
  const tasks_1 = require("./tasks");
6
6
  const posts_1 = require("./posts");
7
7
  const stats_1 = require("./stats");
8
- const video_1 = require("./video");
8
+ const org_1 = require("./org");
9
9
  /**
10
10
  * Main UGC Inc API Client
11
11
  *
@@ -29,16 +29,6 @@ const video_1 = require("./video");
29
29
  * videoUrl: 'https://example.com/video.mp4',
30
30
  * caption: 'My awesome video!',
31
31
  * });
32
- *
33
- * // Render a video
34
- * const renderResponse = await client.video.render({
35
- * editor: {
36
- * width: 1080,
37
- * height: 1920,
38
- * fps: 30,
39
- * channels: [...]
40
- * }
41
- * });
42
32
  * ```
43
33
  */
44
34
  class UGCClient {
@@ -47,7 +37,7 @@ class UGCClient {
47
37
  this.tasks = new tasks_1.TasksClient(config);
48
38
  this.posts = new posts_1.PostsClient(config);
49
39
  this.stats = new stats_1.StatsClient(config);
50
- this.video = new video_1.VideoClient(config);
40
+ this.org = new org_1.OrganizationClient(config);
51
41
  }
52
42
  }
53
43
  exports.UGCClient = UGCClient;
package/dist/index.d.ts CHANGED
@@ -8,6 +8,6 @@ export { AccountsClient } from './accounts';
8
8
  export { TasksClient } from './tasks';
9
9
  export { PostsClient } from './posts';
10
10
  export { StatsClient } from './stats';
11
- export { VideoClient } from './video';
11
+ export { OrganizationClient } from './org';
12
12
  export type { ClientConfig, } from './base';
13
- export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, RenderVideoParams, RenderVideoResponse, SegmentType, TimeValue, BaseSegment, VisualSegment, PictureSegment, VideoSegment, ImageSegment, AudioSegment, TextSegment, EditorSegment, Channel, Editor, } from './types';
13
+ export type { SuccessResponse, ErrorResponse, ApiResponse, Account, AccountStat, AccountTask, EditProfileInfo, Task, TaskType, Post, PostType, PostStat, ApiKey, GetAccountsParams, GetAccountStatsParams, GetAccountStatusParams, UpdateAccountInfoParams, UpdateAccountSocialParams, GetTasksParams, GetPostsParams, CreateSlideshowParams, GetPostStatsParams, GetPostStatusParams, CreateVideoParams, RefreshStatsParams, RefreshStatsResponse, RefreshStatsError, } 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.VideoClient = exports.StatsClient = exports.PostsClient = exports.TasksClient = exports.AccountsClient = exports.UGCClient = void 0;
8
+ 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");
@@ -16,5 +16,5 @@ var posts_1 = require("./posts");
16
16
  Object.defineProperty(exports, "PostsClient", { enumerable: true, get: function () { return posts_1.PostsClient; } });
17
17
  var stats_1 = require("./stats");
18
18
  Object.defineProperty(exports, "StatsClient", { enumerable: true, get: function () { return stats_1.StatsClient; } });
19
- var video_1 = require("./video");
20
- Object.defineProperty(exports, "VideoClient", { enumerable: true, get: function () { return video_1.VideoClient; } });
19
+ var org_1 = require("./org");
20
+ Object.defineProperty(exports, "OrganizationClient", { enumerable: true, get: function () { return org_1.OrganizationClient; } });
package/dist/org.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { BaseClient } from './base';
2
+ import type { ApiKey, ApiResponse } from './types';
3
+ /**
4
+ * Client for managing organization resources
5
+ */
6
+ export declare class OrganizationClient extends BaseClient {
7
+ /**
8
+ * Get all API keys for your organization
9
+ * Note: The actual key values are not returned for security reasons
10
+ */
11
+ getApiKeys(): Promise<ApiResponse<ApiKey[]>>;
12
+ }
package/dist/org.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganizationClient = void 0;
4
+ const base_1 = require("./base");
5
+ /**
6
+ * Client for managing organization resources
7
+ */
8
+ class OrganizationClient extends base_1.BaseClient {
9
+ /**
10
+ * Get all API keys for your organization
11
+ * Note: The actual key values are not returned for security reasons
12
+ */
13
+ async getApiKeys() {
14
+ return this.get('/org/api-key');
15
+ }
16
+ }
17
+ exports.OrganizationClient = OrganizationClient;
package/dist/types.d.ts CHANGED
@@ -174,15 +174,9 @@ export interface RefreshStatsResponse {
174
174
  errors?: RefreshStatsError[];
175
175
  }
176
176
  /**
177
- * Video rendering types - imported from video-render module
178
- * These are copied during the build process from ../../src/video-render/types/
177
+ * Organization and API Key types
179
178
  */
180
- import type { SegmentType, TimeValue, BaseSegment, VisualSegment, PictureSegment, VideoSegment, ImageSegment, AudioSegment, TextSegment, EditorSegment } from './video-render-types/segment';
181
- import type { Channel, Editor } from './video-render-types/video';
182
- export type { SegmentType, TimeValue, BaseSegment, VisualSegment, PictureSegment, VideoSegment, ImageSegment, AudioSegment, TextSegment, EditorSegment, Channel, Editor, };
183
- export interface RenderVideoParams {
184
- editor: Editor;
185
- }
186
- export interface RenderVideoResponse {
187
- video_url: string;
179
+ export interface ApiKey {
180
+ id: string;
181
+ created_at: string;
188
182
  }
package/package.json CHANGED
@@ -1,34 +1,33 @@
1
- {
2
- "name": "ugcinc",
3
- "version": "1.1.2",
4
- "description": "TypeScript/JavaScript client for the UGC Inc API",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "scripts": {
8
- "prebuild": "node -e \"const fs = require('fs'); const path = require('path'); const srcDir = path.join(__dirname, '../../src/video-render/types'); const destDir = path.join(__dirname, 'src/video-render-types'); fs.mkdirSync(destDir, {recursive: true}); ['segment.ts', 'video.ts'].forEach(file => fs.copyFileSync(path.join(srcDir, file), path.join(destDir, file)));\"",
9
- "build": "npm run prebuild && tsc",
10
- "prepublishOnly": "npm run build",
11
- "test": "echo \"No tests specified\" && exit 0"
12
- },
13
- "keywords": [
14
- "ugcinc",
15
- "api",
16
- "client",
17
- "tiktok",
18
- "automation",
19
- "social-media",
20
- "content-management"
21
- ],
22
- "author": "UGC Inc",
23
- "license": "MIT",
24
- "devDependencies": {
25
- "@types/node": "^20.0.0",
26
- "typescript": "^5.0.0"
27
- },
28
- "dependencies": {},
29
- "files": [
30
- "dist",
31
- "README.md"
32
- ]
33
- }
34
-
1
+ {
2
+ "name": "ugcinc",
3
+ "version": "1.1.4",
4
+ "description": "TypeScript/JavaScript client for the UGC Inc API",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc",
9
+ "prepublishOnly": "npm run build",
10
+ "test": "echo \"No tests specified\" && exit 0"
11
+ },
12
+ "keywords": [
13
+ "ugcinc",
14
+ "api",
15
+ "client",
16
+ "tiktok",
17
+ "automation",
18
+ "social-media",
19
+ "content-management"
20
+ ],
21
+ "author": "UGC Inc",
22
+ "license": "MIT",
23
+ "devDependencies": {
24
+ "@types/node": "^20.0.0",
25
+ "typescript": "^5.0.0"
26
+ },
27
+ "dependencies": {},
28
+ "files": [
29
+ "dist",
30
+ "README.md"
31
+ ]
32
+ }
33
+