glitch-javascript-sdk 1.9.4 → 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/index.d.ts CHANGED
@@ -1016,6 +1016,49 @@ declare class Ads {
1016
1016
  * @returns Fully-hydrated AdCampaign resource
1017
1017
  */
1018
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>>;
1019
1062
  }
1020
1063
 
1021
1064
  declare class Communities {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.9.4",
3
+ "version": "1.9.5",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Ads.ts CHANGED
@@ -1028,6 +1028,69 @@ class Ads {
1028
1028
  );
1029
1029
  }
1030
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
+
1093
+
1031
1094
 
1032
1095
  }
1033
1096
 
@@ -373,6 +373,34 @@ class AdsRoute {
373
373
  url: "/ads/campaigns/scheduler/{scheduler_id}/syncAll",
374
374
  method: HTTP_METHODS.POST,
375
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
+ },
376
404
 
377
405
  };
378
406
  }