ugcinc 1.5.1 → 1.7.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 +24 -0
- package/dist/tasks.d.ts +18 -0
- package/dist/tasks.js +12 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -59,6 +59,8 @@ For complete API documentation, including all endpoints, parameters, and example
|
|
|
59
59
|
### Tasks
|
|
60
60
|
- Get scheduled tasks
|
|
61
61
|
- View task history
|
|
62
|
+
- Retry tasks
|
|
63
|
+
- Delete tasks
|
|
62
64
|
|
|
63
65
|
### Statistics
|
|
64
66
|
- Get account statistics
|
|
@@ -178,6 +180,28 @@ if (response.ok) {
|
|
|
178
180
|
}
|
|
179
181
|
```
|
|
180
182
|
|
|
183
|
+
**Retry tasks:**
|
|
184
|
+
```typescript
|
|
185
|
+
const response = await client.tasks.retryTasks({
|
|
186
|
+
taskIds: ['task-uuid-1', 'task-uuid-2']
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
if (response.ok) {
|
|
190
|
+
console.log(`Retried ${response.data.retried} task(s)`);
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Delete tasks:**
|
|
195
|
+
```typescript
|
|
196
|
+
const response = await client.tasks.deleteTasks({
|
|
197
|
+
taskIds: ['task-uuid-1', 'task-uuid-2']
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
if (response.ok) {
|
|
201
|
+
console.log(`Deleted ${response.data.deleted} task(s)`);
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
181
205
|
## TypeScript Support
|
|
182
206
|
|
|
183
207
|
This package is written in TypeScript and provides full type definitions:
|
package/dist/tasks.d.ts
CHANGED
|
@@ -8,4 +8,22 @@ export declare class TasksClient extends BaseClient {
|
|
|
8
8
|
* Get tasks with optional filters
|
|
9
9
|
*/
|
|
10
10
|
getTasks(params?: GetTasksParams): Promise<ApiResponse<Task[]>>;
|
|
11
|
+
/**
|
|
12
|
+
* Retry failed or completed tasks
|
|
13
|
+
*/
|
|
14
|
+
retryTasks(params: {
|
|
15
|
+
taskIds: string[];
|
|
16
|
+
}): Promise<ApiResponse<{
|
|
17
|
+
retried: number;
|
|
18
|
+
ids: string[];
|
|
19
|
+
}>>;
|
|
20
|
+
/**
|
|
21
|
+
* Delete tasks
|
|
22
|
+
*/
|
|
23
|
+
deleteTasks(params: {
|
|
24
|
+
taskIds: string[];
|
|
25
|
+
}): Promise<ApiResponse<{
|
|
26
|
+
deleted: number;
|
|
27
|
+
ids: string[];
|
|
28
|
+
}>>;
|
|
11
29
|
}
|
package/dist/tasks.js
CHANGED
|
@@ -12,5 +12,17 @@ class TasksClient extends base_1.BaseClient {
|
|
|
12
12
|
async getTasks(params) {
|
|
13
13
|
return this.post('/tasks', params ?? {});
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Retry failed or completed tasks
|
|
17
|
+
*/
|
|
18
|
+
async retryTasks(params) {
|
|
19
|
+
return this.post('/tasks/retry', params);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Delete tasks
|
|
23
|
+
*/
|
|
24
|
+
async deleteTasks(params) {
|
|
25
|
+
return this.post('/tasks/delete', params);
|
|
26
|
+
}
|
|
15
27
|
}
|
|
16
28
|
exports.TasksClient = TasksClient;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugcinc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.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",
|
|
@@ -24,10 +24,11 @@
|
|
|
24
24
|
"@types/node": "^20.0.0",
|
|
25
25
|
"typescript": "^5.0.0"
|
|
26
26
|
},
|
|
27
|
-
"dependencies": {
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"ugcinc": "^1.7.0"
|
|
29
|
+
},
|
|
28
30
|
"files": [
|
|
29
31
|
"dist",
|
|
30
32
|
"README.md"
|
|
31
33
|
]
|
|
32
34
|
}
|
|
33
|
-
|