glitch-javascript-sdk 1.9.3 → 1.9.4
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 +54 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +16 -0
- package/dist/esm/api/Scheduler.d.ts +14 -0
- package/dist/esm/index.js +54 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +30 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +87 -49
- package/src/api/Scheduler.ts +48 -12
- package/src/routes/AdsRoute.ts +8 -0
- package/src/routes/SchedulerRoute.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1000,6 +1000,22 @@ declare class Ads {
|
|
|
1000
1000
|
static twitterBatchTargetingCriteria<T>(data: object[], params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1001
1001
|
static lookupTwitterTargeting<T>(resource: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1002
1002
|
static twitterTargetingSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1003
|
+
/**
|
|
1004
|
+
* Deep-sync a campaign tree (campaign → groups → ads) with its remote platform.
|
|
1005
|
+
*
|
|
1006
|
+
* @param campaign_id UUID of the campaign to sync
|
|
1007
|
+
* @param params Optional query params
|
|
1008
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
1009
|
+
*/
|
|
1010
|
+
static syncCampaignTree<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1011
|
+
/**
|
|
1012
|
+
* Deep-sync all the campaigns for a scheduler.
|
|
1013
|
+
*
|
|
1014
|
+
* @param scheduler_id UUID of the campaign to sync
|
|
1015
|
+
* @param params Optional query params
|
|
1016
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
1017
|
+
*/
|
|
1018
|
+
static syncSchedulerCampaigns<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1003
1019
|
}
|
|
1004
1020
|
|
|
1005
1021
|
declare class Communities {
|
|
@@ -4991,6 +5007,20 @@ declare class Scheduler {
|
|
|
4991
5007
|
* @returns promise
|
|
4992
5008
|
*/
|
|
4993
5009
|
static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5010
|
+
/**
|
|
5011
|
+
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
5012
|
+
*
|
|
5013
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5014
|
+
* @returns promise
|
|
5015
|
+
*/
|
|
5016
|
+
static clearGoogleAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5017
|
+
/**
|
|
5018
|
+
* Clear Tiktok Ads OAuth credentials from a promotion schedule.
|
|
5019
|
+
*
|
|
5020
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5021
|
+
* @returns promise
|
|
5022
|
+
*/
|
|
5023
|
+
static clearTiktokAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4994
5024
|
/**
|
|
4995
5025
|
* Get aggregated reports for a promotion schedule.
|
|
4996
5026
|
*
|
package/package.json
CHANGED
package/src/api/Ads.ts
CHANGED
|
@@ -744,60 +744,60 @@ class Ads {
|
|
|
744
744
|
}
|
|
745
745
|
|
|
746
746
|
// TikTok Uploads: FILE
|
|
747
|
-
public static tiktokUploadImageFile<T>(
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
): AxiosPromise<Response<T>> {
|
|
753
|
-
|
|
754
|
-
}
|
|
747
|
+
public static tiktokUploadImageFile<T>(
|
|
748
|
+
file: File,
|
|
749
|
+
data?: object,
|
|
750
|
+
params?: Record<string, any>,
|
|
751
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
752
|
+
): AxiosPromise<Response<T>> {
|
|
753
|
+
return Requests.uploadFile(AdsRoute.routes.tiktokUploadImage.url, 'image_file', file, data, params, onUploadProgress);
|
|
754
|
+
}
|
|
755
755
|
|
|
756
|
-
public static tiktokUploadVideoFile<T>(
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
): AxiosPromise<Response<T>> {
|
|
762
|
-
|
|
763
|
-
}
|
|
756
|
+
public static tiktokUploadVideoFile<T>(
|
|
757
|
+
file: File,
|
|
758
|
+
data?: object,
|
|
759
|
+
params?: Record<string, any>,
|
|
760
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
761
|
+
): AxiosPromise<Response<T>> {
|
|
762
|
+
return Requests.uploadFile(AdsRoute.routes.tiktokUploadVideo.url, 'video_file', file, data, params, onUploadProgress);
|
|
763
|
+
}
|
|
764
764
|
|
|
765
|
-
public static tiktokUploadMusicFile<T>(
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
): AxiosPromise<Response<T>> {
|
|
771
|
-
|
|
772
|
-
}
|
|
765
|
+
public static tiktokUploadMusicFile<T>(
|
|
766
|
+
file: File,
|
|
767
|
+
data?: object,
|
|
768
|
+
params?: Record<string, any>,
|
|
769
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
770
|
+
): AxiosPromise<Response<T>> {
|
|
771
|
+
return Requests.uploadFile(AdsRoute.routes.tiktokUploadMusic.url, 'music_file', file, data, params, onUploadProgress);
|
|
772
|
+
}
|
|
773
773
|
|
|
774
|
-
// TikTok Uploads: BLOB
|
|
775
|
-
public static tiktokUploadImageBlob<T>(
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
): AxiosPromise<Response<T>> {
|
|
781
|
-
|
|
782
|
-
}
|
|
774
|
+
// TikTok Uploads: BLOB
|
|
775
|
+
public static tiktokUploadImageBlob<T>(
|
|
776
|
+
blob: Blob,
|
|
777
|
+
data?: object,
|
|
778
|
+
params?: Record<string, any>,
|
|
779
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
780
|
+
): AxiosPromise<Response<T>> {
|
|
781
|
+
return Requests.uploadBlob(AdsRoute.routes.tiktokUploadImage.url, 'image_file', blob, data, params, onUploadProgress);
|
|
782
|
+
}
|
|
783
783
|
|
|
784
|
-
public static tiktokUploadVideoBlob<T>(
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
): AxiosPromise<Response<T>> {
|
|
790
|
-
|
|
791
|
-
}
|
|
784
|
+
public static tiktokUploadVideoBlob<T>(
|
|
785
|
+
blob: Blob,
|
|
786
|
+
data?: object,
|
|
787
|
+
params?: Record<string, any>,
|
|
788
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
789
|
+
): AxiosPromise<Response<T>> {
|
|
790
|
+
return Requests.uploadBlob(AdsRoute.routes.tiktokUploadVideo.url, 'video_file', blob, data, params, onUploadProgress);
|
|
791
|
+
}
|
|
792
792
|
|
|
793
|
-
public static tiktokUploadMusicBlob<T>(
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
): AxiosPromise<Response<T>> {
|
|
799
|
-
|
|
800
|
-
}
|
|
793
|
+
public static tiktokUploadMusicBlob<T>(
|
|
794
|
+
blob: Blob,
|
|
795
|
+
data?: object,
|
|
796
|
+
params?: Record<string, any>,
|
|
797
|
+
onUploadProgress?: (progressEvent: AxiosProgressEvent) => void
|
|
798
|
+
): AxiosPromise<Response<T>> {
|
|
799
|
+
return Requests.uploadBlob(AdsRoute.routes.tiktokUploadMusic.url, 'music_file', blob, data, params, onUploadProgress);
|
|
800
|
+
}
|
|
801
801
|
|
|
802
802
|
public static tiktokGetMediaInfo<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
803
803
|
return Requests.processRoute(
|
|
@@ -989,6 +989,44 @@ public static tiktokUploadMusicBlob<T>(
|
|
|
989
989
|
return Requests.processRoute(AdsRoute.routes.twitterTargetingSuggestions, undefined, undefined, params);
|
|
990
990
|
}
|
|
991
991
|
|
|
992
|
+
/**
|
|
993
|
+
* Deep-sync a campaign tree (campaign → groups → ads) with its remote platform.
|
|
994
|
+
*
|
|
995
|
+
* @param campaign_id UUID of the campaign to sync
|
|
996
|
+
* @param params Optional query params
|
|
997
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
998
|
+
*/
|
|
999
|
+
public static syncCampaignTree<T>(
|
|
1000
|
+
campaign_id: string,
|
|
1001
|
+
params?: Record<string, any>
|
|
1002
|
+
): AxiosPromise<Response<T>> {
|
|
1003
|
+
return Requests.processRoute(
|
|
1004
|
+
AdsRoute.routes.syncCampaignTree,
|
|
1005
|
+
undefined,
|
|
1006
|
+
{ campaign_id },
|
|
1007
|
+
params
|
|
1008
|
+
);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Deep-sync all the campaigns for a scheduler.
|
|
1014
|
+
*
|
|
1015
|
+
* @param scheduler_id UUID of the campaign to sync
|
|
1016
|
+
* @param params Optional query params
|
|
1017
|
+
* @returns Fully-hydrated AdCampaign resource
|
|
1018
|
+
*/
|
|
1019
|
+
public static syncSchedulerCampaigns<T>(
|
|
1020
|
+
scheduler_id: string,
|
|
1021
|
+
params?: Record<string, any>
|
|
1022
|
+
): AxiosPromise<Response<T>> {
|
|
1023
|
+
return Requests.processRoute(
|
|
1024
|
+
AdsRoute.routes.syncSchedulerCampaigns,
|
|
1025
|
+
undefined,
|
|
1026
|
+
{ scheduler_id },
|
|
1027
|
+
params
|
|
1028
|
+
);
|
|
1029
|
+
}
|
|
992
1030
|
|
|
993
1031
|
|
|
994
1032
|
}
|
package/src/api/Scheduler.ts
CHANGED
|
@@ -107,18 +107,18 @@ class Scheduler {
|
|
|
107
107
|
* `{ id: '<media-uuid>' }`.
|
|
108
108
|
* @returns Axios promise with `{ content, title? }`
|
|
109
109
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
110
|
+
public static generateTitleContent<T>(
|
|
111
|
+
scheduler_id: string,
|
|
112
|
+
data: object,
|
|
113
|
+
params?: Record<string, any>
|
|
114
|
+
): AxiosPromise<Response<T>> {
|
|
115
|
+
return Requests.processRoute(
|
|
116
|
+
SchedulerRoute.routes.generateContent,
|
|
117
|
+
data, // request body
|
|
118
|
+
{ scheduler_id }, // path params
|
|
119
|
+
params // query params
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
122
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
@@ -420,6 +420,42 @@ class Scheduler {
|
|
|
420
420
|
return Requests.processRoute(SchedulerRoute.routes.getDiscordChannels, {}, { scheduler_id }, params);
|
|
421
421
|
}
|
|
422
422
|
|
|
423
|
+
/**
|
|
424
|
+
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
425
|
+
*
|
|
426
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
427
|
+
* @returns promise
|
|
428
|
+
*/
|
|
429
|
+
public static clearGoogleAdsAuth<T>(
|
|
430
|
+
scheduler_id: string,
|
|
431
|
+
params?: Record<string, any>
|
|
432
|
+
): AxiosPromise<Response<T>> {
|
|
433
|
+
return Requests.processRoute(
|
|
434
|
+
SchedulerRoute.routes.clearGoogleAdsAuth,
|
|
435
|
+
{}, // no body
|
|
436
|
+
{ scheduler_id }, // path params
|
|
437
|
+
params // optional query params
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Clear Tiktok Ads OAuth credentials from a promotion schedule.
|
|
443
|
+
*
|
|
444
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
445
|
+
* @returns promise
|
|
446
|
+
*/
|
|
447
|
+
public static clearTiktokAdsAuth<T>(
|
|
448
|
+
scheduler_id: string,
|
|
449
|
+
params?: Record<string, any>
|
|
450
|
+
): AxiosPromise<Response<T>> {
|
|
451
|
+
return Requests.processRoute(
|
|
452
|
+
SchedulerRoute.routes.clearTiktokAdsAuth,
|
|
453
|
+
{}, // no body
|
|
454
|
+
{ scheduler_id }, // path params
|
|
455
|
+
params // optional query params
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
423
459
|
/**
|
|
424
460
|
* Get aggregated reports for a promotion schedule.
|
|
425
461
|
*
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -365,6 +365,14 @@ class AdsRoute {
|
|
|
365
365
|
url: "/ads/twitter/targeting/suggestions",
|
|
366
366
|
method: HTTP_METHODS.GET,
|
|
367
367
|
},
|
|
368
|
+
syncCampaignTree: {
|
|
369
|
+
url: "/ads/campaigns/{campaign_id}/sync_tree",
|
|
370
|
+
method: HTTP_METHODS.POST,
|
|
371
|
+
},
|
|
372
|
+
syncSchedulerCampaigns: {
|
|
373
|
+
url: "/ads/campaigns/scheduler/{scheduler_id}/syncAll",
|
|
374
|
+
method: HTTP_METHODS.POST,
|
|
375
|
+
},
|
|
368
376
|
|
|
369
377
|
};
|
|
370
378
|
}
|
|
@@ -40,6 +40,8 @@ class SchedulerRoute {
|
|
|
40
40
|
clearSteamAuth: { url: '/schedulers/{scheduler_id}/clearSteamAuth', method: HTTP_METHODS.DELETE },
|
|
41
41
|
clearDiscordAuth: { url: '/schedulers/{scheduler_id}/clearDiscordAuth', method: HTTP_METHODS.DELETE },
|
|
42
42
|
clearBlueskyAuth: { url: '/schedulers/{scheduler_id}/clearBlueskyAuth', method: HTTP_METHODS.DELETE },
|
|
43
|
+
clearTiktokAdsAuth: { url: '/schedulers/{scheduler_id}/clearTiktokAdsAuth', method: HTTP_METHODS.DELETE },
|
|
44
|
+
clearGoogleAdsAuth: { url: '/schedulers/{scheduler_id}/clearGoogleAdsAuth', method: HTTP_METHODS.DELETE },
|
|
43
45
|
|
|
44
46
|
//Social Utility Routes
|
|
45
47
|
getFacebookGroups: { url: '/schedulers/{scheduler_id}/facebook/groups', method: HTTP_METHODS.GET },
|