ugcinc 2.26.0 → 2.27.1
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 +5 -5
- package/dist/media.js +5 -9
- package/dist/types.d.ts +8 -0
- package/package.json +1 -1
package/dist/media.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base';
|
|
2
|
-
import type { Media, UserMedia, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, ApiResponse } from './types';
|
|
2
|
+
import type { Media, UserMedia, SocialAudio, GetMediaParams, GetSocialAudioParams, UploadMediaResponse, UpdateMediaTagParams, DeleteMediaParams, DeleteMediaResponse, CreateSocialAudioParams, CreateMediaFromUrlParams, GetUploadTokenParams, UploadTokenResponse, ApiResponse } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* Client for managing media files
|
|
5
5
|
*/
|
|
@@ -21,11 +21,11 @@ export declare class MediaClient extends BaseClient {
|
|
|
21
21
|
*/
|
|
22
22
|
create(params: CreateMediaFromUrlParams): Promise<ApiResponse<UploadMediaResponse>>;
|
|
23
23
|
/**
|
|
24
|
-
* Get
|
|
25
|
-
* Use this with the `
|
|
26
|
-
* After uploading, call create() with the resulting blob
|
|
24
|
+
* Get a client token for direct upload to Vercel Blob storage
|
|
25
|
+
* Use this with the `put` function from @vercel/blob/client
|
|
26
|
+
* After uploading, call create() with the resulting blob URL
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
getUploadToken(params: GetUploadTokenParams): Promise<ApiResponse<UploadTokenResponse>>;
|
|
29
29
|
/**
|
|
30
30
|
* Update the tag on a media item
|
|
31
31
|
* Works for both user_media and social_audio
|
package/dist/media.js
CHANGED
|
@@ -29,16 +29,12 @@ class MediaClient extends base_1.BaseClient {
|
|
|
29
29
|
return this.post('/media/create', params);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Get
|
|
33
|
-
* Use this with the `
|
|
34
|
-
* After uploading, call create() with the resulting blob
|
|
32
|
+
* Get a client token for direct upload to Vercel Blob storage
|
|
33
|
+
* Use this with the `put` function from @vercel/blob/client
|
|
34
|
+
* After uploading, call create() with the resulting blob URL
|
|
35
35
|
*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (this.getOrgId()) {
|
|
39
|
-
return `${url}?orgId=${encodeURIComponent(this.getOrgId())}`;
|
|
40
|
-
}
|
|
41
|
-
return url;
|
|
36
|
+
async getUploadToken(params) {
|
|
37
|
+
return this.post('/media/create/url', params);
|
|
42
38
|
}
|
|
43
39
|
/**
|
|
44
40
|
* Update the tag on a media item
|
package/dist/types.d.ts
CHANGED
|
@@ -713,4 +713,12 @@ export interface CreateMediaFromUrlParams {
|
|
|
713
713
|
names?: string[];
|
|
714
714
|
tag?: string;
|
|
715
715
|
}
|
|
716
|
+
export interface GetUploadTokenParams {
|
|
717
|
+
filename: string;
|
|
718
|
+
contentType?: string;
|
|
719
|
+
}
|
|
720
|
+
export interface UploadTokenResponse {
|
|
721
|
+
clientToken: string;
|
|
722
|
+
pathname: string;
|
|
723
|
+
}
|
|
716
724
|
export {};
|