ugcinc 1.1.3 → 1.1.5
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 +47 -1
- package/dist/base.d.ts +1 -0
- package/dist/base.js +5 -0
- package/dist/client.d.ts +5 -0
- package/dist/client.js +2 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/org.d.ts +12 -0
- package/dist/org.js +17 -0
- package/dist/types.d.ts +7 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,12 +41,58 @@ For complete API documentation, including all endpoints, parameters, and example
|
|
|
41
41
|
|
|
42
42
|
**[docs.ugc.inc](https://docs.ugc.inc)**
|
|
43
43
|
|
|
44
|
+
## API Features
|
|
45
|
+
|
|
46
|
+
### Accounts
|
|
47
|
+
- Get accounts with filters
|
|
48
|
+
- Get account status
|
|
49
|
+
- Update account info (tags, groups)
|
|
50
|
+
- Update social profile (avatar, nickname, bio)
|
|
51
|
+
|
|
52
|
+
### Posts
|
|
53
|
+
- Create video posts
|
|
54
|
+
- Create slideshow posts
|
|
55
|
+
- Get post status
|
|
56
|
+
- Get post statistics
|
|
57
|
+
|
|
58
|
+
### Tasks
|
|
59
|
+
- Get scheduled tasks
|
|
60
|
+
- View task history
|
|
61
|
+
|
|
62
|
+
### Statistics
|
|
63
|
+
- Get account statistics
|
|
64
|
+
- Get post statistics
|
|
65
|
+
- Refresh statistics
|
|
66
|
+
|
|
67
|
+
### Organization
|
|
68
|
+
- Get API keys (metadata only, excludes key values for security)
|
|
69
|
+
|
|
70
|
+
### Examples
|
|
71
|
+
|
|
72
|
+
**Get your organization's API keys:**
|
|
73
|
+
```typescript
|
|
74
|
+
const response = await client.org.getApiKeys(); // POST /org/api-key
|
|
75
|
+
|
|
76
|
+
if (response.ok) {
|
|
77
|
+
console.log(response.data); // [{ id: "...", created_at: "..." }]
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
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
|
+
```
|
|
89
|
+
|
|
44
90
|
## TypeScript Support
|
|
45
91
|
|
|
46
92
|
This package is written in TypeScript and provides full type definitions:
|
|
47
93
|
|
|
48
94
|
```typescript
|
|
49
|
-
import type { Account, Post, Task, ApiResponse } from 'ugcinc';
|
|
95
|
+
import type { Account, Post, Task, ApiKey, ApiResponse } from 'ugcinc';
|
|
50
96
|
```
|
|
51
97
|
|
|
52
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
package/dist/client.d.ts
CHANGED
|
@@ -2,6 +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 { OrganizationClient } from './org';
|
|
5
6
|
import type { ClientConfig } from './base';
|
|
6
7
|
/**
|
|
7
8
|
* Main UGC Inc API Client
|
|
@@ -45,5 +46,9 @@ export declare class UGCClient {
|
|
|
45
46
|
* Client for statistics operations
|
|
46
47
|
*/
|
|
47
48
|
stats: StatsClient;
|
|
49
|
+
/**
|
|
50
|
+
* Client for organization operations
|
|
51
|
+
*/
|
|
52
|
+
org: OrganizationClient;
|
|
48
53
|
constructor(config: ClientConfig);
|
|
49
54
|
}
|
package/dist/client.js
CHANGED
|
@@ -5,6 +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 org_1 = require("./org");
|
|
8
9
|
/**
|
|
9
10
|
* Main UGC Inc API Client
|
|
10
11
|
*
|
|
@@ -36,6 +37,7 @@ class UGCClient {
|
|
|
36
37
|
this.tasks = new tasks_1.TasksClient(config);
|
|
37
38
|
this.posts = new posts_1.PostsClient(config);
|
|
38
39
|
this.stats = new stats_1.StatsClient(config);
|
|
40
|
+
this.org = new org_1.OrganizationClient(config);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
exports.UGCClient = UGCClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -8,5 +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 { OrganizationClient } from './org';
|
|
11
12
|
export type { ClientConfig, } from './base';
|
|
12
|
-
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, } 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.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,3 +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 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.post('/org/api-key');
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.OrganizationClient = OrganizationClient;
|
package/dist/types.d.ts
CHANGED