glitch-javascript-sdk 2.4.7 → 2.4.8
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/cjs/index.js +40 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Media.d.ts +7 -0
- package/dist/esm/api/Scheduler.d.ts +15 -0
- package/dist/esm/api/SocialPosts.d.ts +9 -0
- package/dist/esm/index.js +40 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +31 -0
- package/package.json +1 -1
- package/src/api/Media.ts +11 -0
- package/src/api/Scheduler.ts +19 -0
- package/src/api/SocialPosts.ts +10 -0
- package/src/routes/MediaRoute.ts +1 -0
- package/src/routes/SchedulerRoute.ts +3 -0
- package/src/routes/SocialPostsRoute.ts +1 -0
package/dist/index.d.ts
CHANGED
|
@@ -3686,6 +3686,15 @@ declare class SocialPosts {
|
|
|
3686
3686
|
* @returns promise
|
|
3687
3687
|
*/
|
|
3688
3688
|
static sendSocialMessage<T>(data: object): AxiosPromise<Response<T>>;
|
|
3689
|
+
/**
|
|
3690
|
+
* Reply to a high-intent TikTok comment via Direct Message.
|
|
3691
|
+
*
|
|
3692
|
+
* @param comment_id The ID of the comment.
|
|
3693
|
+
* @param data { message: string }
|
|
3694
|
+
*/
|
|
3695
|
+
static replyViaDm<T>(comment_id: string, data: {
|
|
3696
|
+
message: string;
|
|
3697
|
+
}): AxiosPromise<Response<T>>;
|
|
3689
3698
|
}
|
|
3690
3699
|
|
|
3691
3700
|
declare class Titles {
|
|
@@ -5691,6 +5700,13 @@ declare class Media {
|
|
|
5691
5700
|
requirement: string;
|
|
5692
5701
|
content: string;
|
|
5693
5702
|
};
|
|
5703
|
+
/**
|
|
5704
|
+
* Upload an audio file to TikTok's asset library via our Media controller.
|
|
5705
|
+
*
|
|
5706
|
+
* @param file The audio file (mp3).
|
|
5707
|
+
* @param scheduler_id The ID of the scheduler to provide OAuth context.
|
|
5708
|
+
*/
|
|
5709
|
+
static uploadTikTokMusic<T>(file: File, scheduler_id: string): AxiosPromise<Response<T>>;
|
|
5694
5710
|
}
|
|
5695
5711
|
|
|
5696
5712
|
declare class Scheduler {
|
|
@@ -6239,6 +6255,21 @@ declare class Scheduler {
|
|
|
6239
6255
|
* @returns promise
|
|
6240
6256
|
*/
|
|
6241
6257
|
static generateHashtags<T>(scheduler_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6258
|
+
/**
|
|
6259
|
+
* Get TikTok hashtag suggestions based on a keyword.
|
|
6260
|
+
*
|
|
6261
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
6262
|
+
* @param params { keyword: string }
|
|
6263
|
+
*/
|
|
6264
|
+
static getTikTokHashtags<T>(scheduler_id: string, params: {
|
|
6265
|
+
keyword: string;
|
|
6266
|
+
}): AxiosPromise<Response<T>>;
|
|
6267
|
+
/**
|
|
6268
|
+
* Get trending commercial music from TikTok's library.
|
|
6269
|
+
*
|
|
6270
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
6271
|
+
*/
|
|
6272
|
+
static getTikTokMusic<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
6242
6273
|
}
|
|
6243
6274
|
|
|
6244
6275
|
declare class Funnel {
|
package/package.json
CHANGED
package/src/api/Media.ts
CHANGED
|
@@ -331,6 +331,17 @@ class Media {
|
|
|
331
331
|
content: 'Logo only, should be legible against any background'
|
|
332
332
|
};
|
|
333
333
|
}
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Upload an audio file to TikTok's asset library via our Media controller.
|
|
337
|
+
*
|
|
338
|
+
* @param file The audio file (mp3).
|
|
339
|
+
* @param scheduler_id The ID of the scheduler to provide OAuth context.
|
|
340
|
+
*/
|
|
341
|
+
public static uploadTikTokMusic<T>(file: File, scheduler_id: string): AxiosPromise<Response<T>> {
|
|
342
|
+
// We use the raw URL here as it's a specialized upload path
|
|
343
|
+
return Requests.uploadFile('/media/tiktok/music', 'audio', file, { scheduler_id });
|
|
344
|
+
}
|
|
334
345
|
}
|
|
335
346
|
|
|
336
347
|
export default Media;
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -839,6 +839,25 @@ class Scheduler {
|
|
|
839
839
|
return Requests.processRoute(SchedulerRoute.routes.generateHashtags, data, { scheduler_id }, params);
|
|
840
840
|
}
|
|
841
841
|
|
|
842
|
+
/**
|
|
843
|
+
* Get TikTok hashtag suggestions based on a keyword.
|
|
844
|
+
*
|
|
845
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
846
|
+
* @param params { keyword: string }
|
|
847
|
+
*/
|
|
848
|
+
public static getTikTokHashtags<T>(scheduler_id: string, params: { keyword: string }): AxiosPromise<Response<T>> {
|
|
849
|
+
return Requests.processRoute(SchedulerRoute.routes.getTikTokHashtags, {}, { scheduler_id }, params);
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
/**
|
|
853
|
+
* Get trending commercial music from TikTok's library.
|
|
854
|
+
*
|
|
855
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
856
|
+
*/
|
|
857
|
+
public static getTikTokMusic<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
858
|
+
return Requests.processRoute(SchedulerRoute.routes.getTikTokMusic, {}, { scheduler_id }, params);
|
|
859
|
+
}
|
|
860
|
+
|
|
842
861
|
}
|
|
843
862
|
|
|
844
863
|
export default Scheduler;
|
package/src/api/SocialPosts.ts
CHANGED
|
@@ -430,6 +430,16 @@ class SocialPosts {
|
|
|
430
430
|
public static sendSocialMessage<T>(data: object): AxiosPromise<Response<T>> {
|
|
431
431
|
return Requests.processRoute(SocialPostsRoute.routes.sendSocialMessage, data);
|
|
432
432
|
}
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* Reply to a high-intent TikTok comment via Direct Message.
|
|
436
|
+
*
|
|
437
|
+
* @param comment_id The ID of the comment.
|
|
438
|
+
* @param data { message: string }
|
|
439
|
+
*/
|
|
440
|
+
public static replyViaDm<T>(comment_id: string, data: { message: string }): AxiosPromise<Response<T>> {
|
|
441
|
+
return Requests.processRoute(SocialPostsRoute.routes.replyViaDm, data, { comment_id });
|
|
442
|
+
}
|
|
433
443
|
}
|
|
434
444
|
|
|
435
445
|
export default SocialPosts;
|
package/src/routes/MediaRoute.ts
CHANGED
|
@@ -11,6 +11,7 @@ class MediaRoute {
|
|
|
11
11
|
removeBackgroundAI: { url: '/media/remove-background-ai', method: HTTP_METHODS.POST },
|
|
12
12
|
createLibraryLogo: { url: '/media/create-library-logo', method: HTTP_METHODS.POST },
|
|
13
13
|
validateScreenshot: { url: '/media/validate-screenshot', method: HTTP_METHODS.POST },
|
|
14
|
+
uploadTikTokMusic: { url: '/media/tiktok/music', method: HTTP_METHODS.POST },
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
|
|
@@ -131,6 +131,9 @@ class SchedulerRoute {
|
|
|
131
131
|
method: HTTP_METHODS.POST
|
|
132
132
|
},
|
|
133
133
|
|
|
134
|
+
getTikTokHashtags: { url: '/schedulers/{scheduler_id}/tiktok/discovery/hashtags', method: HTTP_METHODS.GET },
|
|
135
|
+
getTikTokMusic: { url: '/schedulers/{scheduler_id}/tiktok/discovery/music', method: HTTP_METHODS.GET },
|
|
136
|
+
|
|
134
137
|
};
|
|
135
138
|
}
|
|
136
139
|
|
|
@@ -47,6 +47,7 @@ class SocialPostsRoute {
|
|
|
47
47
|
getConversation: { url: '/social/conversations/{conversation_id}', method: HTTP_METHODS.GET },
|
|
48
48
|
getConversationMessages: { url: '/social/conversations/{conversation_id}/messages', method: HTTP_METHODS.GET },
|
|
49
49
|
sendSocialMessage: { url: '/social/messages', method: HTTP_METHODS.POST },
|
|
50
|
+
replyViaDm: { url: '/socialposts/comments/{comment_id}/reply-via-dm', method: HTTP_METHODS.POST },
|
|
50
51
|
|
|
51
52
|
};
|
|
52
53
|
|