glitch-javascript-sdk 2.2.6 → 2.2.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.
@@ -0,0 +1,81 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class TwitchReporting {
4
+ /**
5
+ * Get a streamer's Concurrent Viewership (CCV) history.
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorCcvHistory
8
+ *
9
+ * @param twitch_streamer_id The ID of the Twitch streamer.
10
+ * @param params Optional query parameters for filtering (e.g., start_date, end_date, per_page).
11
+ *
12
+ * @returns promise
13
+ */
14
+ static getCreatorCcvHistory<T>(twitch_streamer_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
15
+ /**
16
+ * Get a summary of game performance metrics.
17
+ *
18
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getGamesSummary
19
+ *
20
+ * @param params Optional query parameters for filtering and sorting (e.g., start_date, end_date, sort_by, limit).
21
+ *
22
+ * @returns promise
23
+ */
24
+ static getGamesSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
25
+ /**
26
+ * Get most recently active streamers.
27
+ *
28
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveStreamers
29
+ *
30
+ * @param params Optional query parameters (e.g., limit).
31
+ *
32
+ * @returns promise
33
+ */
34
+ static getMostActiveStreamers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
35
+ /**
36
+ * Get most recently streamed games.
37
+ *
38
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveGames
39
+ *
40
+ * @param params Optional query parameters (e.g., limit).
41
+ *
42
+ * @returns promise
43
+ */
44
+ static getMostActiveGames<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
45
+ /**
46
+ * Get top streamers by performance (average or peak CCV).
47
+ *
48
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getTopStreamers
49
+ *
50
+ * @param params Optional query parameters for filtering and sorting (e.g., sort_by, start_date, limit).
51
+ *
52
+ * @returns promise
53
+ */
54
+ static getTopStreamers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
55
+ /**
56
+ * Get a streamer's typical streaming schedule as a heatmap.
57
+ *
58
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorStreamingSchedule
59
+ *
60
+ * @param twitch_streamer_id The ID of the Twitch streamer.
61
+ *
62
+ * @returns promise
63
+ */
64
+ static getCreatorStreamingSchedule<T>(twitch_streamer_id: string): AxiosPromise<Response<T>>;
65
+ /**
66
+ * Get a list of games played by a specific streamer.
67
+ *
68
+ * @param twitch_streamer_id The ID of the Twitch streamer.
69
+ * @returns promise
70
+ */
71
+ static getStreamerGameHistory<T>(twitch_streamer_id: string): AxiosPromise<Response<T>>;
72
+ /**
73
+ * Get a paginated list of streamers who played a specific game.
74
+ *
75
+ * @param game_name The URL-encoded name of the game.
76
+ * @param params Optional query parameters for pagination (e.g., page, per_page).
77
+ * @returns promise
78
+ */
79
+ static getStreamersForGame<T>(game_name: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
80
+ }
81
+ export default TwitchReporting;
@@ -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
  export { Ads };
41
42
  export { AccessKeys };
42
43
  export { Auth };
@@ -76,3 +77,4 @@ export { Fingerprinting };
76
77
  export { ShortLinks };
77
78
  export { AIUsage };
78
79
  export { MarketingAgencies };
80
+ export { TwitchReporting };
@@ -37,6 +37,7 @@ import { Fingerprinting } from "./api";
37
37
  import { ShortLinks } from "./api";
38
38
  import { AIUsage } from "./api";
39
39
  import { MarketingAgencies } from "./api";
40
+ import { TwitchReporting } from './api';
40
41
  import Requests from "./util/Requests";
41
42
  import Parser from "./util/Parser";
42
43
  import Session from "./util/Session";
@@ -95,6 +96,7 @@ declare class Glitch {
95
96
  ShortLinks: typeof ShortLinks;
96
97
  AIUsage: typeof AIUsage;
97
98
  MarketingAgencies: typeof MarketingAgencies;
99
+ TwitchReporting: typeof TwitchReporting;
98
100
  };
99
101
  static util: {
100
102
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -15605,6 +15605,144 @@ var MarketingAgencies = /** @class */ (function () {
15605
15605
  return MarketingAgencies;
15606
15606
  }());
15607
15607
 
15608
+ var TwitchReportingRoute = /** @class */ (function () {
15609
+ function TwitchReportingRoute() {
15610
+ }
15611
+ TwitchReportingRoute.routes = {
15612
+ getCreatorCcvHistory: {
15613
+ url: '/reporting/twitch/streamers/{twitch_streamer_id}/ccv-history',
15614
+ method: HTTP_METHODS.GET
15615
+ },
15616
+ getGamesSummary: {
15617
+ url: '/reporting/twitch/games/summary',
15618
+ method: HTTP_METHODS.GET
15619
+ },
15620
+ getMostActiveStreamers: {
15621
+ url: '/reporting/twitch/streamers/most-active',
15622
+ method: HTTP_METHODS.GET
15623
+ },
15624
+ getMostActiveGames: {
15625
+ url: '/reporting/twitch/games/most-active',
15626
+ method: HTTP_METHODS.GET
15627
+ },
15628
+ getTopStreamers: {
15629
+ url: '/reporting/twitch/streamers/top',
15630
+ method: HTTP_METHODS.GET
15631
+ },
15632
+ getCreatorStreamingSchedule: {
15633
+ url: '/reporting/twitch/streamers/{twitch_streamer_id}/streaming-schedule',
15634
+ method: HTTP_METHODS.GET
15635
+ },
15636
+ getStreamerGameHistory: {
15637
+ url: '/reporting/twitch/streamers/{twitch_streamer_id}/games',
15638
+ method: HTTP_METHODS.GET
15639
+ },
15640
+ getStreamersForGame: {
15641
+ url: '/reporting/twitch/games/{game_name}/streamers',
15642
+ method: HTTP_METHODS.GET
15643
+ },
15644
+ };
15645
+ return TwitchReportingRoute;
15646
+ }());
15647
+
15648
+ var TwitchReporting = /** @class */ (function () {
15649
+ function TwitchReporting() {
15650
+ }
15651
+ /**
15652
+ * Get a streamer's Concurrent Viewership (CCV) history.
15653
+ *
15654
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorCcvHistory
15655
+ *
15656
+ * @param twitch_streamer_id The ID of the Twitch streamer.
15657
+ * @param params Optional query parameters for filtering (e.g., start_date, end_date, per_page).
15658
+ *
15659
+ * @returns promise
15660
+ */
15661
+ TwitchReporting.getCreatorCcvHistory = function (twitch_streamer_id, params) {
15662
+ return Requests.processRoute(TwitchReportingRoute.routes.getCreatorCcvHistory, undefined, { twitch_streamer_id: twitch_streamer_id }, params);
15663
+ };
15664
+ /**
15665
+ * Get a summary of game performance metrics.
15666
+ *
15667
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getGamesSummary
15668
+ *
15669
+ * @param params Optional query parameters for filtering and sorting (e.g., start_date, end_date, sort_by, limit).
15670
+ *
15671
+ * @returns promise
15672
+ */
15673
+ TwitchReporting.getGamesSummary = function (params) {
15674
+ return Requests.processRoute(TwitchReportingRoute.routes.getGamesSummary, undefined, undefined, params);
15675
+ };
15676
+ /**
15677
+ * Get most recently active streamers.
15678
+ *
15679
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveStreamers
15680
+ *
15681
+ * @param params Optional query parameters (e.g., limit).
15682
+ *
15683
+ * @returns promise
15684
+ */
15685
+ TwitchReporting.getMostActiveStreamers = function (params) {
15686
+ return Requests.processRoute(TwitchReportingRoute.routes.getMostActiveStreamers, undefined, undefined, params);
15687
+ };
15688
+ /**
15689
+ * Get most recently streamed games.
15690
+ *
15691
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getMostActiveGames
15692
+ *
15693
+ * @param params Optional query parameters (e.g., limit).
15694
+ *
15695
+ * @returns promise
15696
+ */
15697
+ TwitchReporting.getMostActiveGames = function (params) {
15698
+ return Requests.processRoute(TwitchReportingRoute.routes.getMostActiveGames, undefined, undefined, params);
15699
+ };
15700
+ /**
15701
+ * Get top streamers by performance (average or peak CCV).
15702
+ *
15703
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getTopStreamers
15704
+ *
15705
+ * @param params Optional query parameters for filtering and sorting (e.g., sort_by, start_date, limit).
15706
+ *
15707
+ * @returns promise
15708
+ */
15709
+ TwitchReporting.getTopStreamers = function (params) {
15710
+ return Requests.processRoute(TwitchReportingRoute.routes.getTopStreamers, undefined, undefined, params);
15711
+ };
15712
+ /**
15713
+ * Get a streamer's typical streaming schedule as a heatmap.
15714
+ *
15715
+ * @see https://api.glitch.fun/api/documentation#/Twitch%20Reporting/getCreatorStreamingSchedule
15716
+ *
15717
+ * @param twitch_streamer_id The ID of the Twitch streamer.
15718
+ *
15719
+ * @returns promise
15720
+ */
15721
+ TwitchReporting.getCreatorStreamingSchedule = function (twitch_streamer_id) {
15722
+ return Requests.processRoute(TwitchReportingRoute.routes.getCreatorStreamingSchedule, undefined, { twitch_streamer_id: twitch_streamer_id });
15723
+ };
15724
+ /**
15725
+ * Get a list of games played by a specific streamer.
15726
+ *
15727
+ * @param twitch_streamer_id The ID of the Twitch streamer.
15728
+ * @returns promise
15729
+ */
15730
+ TwitchReporting.getStreamerGameHistory = function (twitch_streamer_id) {
15731
+ return Requests.processRoute(TwitchReportingRoute.routes.getStreamerGameHistory, undefined, { twitch_streamer_id: twitch_streamer_id });
15732
+ };
15733
+ /**
15734
+ * Get a paginated list of streamers who played a specific game.
15735
+ *
15736
+ * @param game_name The URL-encoded name of the game.
15737
+ * @param params Optional query parameters for pagination (e.g., page, per_page).
15738
+ * @returns promise
15739
+ */
15740
+ TwitchReporting.getStreamersForGame = function (game_name, params) {
15741
+ return Requests.processRoute(TwitchReportingRoute.routes.getStreamersForGame, undefined, { game_name: encodeURIComponent(game_name) }, params);
15742
+ };
15743
+ return TwitchReporting;
15744
+ }());
15745
+
15608
15746
  var Parser = /** @class */ (function () {
15609
15747
  function Parser() {
15610
15748
  }
@@ -16131,7 +16269,8 @@ var Glitch = /** @class */ (function () {
16131
16269
  Fingerprinting: Fingerprinting,
16132
16270
  ShortLinks: ShortLinks,
16133
16271
  AIUsage: AIUsage,
16134
- MarketingAgencies: MarketingAgencies
16272
+ MarketingAgencies: MarketingAgencies,
16273
+ TwitchReporting: TwitchReporting,
16135
16274
  };
16136
16275
  Glitch.util = {
16137
16276
  Requests: Requests,