ugcinc 1.1.5 → 1.1.7

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
@@ -1,100 +1,125 @@
1
- # ugcinc
2
-
3
- Official TypeScript/JavaScript client for the UGC Inc API.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install ugcinc
9
- ```
10
-
11
- ## Quick Start
12
-
13
- ```typescript
14
- import { UGCClient } from 'ugcinc';
15
-
16
- const client = new UGCClient({
17
- apiKey: 'your-api-key-here'
18
- });
19
-
20
- // Example: Get accounts
21
- const response = await client.accounts.getAccounts();
22
-
23
- if (response.ok) {
24
- console.log(response.data);
25
- }
26
- ```
27
-
28
- ## Get Your API Key
29
-
30
- To get your API key:
31
-
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
35
-
36
- **Important:** Keep your API key secure! Never commit it to version control or expose it in client-side code.
37
-
38
- ## Documentation
39
-
40
- For complete API documentation, including all endpoints, parameters, and examples, visit:
41
-
42
- **[docs.ugc.inc](https://docs.ugc.inc)**
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
-
90
- ## TypeScript Support
91
-
92
- This package is written in TypeScript and provides full type definitions:
93
-
94
- ```typescript
95
- import type { Account, Post, Task, ApiKey, ApiResponse } from 'ugcinc';
96
- ```
97
-
98
- ## License
99
-
100
- MIT
1
+ # ugcinc
2
+
3
+ Official TypeScript/JavaScript client for the UGC Inc API.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install ugcinc
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```typescript
14
+ import { UGCClient } from 'ugcinc';
15
+
16
+ const client = new UGCClient({
17
+ apiKey: 'your-api-key-here'
18
+ });
19
+
20
+ // Example: Get accounts
21
+ const response = await client.accounts.getAccounts();
22
+
23
+ if (response.ok) {
24
+ console.log(response.data);
25
+ }
26
+ ```
27
+
28
+ ## Get Your API Key
29
+
30
+ To get your API key:
31
+
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
35
+
36
+ **Important:** Keep your API key secure! Never commit it to version control or expose it in client-side code.
37
+
38
+ ## Documentation
39
+
40
+ For complete API documentation, including all endpoints, parameters, and examples, visit:
41
+
42
+ **[docs.ugc.inc](https://docs.ugc.inc)**
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
+ - Delete API keys
70
+ - Edit API key names
71
+
72
+ ### Examples
73
+
74
+ **Get your organization's API keys:**
75
+ ```typescript
76
+ const response = await client.org.getApiKeys(); // POST /org/api-key
77
+
78
+ if (response.ok) {
79
+ console.log(response.data); // [{ id: "...", name: "...", created_at: "..." }]
80
+ }
81
+ ```
82
+
83
+ **Delete an API key:**
84
+ ```typescript
85
+ const response = await client.org.deleteApiKey({
86
+ apiKeyId: 'api-key-uuid'
87
+ }); // POST /org/api-key/delete
88
+
89
+ if (response.ok) {
90
+ console.log('API key deleted:', response.data.id);
91
+ }
92
+ ```
93
+
94
+ **Edit an API key's name:**
95
+ ```typescript
96
+ const response = await client.org.editApiKey({
97
+ apiKeyId: 'api-key-uuid',
98
+ name: 'New Key Name'
99
+ }); // POST /org/api-key/edit
100
+
101
+ if (response.ok) {
102
+ console.log('Updated API key:', response.data); // { id, name, created_at }
103
+ }
104
+ ```
105
+
106
+ **Create a video post:**
107
+ ```typescript
108
+ const response = await client.posts.createVideo({
109
+ accountId: 'account-uuid',
110
+ videoUrl: 'https://example.com/video.mp4',
111
+ caption: 'Check out this video!',
112
+ });
113
+ ```
114
+
115
+ ## TypeScript Support
116
+
117
+ This package is written in TypeScript and provides full type definitions:
118
+
119
+ ```typescript
120
+ import type { Account, Post, Task, ApiKey, ApiResponse } from 'ugcinc';
121
+ ```
122
+
123
+ ## License
124
+
125
+ MIT
package/dist/org.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { BaseClient } from './base';
2
- import type { ApiKey, ApiResponse } from './types';
2
+ import type { ApiKey, ApiResponse, DeleteApiKeyParams, EditApiKeyParams } from './types';
3
3
  /**
4
4
  * Client for managing organization resources
5
5
  */
@@ -9,4 +9,16 @@ export declare class OrganizationClient extends BaseClient {
9
9
  * Note: The actual key values are not returned for security reasons
10
10
  */
11
11
  getApiKeys(): Promise<ApiResponse<ApiKey[]>>;
12
+ /**
13
+ * Delete an API key from your organization
14
+ * @param params - The parameters including the apiKeyId to delete
15
+ */
16
+ deleteApiKey(params: DeleteApiKeyParams): Promise<ApiResponse<{
17
+ id: string;
18
+ }>>;
19
+ /**
20
+ * Edit an API key's name
21
+ * @param params - The parameters including the apiKeyId and new name
22
+ */
23
+ editApiKey(params: EditApiKeyParams): Promise<ApiResponse<ApiKey>>;
12
24
  }
package/dist/org.js CHANGED
@@ -13,5 +13,19 @@ class OrganizationClient extends base_1.BaseClient {
13
13
  async getApiKeys() {
14
14
  return this.post('/org/api-key');
15
15
  }
16
+ /**
17
+ * Delete an API key from your organization
18
+ * @param params - The parameters including the apiKeyId to delete
19
+ */
20
+ async deleteApiKey(params) {
21
+ return this.post('/org/api-key/delete', params);
22
+ }
23
+ /**
24
+ * Edit an API key's name
25
+ * @param params - The parameters including the apiKeyId and new name
26
+ */
27
+ async editApiKey(params) {
28
+ return this.post('/org/api-key/edit', params);
29
+ }
16
30
  }
17
31
  exports.OrganizationClient = OrganizationClient;
package/dist/types.d.ts CHANGED
@@ -178,5 +178,13 @@ export interface RefreshStatsResponse {
178
178
  */
179
179
  export interface ApiKey {
180
180
  id: string;
181
+ name: string;
181
182
  created_at: string;
182
183
  }
184
+ export interface DeleteApiKeyParams {
185
+ apiKeyId: string;
186
+ }
187
+ export interface EditApiKeyParams {
188
+ apiKeyId: string;
189
+ name: string;
190
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ugcinc",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "TypeScript/JavaScript client for the UGC Inc API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",