glitch-javascript-sdk 1.5.1 → 1.5.2
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 +88 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/SocialStats.d.ts +48 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +88 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/SocialStatsRoute.d.ts +7 -0
- package/dist/index.d.ts +47 -0
- package/package.json +1 -1
- package/src/api/SocialStats.ts +65 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +2 -0
- package/src/routes/MediaRoute.ts +1 -1
- package/src/routes/SocialStatsRoute.ts +35 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class SocialStats {
|
|
4
|
+
/**
|
|
5
|
+
* List all the social media account statistics, with optional filters.
|
|
6
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
|
|
7
|
+
*
|
|
8
|
+
* @param params Optional query parameters:
|
|
9
|
+
* - platform (string | string[]): Filter by platform(s)
|
|
10
|
+
* - start_date (string): Filter records created on or after this date (YYYY-MM-DD)
|
|
11
|
+
* - end_date (string): Filter records created on or before this date (YYYY-MM-DD)
|
|
12
|
+
* - user_id (string): Filter by user ID
|
|
13
|
+
* - title_promotion_schedule_id (string): Filter by TitlePromotionSchedule ID
|
|
14
|
+
* @returns promise
|
|
15
|
+
*/
|
|
16
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
17
|
+
/**
|
|
18
|
+
* Get platform-level statistics, such as average follower count per platform.
|
|
19
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
|
|
20
|
+
*
|
|
21
|
+
* @returns promise
|
|
22
|
+
*/
|
|
23
|
+
static platformStatistics<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
24
|
+
/**
|
|
25
|
+
* Generate various reports for social media account statistics.
|
|
26
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
|
|
27
|
+
*
|
|
28
|
+
* @param params Query parameters:
|
|
29
|
+
* - report_type (string): Required (e.g. average_followers, growth, platform_breakdown)
|
|
30
|
+
* - platform (string or string[]): Filter by platform(s)
|
|
31
|
+
* - start_date (string): Filter from date (YYYY-MM-DD)
|
|
32
|
+
* - end_date (string): Filter to date (YYYY-MM-DD)
|
|
33
|
+
* - user_id (string): Filter by user ID
|
|
34
|
+
* - title_promotion_schedule_id (string): Filter by schedule ID
|
|
35
|
+
*
|
|
36
|
+
* @returns promise
|
|
37
|
+
*/
|
|
38
|
+
static reports<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieve a single social media account statistic record by its ID.
|
|
41
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
|
|
42
|
+
*
|
|
43
|
+
* @param id The ID of the statistic record.
|
|
44
|
+
* @returns promise
|
|
45
|
+
*/
|
|
46
|
+
static view<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
47
|
+
}
|
|
48
|
+
export default SocialStats;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import PlayTests from "./PlayTests";
|
|
|
28
28
|
import Media from "./Media";
|
|
29
29
|
import Scheduler from "./Scheduler";
|
|
30
30
|
import Funnel from "./Funnel";
|
|
31
|
+
import SocialStats from "./SocialStats";
|
|
31
32
|
export { Auth };
|
|
32
33
|
export { Competitions };
|
|
33
34
|
export { Communities };
|
|
@@ -58,3 +59,4 @@ export { PlayTests };
|
|
|
58
59
|
export { Media };
|
|
59
60
|
export { Scheduler };
|
|
60
61
|
export { Funnel };
|
|
62
|
+
export { SocialStats };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { PlayTests } from "./api";
|
|
|
28
28
|
import { Media } from "./api";
|
|
29
29
|
import { Scheduler } from "./api";
|
|
30
30
|
import { Funnel } from "./api";
|
|
31
|
+
import { SocialStats } from "./api";
|
|
31
32
|
import Requests from "./util/Requests";
|
|
32
33
|
import Parser from "./util/Parser";
|
|
33
34
|
import Session from "./util/Session";
|
|
@@ -77,6 +78,7 @@ declare class Glitch {
|
|
|
77
78
|
Media: typeof Media;
|
|
78
79
|
Scheduler: typeof Scheduler;
|
|
79
80
|
Funnel: typeof Funnel;
|
|
81
|
+
SocialStats: typeof SocialStats;
|
|
80
82
|
};
|
|
81
83
|
static util: {
|
|
82
84
|
Requests: typeof Requests;
|
package/dist/esm/index.js
CHANGED
|
@@ -11280,7 +11280,7 @@ var MediaRoute = /** @class */ (function () {
|
|
|
11280
11280
|
}
|
|
11281
11281
|
MediaRoute.routes = {
|
|
11282
11282
|
upload: { url: '/media', method: HTTP_METHODS.POST },
|
|
11283
|
-
getMedia: { url: '/media/{
|
|
11283
|
+
getMedia: { url: '/media/{media_id}', method: HTTP_METHODS.GET },
|
|
11284
11284
|
};
|
|
11285
11285
|
return MediaRoute;
|
|
11286
11286
|
}());
|
|
@@ -11834,6 +11834,92 @@ var Funnel = /** @class */ (function () {
|
|
|
11834
11834
|
return Funnel;
|
|
11835
11835
|
}());
|
|
11836
11836
|
|
|
11837
|
+
var SocialStatsRoute = /** @class */ (function () {
|
|
11838
|
+
function SocialStatsRoute() {
|
|
11839
|
+
}
|
|
11840
|
+
SocialStatsRoute.routes = {
|
|
11841
|
+
/**
|
|
11842
|
+
* Retrieve a list of social statistics with optional filters.
|
|
11843
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
|
|
11844
|
+
*/
|
|
11845
|
+
getStats: { url: '/socialstats', method: HTTP_METHODS.GET },
|
|
11846
|
+
/**
|
|
11847
|
+
* Retrieve platform-level statistics (e.g., average followers).
|
|
11848
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
|
|
11849
|
+
*/
|
|
11850
|
+
getPlatformStatistics: { url: '/socialstats/statistics', method: HTTP_METHODS.GET },
|
|
11851
|
+
/**
|
|
11852
|
+
* Generate reports with various insights based on report_type and filters.
|
|
11853
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
|
|
11854
|
+
*/
|
|
11855
|
+
getReports: { url: '/socialstats/reports', method: HTTP_METHODS.GET },
|
|
11856
|
+
/**
|
|
11857
|
+
* Retrieve a single social media account statistic record by its ID.
|
|
11858
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
|
|
11859
|
+
*/
|
|
11860
|
+
getStatById: { url: '/socialstats/{id}', method: HTTP_METHODS.GET },
|
|
11861
|
+
};
|
|
11862
|
+
return SocialStatsRoute;
|
|
11863
|
+
}());
|
|
11864
|
+
|
|
11865
|
+
// src/api/SocialStats.ts
|
|
11866
|
+
var SocialStats = /** @class */ (function () {
|
|
11867
|
+
function SocialStats() {
|
|
11868
|
+
}
|
|
11869
|
+
/**
|
|
11870
|
+
* List all the social media account statistics, with optional filters.
|
|
11871
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics
|
|
11872
|
+
*
|
|
11873
|
+
* @param params Optional query parameters:
|
|
11874
|
+
* - platform (string | string[]): Filter by platform(s)
|
|
11875
|
+
* - start_date (string): Filter records created on or after this date (YYYY-MM-DD)
|
|
11876
|
+
* - end_date (string): Filter records created on or before this date (YYYY-MM-DD)
|
|
11877
|
+
* - user_id (string): Filter by user ID
|
|
11878
|
+
* - title_promotion_schedule_id (string): Filter by TitlePromotionSchedule ID
|
|
11879
|
+
* @returns promise
|
|
11880
|
+
*/
|
|
11881
|
+
SocialStats.list = function (params) {
|
|
11882
|
+
return Requests.processRoute(SocialStatsRoute.routes.getStats, undefined, undefined, params);
|
|
11883
|
+
};
|
|
11884
|
+
/**
|
|
11885
|
+
* Get platform-level statistics, such as average follower count per platform.
|
|
11886
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/platformStatistics
|
|
11887
|
+
*
|
|
11888
|
+
* @returns promise
|
|
11889
|
+
*/
|
|
11890
|
+
SocialStats.platformStatistics = function (params) {
|
|
11891
|
+
return Requests.processRoute(SocialStatsRoute.routes.getPlatformStatistics, undefined, undefined, params);
|
|
11892
|
+
};
|
|
11893
|
+
/**
|
|
11894
|
+
* Generate various reports for social media account statistics.
|
|
11895
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/reports
|
|
11896
|
+
*
|
|
11897
|
+
* @param params Query parameters:
|
|
11898
|
+
* - report_type (string): Required (e.g. average_followers, growth, platform_breakdown)
|
|
11899
|
+
* - platform (string or string[]): Filter by platform(s)
|
|
11900
|
+
* - start_date (string): Filter from date (YYYY-MM-DD)
|
|
11901
|
+
* - end_date (string): Filter to date (YYYY-MM-DD)
|
|
11902
|
+
* - user_id (string): Filter by user ID
|
|
11903
|
+
* - title_promotion_schedule_id (string): Filter by schedule ID
|
|
11904
|
+
*
|
|
11905
|
+
* @returns promise
|
|
11906
|
+
*/
|
|
11907
|
+
SocialStats.reports = function (params) {
|
|
11908
|
+
return Requests.processRoute(SocialStatsRoute.routes.getReports, undefined, undefined, params);
|
|
11909
|
+
};
|
|
11910
|
+
/**
|
|
11911
|
+
* Retrieve a single social media account statistic record by its ID.
|
|
11912
|
+
* @see https://api.glitch.fun/api/documentation#/SocialMediaAccountStatistics/show
|
|
11913
|
+
*
|
|
11914
|
+
* @param id The ID of the statistic record.
|
|
11915
|
+
* @returns promise
|
|
11916
|
+
*/
|
|
11917
|
+
SocialStats.view = function (id, params) {
|
|
11918
|
+
return Requests.processRoute(SocialStatsRoute.routes.getStatById, {}, { id: id }, params);
|
|
11919
|
+
};
|
|
11920
|
+
return SocialStats;
|
|
11921
|
+
}());
|
|
11922
|
+
|
|
11837
11923
|
var Parser = /** @class */ (function () {
|
|
11838
11924
|
function Parser() {
|
|
11839
11925
|
}
|
|
@@ -12261,6 +12347,7 @@ var Glitch = /** @class */ (function () {
|
|
|
12261
12347
|
Media: Media,
|
|
12262
12348
|
Scheduler: Scheduler,
|
|
12263
12349
|
Funnel: Funnel,
|
|
12350
|
+
SocialStats: SocialStats
|
|
12264
12351
|
};
|
|
12265
12352
|
Glitch.util = {
|
|
12266
12353
|
Requests: Requests,
|