glitch-javascript-sdk 2.2.5 → 2.2.7

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.
@@ -0,0 +1,7 @@
1
+ import Route from "./interface";
2
+ declare class TwitchReportingRoute {
3
+ static routes: {
4
+ [key: string]: Route;
5
+ };
6
+ }
7
+ export default TwitchReportingRoute;
package/dist/index.d.ts CHANGED
@@ -4705,6 +4705,18 @@ declare class Campaigns {
4705
4705
  static updateCustomRanking<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
4706
4706
  static updateCreatorBucket<T>(campaign_id: string, creator_id: string, data: object): AxiosPromise<Response<T>>;
4707
4707
  static reRankSourcedCreators<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
4708
+ /**
4709
+ * Queue multiple sourced creators for profile enrichment.
4710
+ * This dispatches a background job for each creator to find their social media profiles and contact information.
4711
+ *
4712
+ * @param campaign_id The UUID of the campaign.
4713
+ * @param data An object containing the array of SourcedCreator IDs to enrich.
4714
+ * @param data.creator_ids An array of SourcedCreator UUIDs.
4715
+ * @returns A promise that resolves with a confirmation message and the count of queued jobs.
4716
+ */
4717
+ static bulkEnrichSourcedCreators<T>(campaign_id: string, data: {
4718
+ creator_ids: string[];
4719
+ }): AxiosPromise<Response<T>>;
4708
4720
  }
4709
4721
 
4710
4722
  declare class Subscriptions {
@@ -6583,6 +6595,70 @@ declare class MarketingAgencies {
6583
6595
  }): AxiosPromise<Response<T>>;
6584
6596
  }
6585
6597
 
6598
+ declare class TwitchReporting {
6599
+ /**
6600
+ * Get a streamer's Concurrent Viewership (CCV) history.
6601
+ *
6602
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorCcvHistory
6603
+ *
6604
+ * @param twitch_streamer_id The ID of the Twitch streamer.
6605
+ * @param params Optional query parameters for filtering (e.g., start_date, end_date, per_page).
6606
+ *
6607
+ * @returns promise
6608
+ */
6609
+ static getCreatorCcvHistory<T>(twitch_streamer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
6610
+ /**
6611
+ * Get a summary of game performance metrics.
6612
+ *
6613
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getGamesSummary
6614
+ *
6615
+ * @param params Optional query parameters for filtering and sorting (e.g., start_date, end_date, sort_by, limit).
6616
+ *
6617
+ * @returns promise
6618
+ */
6619
+ static getGamesSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6620
+ /**
6621
+ * Get most recently active streamers.
6622
+ *
6623
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveStreamers
6624
+ *
6625
+ * @param params Optional query parameters (e.g., limit).
6626
+ *
6627
+ * @returns promise
6628
+ */
6629
+ static getMostActiveStreamers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6630
+ /**
6631
+ * Get most recently streamed games.
6632
+ *
6633
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveGames
6634
+ *
6635
+ * @param params Optional query parameters (e.g., limit).
6636
+ *
6637
+ * @returns promise
6638
+ */
6639
+ static getMostActiveGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6640
+ /**
6641
+ * Get top streamers by performance (average or peak CCV).
6642
+ *
6643
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getTopStreamers
6644
+ *
6645
+ * @param params Optional query parameters for filtering and sorting (e.g., sort_by, start_date, limit).
6646
+ *
6647
+ * @returns promise
6648
+ */
6649
+ static getTopStreamers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
6650
+ /**
6651
+ * Get a streamer's typical streaming schedule as a heatmap.
6652
+ *
6653
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorStreamingSchedule
6654
+ *
6655
+ * @param twitch_streamer_id The ID of the Twitch streamer.
6656
+ *
6657
+ * @returns promise
6658
+ */
6659
+ static getCreatorStreamingSchedule<T>(twitch_streamer_id: string): AxiosPromise<Response<T>>;
6660
+ }
6661
+
6586
6662
  interface Route {
6587
6663
  url: string;
6588
6664
  method: string;
@@ -6929,6 +7005,7 @@ declare class Glitch {
6929
7005
  ShortLinks: typeof ShortLinks;
6930
7006
  AIUsage: typeof AIUsage;
6931
7007
  MarketingAgencies: typeof MarketingAgencies;
7008
+ TwitchReporting: typeof TwitchReporting;
6932
7009
  };
6933
7010
  static util: {
6934
7011
  Requests: typeof Requests;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -960,6 +960,19 @@ class Campaigns {
960
960
  return Requests.processRoute(CampaignsRoute.routes.reRankSourcedCreators, data, { campaign_id });
961
961
  }
962
962
 
963
+ /**
964
+ * Queue multiple sourced creators for profile enrichment.
965
+ * This dispatches a background job for each creator to find their social media profiles and contact information.
966
+ *
967
+ * @param campaign_id The UUID of the campaign.
968
+ * @param data An object containing the array of SourcedCreator IDs to enrich.
969
+ * @param data.creator_ids An array of SourcedCreator UUIDs.
970
+ * @returns A promise that resolves with a confirmation message and the count of queued jobs.
971
+ */
972
+ public static bulkEnrichSourcedCreators<T>(campaign_id: string, data: { creator_ids: string[] }): AxiosPromise<Response<T>> {
973
+ return Requests.processRoute(CampaignsRoute.routes.bulkEnrichSourcedCreators, data, { campaign_id });
974
+ }
975
+
963
976
 
964
977
  }
965
978
 
@@ -0,0 +1,89 @@
1
+ import TwitchReportingRoute from "../routes/TwitchReportingRoute";
2
+ import Requests from "../util/Requests";
3
+ import Response from "../util/Response";
4
+ import { AxiosPromise } from "axios";
5
+
6
+ class TwitchReporting {
7
+
8
+ /**
9
+ * Get a streamer's Concurrent Viewership (CCV) history.
10
+ *
11
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorCcvHistory
12
+ *
13
+ * @param twitch_streamer_id The ID of the Twitch streamer.
14
+ * @param params Optional query parameters for filtering (e.g., start_date, end_date, per_page).
15
+ *
16
+ * @returns promise
17
+ */
18
+ public static getCreatorCcvHistory<T>(twitch_streamer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
19
+ return Requests.processRoute(TwitchReportingRoute.routes.getCreatorCcvHistory, undefined, { twitch_streamer_id }, params);
20
+ }
21
+
22
+ /**
23
+ * Get a summary of game performance metrics.
24
+ *
25
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getGamesSummary
26
+ *
27
+ * @param params Optional query parameters for filtering and sorting (e.g., start_date, end_date, sort_by, limit).
28
+ *
29
+ * @returns promise
30
+ */
31
+ public static getGamesSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
32
+ return Requests.processRoute(TwitchReportingRoute.routes.getGamesSummary, undefined, undefined, params);
33
+ }
34
+
35
+ /**
36
+ * Get most recently active streamers.
37
+ *
38
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveStreamers
39
+ *
40
+ * @param params Optional query parameters (e.g., limit).
41
+ *
42
+ * @returns promise
43
+ */
44
+ public static getMostActiveStreamers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
45
+ return Requests.processRoute(TwitchReportingRoute.routes.getMostActiveStreamers, undefined, undefined, params);
46
+ }
47
+
48
+ /**
49
+ * Get most recently streamed games.
50
+ *
51
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveGames
52
+ *
53
+ * @param params Optional query parameters (e.g., limit).
54
+ *
55
+ * @returns promise
56
+ */
57
+ public static getMostActiveGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
58
+ return Requests.processRoute(TwitchReportingRoute.routes.getMostActiveGames, undefined, undefined, params);
59
+ }
60
+
61
+ /**
62
+ * Get top streamers by performance (average or peak CCV).
63
+ *
64
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getTopStreamers
65
+ *
66
+ * @param params Optional query parameters for filtering and sorting (e.g., sort_by, start_date, limit).
67
+ *
68
+ * @returns promise
69
+ */
70
+ public static getTopStreamers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
71
+ return Requests.processRoute(TwitchReportingRoute.routes.getTopStreamers, undefined, undefined, params);
72
+ }
73
+
74
+ /**
75
+ * Get a streamer's typical streaming schedule as a heatmap.
76
+ *
77
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorStreamingSchedule
78
+ *
79
+ * @param twitch_streamer_id The ID of the Twitch streamer.
80
+ *
81
+ * @returns promise
82
+ */
83
+ public static getCreatorStreamingSchedule<T>(twitch_streamer_id: string): AxiosPromise<Response<T>> {
84
+ return Requests.processRoute(TwitchReportingRoute.routes.getCreatorStreamingSchedule, undefined, { twitch_streamer_id });
85
+ }
86
+
87
+ }
88
+
89
+ export default TwitchReporting;
package/src/api/index.ts CHANGED
@@ -37,6 +37,7 @@ import WebsiteAnalytics from "./WebsiteAnalytics";
37
37
  import ShortLinks from "./ShortLinks";
38
38
  import AIUsage from "./AIUsage";
39
39
  import MarketingAgencies from "./MarketingAgencies";
40
+ import TwitchReporting from "./TwitchReporting";
40
41
 
41
42
  export {Ads};
42
43
  export {AccessKeys};
@@ -76,4 +77,5 @@ export {WebsiteAnalytics};
76
77
  export {Fingerprinting};
77
78
  export {ShortLinks};
78
79
  export {AIUsage};
79
- export {MarketingAgencies};
80
+ export {MarketingAgencies};
81
+ export {TwitchReporting};
package/src/index.ts CHANGED
@@ -41,6 +41,7 @@ import {Fingerprinting} from "./api";
41
41
  import {ShortLinks} from "./api";
42
42
  import {AIUsage} from "./api";
43
43
  import {MarketingAgencies} from "./api"
44
+ import {TwitchReporting} from './api'
44
45
 
45
46
  import Requests from "./util/Requests";
46
47
  import Parser from "./util/Parser";
@@ -110,7 +111,8 @@ class Glitch {
110
111
  Fingerprinting : Fingerprinting,
111
112
  ShortLinks : ShortLinks,
112
113
  AIUsage : AIUsage,
113
- MarketingAgencies : MarketingAgencies
114
+ MarketingAgencies : MarketingAgencies,
115
+ TwitchReporting: TwitchReporting,
114
116
  }
115
117
 
116
118
  public static util = {
@@ -80,6 +80,8 @@ class CampaignsRoute {
80
80
  updateCustomRanking: { url: '/campaigns/{campaign_id}/sourcing/custom-ranking', method: HTTP_METHODS.PUT },
81
81
  updateCreatorBucket: { url: '/campaigns/{campaign_id}/sourcing/creators/{creator_id}/bucket', method: HTTP_METHODS.PUT },
82
82
  reRankSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/re-rank', method: HTTP_METHODS.POST },
83
+ bulkEnrichSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/creators/bulk-enrich', method: HTTP_METHODS.POST },
84
+
83
85
 
84
86
  };
85
87
 
@@ -0,0 +1,35 @@
1
+ import Route from "./interface";
2
+ import HTTP_METHODS from "../constants/HttpMethods";
3
+
4
+ class TwitchReportingRoute {
5
+
6
+ public static routes: { [key: string]: Route } = {
7
+ getCreatorCcvHistory: {
8
+ url: '/reporting/twitch/streamers/{twitch_streamer_id}/ccv-history',
9
+ method: HTTP_METHODS.GET
10
+ },
11
+ getGamesSummary: {
12
+ url: '/reporting/twitch/games/summary',
13
+ method: HTTP_METHODS.GET
14
+ },
15
+ getMostActiveStreamers: {
16
+ url: '/reporting/twitch/streamers/most-active',
17
+ method: HTTP_METHODS.GET
18
+ },
19
+ getMostActiveGames: {
20
+ url: '/reporting/twitch/games/most-active',
21
+ method: HTTP_METHODS.GET
22
+ },
23
+ getTopStreamers: {
24
+ url: '/reporting/twitch/streamers/top',
25
+ method: HTTP_METHODS.GET
26
+ },
27
+ getCreatorStreamingSchedule: {
28
+ url: '/reporting/twitch/streamers/{twitch_streamer_id}/streaming-schedule',
29
+ method: HTTP_METHODS.GET
30
+ },
31
+ };
32
+
33
+ }
34
+
35
+ export default TwitchReportingRoute;