glitch-javascript-sdk 1.9.3 → 1.9.5
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 +110 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +59 -0
- package/dist/esm/api/Scheduler.d.ts +14 -0
- package/dist/esm/index.js +110 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +73 -0
- package/package.json +1 -1
- package/src/api/Ads.ts +150 -49
- package/src/api/Scheduler.ts +48 -12
- package/src/routes/AdsRoute.ts +36 -0
- package/src/routes/SchedulerRoute.ts +2 -0
package/dist/index.d.ts
CHANGED
|
@@ -1000,6 +1000,65 @@ 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>>;
|
|
1019
|
+
/**
|
|
1020
|
+
* Get campaign performance summary.
|
|
1021
|
+
*/
|
|
1022
|
+
static getPerformanceSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Get spend and delivery metrics over time.
|
|
1025
|
+
*/
|
|
1026
|
+
static getSpendDeliveryReport<T>(params: {
|
|
1027
|
+
start_date: string;
|
|
1028
|
+
end_date: string;
|
|
1029
|
+
group_by?: 'day' | 'week' | 'month';
|
|
1030
|
+
community_id?: string;
|
|
1031
|
+
platform?: string;
|
|
1032
|
+
}): AxiosPromise<Response<T>>;
|
|
1033
|
+
/**
|
|
1034
|
+
* Compare performance across platforms.
|
|
1035
|
+
*/
|
|
1036
|
+
static getPlatformComparisonReport<T>(params?: {
|
|
1037
|
+
start_date?: string;
|
|
1038
|
+
end_date?: string;
|
|
1039
|
+
community_id?: string;
|
|
1040
|
+
}): AxiosPromise<Response<T>>;
|
|
1041
|
+
/**
|
|
1042
|
+
* Get performance metrics for individual ad creatives.
|
|
1043
|
+
*/
|
|
1044
|
+
static getCreativePerformanceReport<T>(params?: {
|
|
1045
|
+
community_id?: string;
|
|
1046
|
+
platform?: string;
|
|
1047
|
+
start_date?: string;
|
|
1048
|
+
end_date?: string;
|
|
1049
|
+
limit?: number;
|
|
1050
|
+
sort?: 'spend' | 'impressions' | 'clicks' | 'ctr' | 'cpm' | 'cpc';
|
|
1051
|
+
order?: 'asc' | 'desc';
|
|
1052
|
+
}): AxiosPromise<Response<T>>;
|
|
1053
|
+
/**
|
|
1054
|
+
* Get time-based performance metrics by hour and day of week.
|
|
1055
|
+
*/
|
|
1056
|
+
static getTimePerformanceReport<T>(params: {
|
|
1057
|
+
start_date: string;
|
|
1058
|
+
end_date: string;
|
|
1059
|
+
community_id?: string;
|
|
1060
|
+
platform?: string;
|
|
1061
|
+
}): AxiosPromise<Response<T>>;
|
|
1003
1062
|
}
|
|
1004
1063
|
|
|
1005
1064
|
declare class Communities {
|
|
@@ -4991,6 +5050,20 @@ declare class Scheduler {
|
|
|
4991
5050
|
* @returns promise
|
|
4992
5051
|
*/
|
|
4993
5052
|
static getDiscordChannels<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5053
|
+
/**
|
|
5054
|
+
* Clear Google Ads OAuth credentials from a promotion schedule.
|
|
5055
|
+
*
|
|
5056
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5057
|
+
* @returns promise
|
|
5058
|
+
*/
|
|
5059
|
+
static clearGoogleAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5060
|
+
/**
|
|
5061
|
+
* Clear Tiktok Ads OAuth credentials from a promotion schedule.
|
|
5062
|
+
*
|
|
5063
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
5064
|
+
* @returns promise
|
|
5065
|
+
*/
|
|
5066
|
+
static clearTiktokAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
4994
5067
|
/**
|
|
4995
5068
|
* Get aggregated reports for a promotion schedule.
|
|
4996
5069
|
*
|
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,107 @@ 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
|
+
}
|
|
1030
|
+
|
|
1031
|
+
// ----------------------------------------------------------------------
|
|
1032
|
+
// AD REPORTS
|
|
1033
|
+
// ----------------------------------------------------------------------
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Get campaign performance summary.
|
|
1037
|
+
*/
|
|
1038
|
+
public static getPerformanceSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
1039
|
+
return Requests.processRoute(AdsRoute.routes.getPerformanceSummary, undefined, undefined, params);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
/**
|
|
1043
|
+
* Get spend and delivery metrics over time.
|
|
1044
|
+
*/
|
|
1045
|
+
public static getSpendDeliveryReport<T>(params: {
|
|
1046
|
+
start_date: string;
|
|
1047
|
+
end_date: string;
|
|
1048
|
+
group_by?: 'day' | 'week' | 'month';
|
|
1049
|
+
community_id?: string;
|
|
1050
|
+
platform?: string;
|
|
1051
|
+
}): AxiosPromise<Response<T>> {
|
|
1052
|
+
return Requests.processRoute(AdsRoute.routes.getSpendDeliveryReport, undefined, undefined, params);
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* Compare performance across platforms.
|
|
1057
|
+
*/
|
|
1058
|
+
public static getPlatformComparisonReport<T>(params?: {
|
|
1059
|
+
start_date?: string;
|
|
1060
|
+
end_date?: string;
|
|
1061
|
+
community_id?: string;
|
|
1062
|
+
}): AxiosPromise<Response<T>> {
|
|
1063
|
+
return Requests.processRoute(AdsRoute.routes.getPlatformComparisonReport, undefined, undefined, params);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
/**
|
|
1067
|
+
* Get performance metrics for individual ad creatives.
|
|
1068
|
+
*/
|
|
1069
|
+
public static getCreativePerformanceReport<T>(params?: {
|
|
1070
|
+
community_id?: string;
|
|
1071
|
+
platform?: string;
|
|
1072
|
+
start_date?: string;
|
|
1073
|
+
end_date?: string;
|
|
1074
|
+
limit?: number;
|
|
1075
|
+
sort?: 'spend' | 'impressions' | 'clicks' | 'ctr' | 'cpm' | 'cpc';
|
|
1076
|
+
order?: 'asc' | 'desc';
|
|
1077
|
+
}): AxiosPromise<Response<T>> {
|
|
1078
|
+
return Requests.processRoute(AdsRoute.routes.getCreativePerformanceReport, undefined, undefined, params);
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* Get time-based performance metrics by hour and day of week.
|
|
1083
|
+
*/
|
|
1084
|
+
public static getTimePerformanceReport<T>(params: {
|
|
1085
|
+
start_date: string;
|
|
1086
|
+
end_date: string;
|
|
1087
|
+
community_id?: string;
|
|
1088
|
+
platform?: string;
|
|
1089
|
+
}): AxiosPromise<Response<T>> {
|
|
1090
|
+
return Requests.processRoute(AdsRoute.routes.getTimePerformanceReport, undefined, undefined, params);
|
|
1091
|
+
}
|
|
1092
|
+
|
|
992
1093
|
|
|
993
1094
|
|
|
994
1095
|
}
|
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,42 @@ 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
|
+
},
|
|
376
|
+
|
|
377
|
+
// ----------------------------------------------------------------
|
|
378
|
+
// AD REPORTS
|
|
379
|
+
// ----------------------------------------------------------------
|
|
380
|
+
getPerformanceSummary: {
|
|
381
|
+
url: "/ads/reports/summary",
|
|
382
|
+
method: HTTP_METHODS.GET,
|
|
383
|
+
},
|
|
384
|
+
|
|
385
|
+
getSpendDeliveryReport: {
|
|
386
|
+
url: "/ads/reports/spend-delivery",
|
|
387
|
+
method: HTTP_METHODS.GET,
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
getPlatformComparisonReport: {
|
|
391
|
+
url: "/ads/reports/platform-comparison",
|
|
392
|
+
method: HTTP_METHODS.GET,
|
|
393
|
+
},
|
|
394
|
+
|
|
395
|
+
getCreativePerformanceReport: {
|
|
396
|
+
url: "/ads/reports/creative-performance",
|
|
397
|
+
method: HTTP_METHODS.GET,
|
|
398
|
+
},
|
|
399
|
+
|
|
400
|
+
getTimePerformanceReport: {
|
|
401
|
+
url: "/ads/reports/time-performance",
|
|
402
|
+
method: HTTP_METHODS.GET,
|
|
403
|
+
},
|
|
368
404
|
|
|
369
405
|
};
|
|
370
406
|
}
|
|
@@ -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 },
|