ugcinc 2.23.0 → 2.24.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/dist/media.d.ts +8 -12
- package/dist/media.js +10 -16
- package/dist/types.d.ts +5 -0
- package/package.json +1 -1
package/dist/media.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type { Media, UserMedia, SocialAudio, GetMediaParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, ApiResponse } from './types';
|
|
2
|
+
import type { Media, UserMedia, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, ApiResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for managing media files
|
|
5
5
|
*/
|
|
6
6
|
export declare class MediaClient extends BaseClient {
|
|
7
7
|
/**
|
|
8
|
-
* Get
|
|
8
|
+
* Get media for the organization
|
|
9
9
|
* Returns both user_media and social_audio combined
|
|
10
|
+
* Can filter by ids or tag
|
|
10
11
|
*/
|
|
11
12
|
getMedia(params?: GetMediaParams): Promise<ApiResponse<Media[]>>;
|
|
13
|
+
/**
|
|
14
|
+
* Get social audio for the organization
|
|
15
|
+
* Can filter by ids or tag
|
|
16
|
+
*/
|
|
17
|
+
getSocialAudio(params?: GetSocialAudioParams): Promise<ApiResponse<SocialAudio[]>>;
|
|
12
18
|
/**
|
|
13
19
|
* Create media from URL(s)
|
|
14
20
|
* Creates media records from files already uploaded to blob storage
|
|
@@ -27,7 +33,6 @@ export declare class MediaClient extends BaseClient {
|
|
|
27
33
|
updateTag(params: UpdateMediaTagParams): Promise<ApiResponse<UserMedia | SocialAudio>>;
|
|
28
34
|
/**
|
|
29
35
|
* Delete one or more media items
|
|
30
|
-
* Supports both single id and bulk ids
|
|
31
36
|
* Also deletes the files from blob storage
|
|
32
37
|
*/
|
|
33
38
|
delete(params: DeleteMediaParams): Promise<ApiResponse<DeleteMediaResponse>>;
|
|
@@ -36,13 +41,4 @@ export declare class MediaClient extends BaseClient {
|
|
|
36
41
|
* Extracts audio and cover image from TikTok video or music URL
|
|
37
42
|
*/
|
|
38
43
|
createSocialAudio(params: CreateSocialAudioParams): Promise<ApiResponse<SocialAudio>>;
|
|
39
|
-
/**
|
|
40
|
-
* Get a media item by ID
|
|
41
|
-
* Returns either user_media or social_audio based on what's found
|
|
42
|
-
*/
|
|
43
|
-
getById(id: string): Promise<ApiResponse<Media>>;
|
|
44
|
-
/**
|
|
45
|
-
* Get a social audio by ID
|
|
46
|
-
*/
|
|
47
|
-
getSocialAudioById(id: string): Promise<ApiResponse<SocialAudio>>;
|
|
48
44
|
}
|
package/dist/media.js
CHANGED
|
@@ -7,12 +7,20 @@ const base_1 = require("./base");
|
|
|
7
7
|
*/
|
|
8
8
|
class MediaClient extends base_1.BaseClient {
|
|
9
9
|
/**
|
|
10
|
-
* Get
|
|
10
|
+
* Get media for the organization
|
|
11
11
|
* Returns both user_media and social_audio combined
|
|
12
|
+
* Can filter by ids or tag
|
|
12
13
|
*/
|
|
13
14
|
async getMedia(params) {
|
|
14
15
|
return this.post('/media', params ?? {});
|
|
15
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Get social audio for the organization
|
|
19
|
+
* Can filter by ids or tag
|
|
20
|
+
*/
|
|
21
|
+
async getSocialAudio(params) {
|
|
22
|
+
return this.post('/media/social-audio', params ?? {});
|
|
23
|
+
}
|
|
16
24
|
/**
|
|
17
25
|
* Create media from URL(s)
|
|
18
26
|
* Creates media records from files already uploaded to blob storage
|
|
@@ -41,7 +49,6 @@ class MediaClient extends base_1.BaseClient {
|
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* Delete one or more media items
|
|
44
|
-
* Supports both single id and bulk ids
|
|
45
52
|
* Also deletes the files from blob storage
|
|
46
53
|
*/
|
|
47
54
|
async delete(params) {
|
|
@@ -52,20 +59,7 @@ class MediaClient extends base_1.BaseClient {
|
|
|
52
59
|
* Extracts audio and cover image from TikTok video or music URL
|
|
53
60
|
*/
|
|
54
61
|
async createSocialAudio(params) {
|
|
55
|
-
return this.post('/media/social-audio', params);
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get a media item by ID
|
|
59
|
-
* Returns either user_media or social_audio based on what's found
|
|
60
|
-
*/
|
|
61
|
-
async getById(id) {
|
|
62
|
-
return this.post(`/media/${id}`, {});
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Get a social audio by ID
|
|
66
|
-
*/
|
|
67
|
-
async getSocialAudioById(id) {
|
|
68
|
-
return this.post(`/media/social-audio/${id}`, {});
|
|
62
|
+
return this.post('/media/social-audio/upload', params);
|
|
69
63
|
}
|
|
70
64
|
}
|
|
71
65
|
exports.MediaClient = MediaClient;
|
package/dist/types.d.ts
CHANGED
|
@@ -668,6 +668,11 @@ export interface SocialAudio {
|
|
|
668
668
|
}
|
|
669
669
|
export type Media = UserMedia | SocialAudio;
|
|
670
670
|
export interface GetMediaParams {
|
|
671
|
+
ids?: string[];
|
|
672
|
+
tag?: string;
|
|
673
|
+
}
|
|
674
|
+
export interface GetSocialAudioParams {
|
|
675
|
+
ids?: string[];
|
|
671
676
|
tag?: string;
|
|
672
677
|
}
|
|
673
678
|
export interface UploadMediaParams {
|