glitch-javascript-sdk 2.2.6 → 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.
- package/dist/cjs/index.js +113 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/TwitchReporting.d.ts +66 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +113 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/TwitchReportingRoute.d.ts +7 -0
- package/dist/index.d.ts +65 -0
- package/package.json +1 -1
- package/src/api/TwitchReporting.ts +89 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/TwitchReportingRoute.ts +35 -0
package/dist/index.d.ts
CHANGED
|
@@ -6595,6 +6595,70 @@ declare class MarketingAgencies {
|
|
|
6595
6595
|
}): AxiosPromise<Response<T>>;
|
|
6596
6596
|
}
|
|
6597
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
|
+
|
|
6598
6662
|
interface Route {
|
|
6599
6663
|
url: string;
|
|
6600
6664
|
method: string;
|
|
@@ -6941,6 +7005,7 @@ declare class Glitch {
|
|
|
6941
7005
|
ShortLinks: typeof ShortLinks;
|
|
6942
7006
|
AIUsage: typeof AIUsage;
|
|
6943
7007
|
MarketingAgencies: typeof MarketingAgencies;
|
|
7008
|
+
TwitchReporting: typeof TwitchReporting;
|
|
6944
7009
|
};
|
|
6945
7010
|
static util: {
|
|
6946
7011
|
Requests: typeof Requests;
|
package/package.json
CHANGED
|
@@ -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 = {
|
|
@@ -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;
|