glitch-javascript-sdk 1.8.0 → 1.8.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 +458 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Ads.d.ts +31 -0
- package/dist/esm/api/Scheduler.d.ts +17 -0
- package/dist/esm/api/WebsiteAnalytics.d.ts +187 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +458 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/WebsiteAnalyticsRoute.d.ts +7 -0
- package/dist/esm/util/Session.d.ts +8 -0
- package/dist/index.d.ts +242 -0
- package/package.json +2 -1
- package/src/api/Ads.ts +87 -0
- package/src/api/Scheduler.ts +23 -0
- package/src/api/WebsiteAnalytics.ts +308 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +3 -1
- package/src/routes/AdsRoute.ts +30 -0
- package/src/routes/SchedulerRoute.ts +2 -0
- package/src/routes/WebsiteAnalyticsRoute.ts +69 -0
- package/src/util/Session.ts +92 -4
package/dist/esm/api/Ads.d.ts
CHANGED
|
@@ -220,5 +220,36 @@ declare class Ads {
|
|
|
220
220
|
* @returns A response object with data (funding instruments)
|
|
221
221
|
*/
|
|
222
222
|
static listCampaignFundingInstruments<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
223
|
+
/**
|
|
224
|
+
* GET /ads/reddit/targeting/carriers
|
|
225
|
+
*
|
|
226
|
+
* Example usage:
|
|
227
|
+
* Ads.listRedditCarriers({ scheduler_id: 'uuid-of-scheduler', 'page.size': 50 })
|
|
228
|
+
*/
|
|
229
|
+
static listRedditCarriers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
230
|
+
/**
|
|
231
|
+
* GET /ads/reddit/targeting/communities?names=sub1,sub2
|
|
232
|
+
*/
|
|
233
|
+
static listRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
234
|
+
/**
|
|
235
|
+
* GET /ads/reddit/targeting/communities/search?query=xyz
|
|
236
|
+
*/
|
|
237
|
+
static searchRedditCommunities<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
238
|
+
/**
|
|
239
|
+
* GET /ads/reddit/targeting/devices
|
|
240
|
+
*/
|
|
241
|
+
static listRedditDevices<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
242
|
+
/**
|
|
243
|
+
* GET /ads/reddit/targeting/geolocations
|
|
244
|
+
*/
|
|
245
|
+
static listRedditGeolocations<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
246
|
+
/**
|
|
247
|
+
* GET /ads/reddit/targeting/interests
|
|
248
|
+
*/
|
|
249
|
+
static listRedditInterests<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
250
|
+
/**
|
|
251
|
+
* GET /ads/reddit/targeting/third_party_audiences
|
|
252
|
+
*/
|
|
253
|
+
static listRedditThirdPartyAudiences<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
223
254
|
}
|
|
224
255
|
export default Ads;
|
|
@@ -81,6 +81,16 @@ declare class Scheduler {
|
|
|
81
81
|
* @returns promise
|
|
82
82
|
*/
|
|
83
83
|
static listUpdates<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
84
|
+
/**
|
|
85
|
+
* Search the updates related to a promotion schedule.
|
|
86
|
+
*
|
|
87
|
+
* @see https://api.glitch.fun/api/documentation#/Scheduler/searchTitleUpdates
|
|
88
|
+
*
|
|
89
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
90
|
+
*
|
|
91
|
+
* @returns promise
|
|
92
|
+
*/
|
|
93
|
+
static searchUpdates<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
84
94
|
/**
|
|
85
95
|
* Create a new title update for a promotion schedule.
|
|
86
96
|
*
|
|
@@ -194,6 +204,13 @@ declare class Scheduler {
|
|
|
194
204
|
* @returns promise
|
|
195
205
|
*/
|
|
196
206
|
static clearRedditAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
207
|
+
/**
|
|
208
|
+
* Clear Reddit Ads OAuth credentials from a promotion schedule.
|
|
209
|
+
*
|
|
210
|
+
* @param scheduler_id The ID of the promotion schedule.
|
|
211
|
+
* @returns promise
|
|
212
|
+
*/
|
|
213
|
+
static clearRedditAdsAuth<T>(scheduler_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
197
214
|
/**
|
|
198
215
|
* Clear YouTube OAuth credentials from a promotion schedule.
|
|
199
216
|
*
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import Response from "../util/Response";
|
|
2
|
+
import { AxiosPromise } from "axios";
|
|
3
|
+
declare class WebsiteAnalytics {
|
|
4
|
+
/**
|
|
5
|
+
* List website analytics sessions with comprehensive filtering
|
|
6
|
+
*
|
|
7
|
+
* @param params Filtering options:
|
|
8
|
+
* - title_id?: string - Filter by title ID
|
|
9
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
10
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
11
|
+
* - device_type?: 'desktop'|'mobile'|'tablet'|'bot'|'other'
|
|
12
|
+
* - country_code?: string - 2-letter country code
|
|
13
|
+
* - is_bot?: boolean - Filter by bot status
|
|
14
|
+
* - sort?: 'started_at'|'total_duration'|'pageview_count' - Sort field
|
|
15
|
+
* - order?: 'asc'|'desc' - Sort order
|
|
16
|
+
* - per_page?: number - Items per page (max 100)
|
|
17
|
+
* @returns Promise with paginated sessions data
|
|
18
|
+
*/
|
|
19
|
+
static listSessions<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a paginated list of pageviews with filtering options
|
|
22
|
+
*
|
|
23
|
+
* @param params Filtering options:
|
|
24
|
+
* - title_id?: string - Filter by title ID
|
|
25
|
+
* - analytics_session_id?: string - Filter by session ID
|
|
26
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
27
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
28
|
+
* - is_exit?: boolean - Filter by exit pageviews
|
|
29
|
+
* - sort?: 'occurred_at'|'load_time_ms'|'dom_complete_ms' - Sort field
|
|
30
|
+
* - order?: 'asc'|'desc' - Sort order
|
|
31
|
+
* - per_page?: number - Items per page (max 100)
|
|
32
|
+
* @returns Promise with paginated pageviews data
|
|
33
|
+
*/
|
|
34
|
+
static listPageviews<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* Get a paginated list of events with filtering options
|
|
37
|
+
*
|
|
38
|
+
* @param params Filtering options:
|
|
39
|
+
* - title_id?: string - Filter by title ID
|
|
40
|
+
* - analytics_session_id?: string - Filter by session ID
|
|
41
|
+
* - event_name?: string - Filter by event name
|
|
42
|
+
* - event_category?: string - Filter by event category
|
|
43
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
44
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
45
|
+
* - sort?: 'occurred_at'|'event_name' - Sort field
|
|
46
|
+
* - order?: 'asc'|'desc' - Sort order
|
|
47
|
+
* - per_page?: number - Items per page (max 100)
|
|
48
|
+
* @returns Promise with paginated events data
|
|
49
|
+
*/
|
|
50
|
+
static listEvents<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
51
|
+
/**
|
|
52
|
+
* Get an analytics overview with summarized metrics
|
|
53
|
+
*
|
|
54
|
+
* @param params Overview options:
|
|
55
|
+
* - title_id: string - Required title ID
|
|
56
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
57
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
58
|
+
* - group_by?: 'day'|'week'|'month'|'year' - Grouping period
|
|
59
|
+
* - include_breakdowns?: boolean - Include detailed breakdowns
|
|
60
|
+
* @returns Promise with overview data
|
|
61
|
+
*/
|
|
62
|
+
static overview<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
63
|
+
/**
|
|
64
|
+
* Single ingestion endpoint for sessions, pageviews and events
|
|
65
|
+
*
|
|
66
|
+
* @param data Analytics data payload with type property:
|
|
67
|
+
* - type: 'session'|'pageview'|'event' - Type of analytics data
|
|
68
|
+
* - title_id: string - Title ID
|
|
69
|
+
* - tracking_token: string - HMAC token for verification
|
|
70
|
+
* - plus type-specific fields
|
|
71
|
+
* @returns Promise with acceptance response
|
|
72
|
+
*/
|
|
73
|
+
static collect<T>(data: object): AxiosPromise<Response<T>>;
|
|
74
|
+
/**
|
|
75
|
+
* Get average session length data with optional grouping
|
|
76
|
+
*
|
|
77
|
+
* @param params Filtering options:
|
|
78
|
+
* - title_id?: string - Filter by title ID
|
|
79
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
80
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
81
|
+
* - group_by?: 'day'|'week'|'month' - Grouping period
|
|
82
|
+
* - device_type?: string - Filter by device type
|
|
83
|
+
* - country_code?: string - Filter by country
|
|
84
|
+
* @returns Promise with average session data
|
|
85
|
+
*/
|
|
86
|
+
static sessionsAverage<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
87
|
+
/**
|
|
88
|
+
* Get session duration histogram data
|
|
89
|
+
*
|
|
90
|
+
* @param params Filtering options:
|
|
91
|
+
* - title_id?: string - Filter by title ID
|
|
92
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
93
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
94
|
+
* - bucket_size?: number - Duration bucket size in seconds
|
|
95
|
+
* @returns Promise with histogram data
|
|
96
|
+
*/
|
|
97
|
+
static sessionsHistogram<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
98
|
+
/**
|
|
99
|
+
* Get pageviews over time with optional grouping
|
|
100
|
+
*
|
|
101
|
+
* @param params Filtering options:
|
|
102
|
+
* - title_id?: string - Filter by title ID
|
|
103
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
104
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
105
|
+
* - group_by?: 'hour'|'day'|'week'|'month' - Grouping period
|
|
106
|
+
* - path?: string - Filter by specific path
|
|
107
|
+
* @returns Promise with pageviews over time data
|
|
108
|
+
*/
|
|
109
|
+
static pageviewsOverTime<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
110
|
+
/**
|
|
111
|
+
* Get top pages by views
|
|
112
|
+
*
|
|
113
|
+
* @param params Filtering options:
|
|
114
|
+
* - title_id?: string - Filter by title ID
|
|
115
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
116
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
117
|
+
* - limit?: number - Number of top pages to return
|
|
118
|
+
* @returns Promise with top pages data
|
|
119
|
+
*/
|
|
120
|
+
static topPages<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
121
|
+
/**
|
|
122
|
+
* Get summary of events
|
|
123
|
+
*
|
|
124
|
+
* @param params Filtering options:
|
|
125
|
+
* - title_id?: string - Filter by title ID
|
|
126
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
127
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
128
|
+
* - event_category?: string - Filter by event category
|
|
129
|
+
* @returns Promise with events summary data
|
|
130
|
+
*/
|
|
131
|
+
static eventsSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
132
|
+
/**
|
|
133
|
+
* Get most popular events
|
|
134
|
+
*
|
|
135
|
+
* @param params Filtering options:
|
|
136
|
+
* - title_id?: string - Filter by title ID
|
|
137
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
138
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
139
|
+
* - limit?: number - Number of events to return
|
|
140
|
+
* @returns Promise with popular events data
|
|
141
|
+
*/
|
|
142
|
+
static popularEvents<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
143
|
+
/**
|
|
144
|
+
* Get geographic distribution of visitors
|
|
145
|
+
*
|
|
146
|
+
* @param params Filtering options:
|
|
147
|
+
* - title_id?: string - Filter by title ID
|
|
148
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
149
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
150
|
+
* - limit?: number - Number of countries to return
|
|
151
|
+
* @returns Promise with geo distribution data
|
|
152
|
+
*/
|
|
153
|
+
static geoDistribution<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
154
|
+
/**
|
|
155
|
+
* Get device type breakdown
|
|
156
|
+
*
|
|
157
|
+
* @param params Filtering options:
|
|
158
|
+
* - title_id?: string - Filter by title ID
|
|
159
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
160
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
161
|
+
* @returns Promise with device breakdown data
|
|
162
|
+
*/
|
|
163
|
+
static deviceBreakdown<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
164
|
+
/**
|
|
165
|
+
* Get top referrers
|
|
166
|
+
*
|
|
167
|
+
* @param params Filtering options:
|
|
168
|
+
* - title_id?: string - Filter by title ID
|
|
169
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
170
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
171
|
+
* - limit?: number - Number of referrers to return
|
|
172
|
+
* @returns Promise with referrers data
|
|
173
|
+
*/
|
|
174
|
+
static referrers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
175
|
+
/**
|
|
176
|
+
* Get UTM campaign performance
|
|
177
|
+
*
|
|
178
|
+
* @param params Filtering options:
|
|
179
|
+
* - title_id?: string - Filter by title ID
|
|
180
|
+
* - start_date?: string - Start date (YYYY-MM-DD)
|
|
181
|
+
* - end_date?: string - End date (YYYY-MM-DD)
|
|
182
|
+
* - group_by?: 'source'|'medium'|'campaign' - Grouping field
|
|
183
|
+
* @returns Promise with UTM performance data
|
|
184
|
+
*/
|
|
185
|
+
static utmPerformance<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
186
|
+
}
|
|
187
|
+
export default WebsiteAnalytics;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import Scheduler from "./Scheduler";
|
|
|
31
31
|
import Funnel from "./Funnel";
|
|
32
32
|
import SocialStats from "./SocialStats";
|
|
33
33
|
import Hashtags from "./Hashtags";
|
|
34
|
+
import WebsiteAnalytics from "./WebsiteAnalytics";
|
|
34
35
|
export { Ads };
|
|
35
36
|
export { Auth };
|
|
36
37
|
export { Competitions };
|
|
@@ -64,3 +65,4 @@ export { Scheduler };
|
|
|
64
65
|
export { Funnel };
|
|
65
66
|
export { SocialStats };
|
|
66
67
|
export { Hashtags };
|
|
68
|
+
export { WebsiteAnalytics };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { Scheduler } from "./api";
|
|
|
31
31
|
import { Funnel } from "./api";
|
|
32
32
|
import { SocialStats } from "./api";
|
|
33
33
|
import { Hashtags } from "./api";
|
|
34
|
+
import { WebsiteAnalytics } from "./api";
|
|
34
35
|
import Requests from "./util/Requests";
|
|
35
36
|
import Parser from "./util/Parser";
|
|
36
37
|
import Session from "./util/Session";
|
|
@@ -83,6 +84,7 @@ declare class Glitch {
|
|
|
83
84
|
Scheduler: typeof Scheduler;
|
|
84
85
|
Funnel: typeof Funnel;
|
|
85
86
|
SocialStats: typeof SocialStats;
|
|
87
|
+
WebsiteAnalytics: typeof WebsiteAnalytics;
|
|
86
88
|
};
|
|
87
89
|
static util: {
|
|
88
90
|
Requests: typeof Requests;
|