glitch-javascript-sdk 1.7.6 → 1.7.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,188 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Ads {
4
+ /**
5
+ * List Ad Campaigns.
6
+ *
7
+ * Example usage:
8
+ * Ads.listCampaigns({ community: 'uuid-of-community', platform: 'tiktok' })
9
+ *
10
+ * @param params Query parameters (e.g. community, platform, advertiser_id, etc.)
11
+ * @returns A paginated list of AdCampaign resources
12
+ */
13
+ static listCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
14
+ /**
15
+ * Create a new Ad Campaign.
16
+ *
17
+ * @param data The Ad Campaign payload (JSON) to create
18
+ * @param params Optional query parameters
19
+ * @returns The newly created AdCampaign resource
20
+ */
21
+ static createCampaign<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
22
+ /**
23
+ * Retrieve a single Ad Campaign by ID.
24
+ *
25
+ * @param campaign_id The UUID of the campaign to fetch
26
+ * @param params Optional query parameters
27
+ * @returns The requested AdCampaign resource
28
+ */
29
+ static viewCampaign<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
30
+ /**
31
+ * Update an existing Ad Campaign by ID.
32
+ *
33
+ * @param campaign_id The UUID of the campaign to update
34
+ * @param data The partial or full updated AdCampaign payload
35
+ * @param params Optional query parameters
36
+ * @returns The updated AdCampaign resource
37
+ */
38
+ static updateCampaign<T>(campaign_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
39
+ /**
40
+ * Delete an Ad Campaign by ID.
41
+ *
42
+ * @param campaign_id The UUID of the campaign to delete
43
+ * @param params Optional query parameters
44
+ * @returns A 204 No Content response on success
45
+ */
46
+ static deleteCampaign<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
47
+ /**
48
+ * List Ad Groups (ad sets) for a specific campaign.
49
+ *
50
+ * Example usage:
51
+ * Ads.listGroups('some-campaign-uuid', { promotion_type: 'WEBSITE' })
52
+ *
53
+ * @param campaign_id The UUID of the parent Ad Campaign
54
+ * @param params Optional query parameters (e.g. promotion_type, operation_status, etc.)
55
+ * @returns A paginated list of AdGroup resources
56
+ */
57
+ static listGroups<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
58
+ /**
59
+ * Create a new Ad Group (ad set) under a specific campaign.
60
+ *
61
+ * @param campaign_id The UUID of the parent Ad Campaign
62
+ * @param data The AdGroup creation payload
63
+ * @param params Optional query parameters
64
+ * @returns The newly created AdGroup resource
65
+ */
66
+ static createGroup<T>(campaign_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
67
+ /**
68
+ * Retrieve a single Ad Group by ID, under a specific campaign.
69
+ *
70
+ * @param campaign_id The UUID of the parent Ad Campaign
71
+ * @param group_id The UUID of the AdGroup to fetch
72
+ * @param params Optional query parameters
73
+ * @returns The requested AdGroup resource
74
+ */
75
+ static viewGroup<T>(campaign_id: string, group_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
76
+ /**
77
+ * Update an Ad Group (ad set) by ID.
78
+ *
79
+ * @param campaign_id The UUID of the parent Ad Campaign
80
+ * @param group_id The UUID of the AdGroup to update
81
+ * @param data Updated fields for the AdGroup
82
+ * @param params Optional query parameters
83
+ * @returns The updated AdGroup resource
84
+ */
85
+ static updateGroup<T>(campaign_id: string, group_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
86
+ /**
87
+ * Delete an Ad Group (ad set) by ID, under a specific campaign.
88
+ *
89
+ * @param campaign_id The UUID of the parent Ad Campaign
90
+ * @param group_id The UUID of the AdGroup to delete
91
+ * @param params Optional query parameters
92
+ * @returns A 204 No Content response on success
93
+ */
94
+ static deleteGroup<T>(campaign_id: string, group_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
95
+ /**
96
+ * List Ads (creatives).
97
+ *
98
+ * Supports filtering by ad_group_id, social_media_post_id, operation_status, etc.
99
+ *
100
+ * @param params Optional query parameters for filtering/sorting
101
+ * @returns A paginated list of Ad resources
102
+ */
103
+ static listAds<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
104
+ /**
105
+ * Create a new Ad (creative).
106
+ *
107
+ * @param data The Ad creation payload
108
+ * @param params Optional query parameters
109
+ * @returns The newly created Ad resource
110
+ */
111
+ static createAd<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
112
+ /**
113
+ * Retrieve a single Ad by ID.
114
+ *
115
+ * @param ad_id The UUID of the Ad to fetch
116
+ * @param params Optional query parameters
117
+ * @returns The requested Ad resource
118
+ */
119
+ static viewAd<T>(ad_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
120
+ /**
121
+ * Update an existing Ad by ID.
122
+ *
123
+ * @param ad_id The UUID of the Ad to update
124
+ * @param data The partial or full Ad payload
125
+ * @param params Optional query parameters
126
+ * @returns The updated Ad resource
127
+ */
128
+ static updateAd<T>(ad_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
129
+ /**
130
+ * Delete an Ad by ID.
131
+ *
132
+ * @param ad_id The UUID of the Ad to delete
133
+ * @param params Optional query parameters
134
+ * @returns A 204 No Content response on success
135
+ */
136
+ static deleteAd<T>(ad_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
137
+ /**
138
+ * List triggers defined for a given Ad Group.
139
+ *
140
+ * @param campaign_id The UUID of the parent Ad Campaign
141
+ * @param group_id The UUID of the Ad Group
142
+ * @param params Optional query parameters (pagination, etc.)
143
+ * @returns A paginated list of AdGroupTrigger resources
144
+ */
145
+ static listTriggers<T>(campaign_id: string, group_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
146
+ /**
147
+ * Create a new Ad Group Trigger.
148
+ *
149
+ * @param campaign_id The UUID of the parent Ad Campaign
150
+ * @param group_id The UUID of the Ad Group
151
+ * @param data The trigger creation payload
152
+ * @param params Optional query parameters
153
+ * @returns The newly created AdGroupTrigger resource
154
+ */
155
+ static createTrigger<T>(campaign_id: string, group_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
156
+ /**
157
+ * Retrieve a single Ad Group Trigger by ID.
158
+ *
159
+ * @param campaign_id The UUID of the parent Ad Campaign
160
+ * @param group_id The UUID of the Ad Group
161
+ * @param trigger_id The UUID of the trigger
162
+ * @param params Optional query parameters
163
+ * @returns The requested AdGroupTrigger resource
164
+ */
165
+ static viewTrigger<T>(campaign_id: string, group_id: string, trigger_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
166
+ /**
167
+ * Update an existing Ad Group Trigger by ID.
168
+ *
169
+ * @param campaign_id The UUID of the parent Ad Campaign
170
+ * @param group_id The UUID of the Ad Group
171
+ * @param trigger_id The UUID of the trigger to update
172
+ * @param data Updated trigger fields
173
+ * @param params Optional query parameters
174
+ * @returns The updated AdGroupTrigger resource
175
+ */
176
+ static updateTrigger<T>(campaign_id: string, group_id: string, trigger_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
177
+ /**
178
+ * Delete an Ad Group Trigger by ID.
179
+ *
180
+ * @param campaign_id The UUID of the parent Ad Campaign
181
+ * @param group_id The UUID of the Ad Group
182
+ * @param trigger_id The UUID of the trigger
183
+ * @param params Optional query parameters
184
+ * @returns A 204 No Content response on success
185
+ */
186
+ static deleteTrigger<T>(campaign_id: string, group_id: string, trigger_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
187
+ }
188
+ export default Ads;
@@ -223,9 +223,9 @@ declare class Titles {
223
223
  static retentionAnalysis<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
224
224
  static distinctDimensions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
225
225
  /**
226
- * List sessions for a specific title, with optional filters and pagination.
227
- * Returns a paginated list of sessions with start/end times, session_length, user info, etc.
228
- */
226
+ * List sessions for a specific title, with optional filters and pagination.
227
+ * Returns a paginated list of sessions with start/end times, session_length, user info, etc.
228
+ */
229
229
  static listSessions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
230
230
  /**
231
231
  * Get aggregated average session length data (daily/weekly/monthly) for a title.
@@ -233,5 +233,35 @@ declare class Titles {
233
233
  */
234
234
  static sessionsAverage<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
235
235
  static sessionsHistogram<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
236
+ /**
237
+ * Upload a CSV/Excel file containing daily UTM analytics for a specific title.
238
+ *
239
+ * @param title_id The UUID of the title
240
+ * @param file The CSV or Excel file
241
+ * @param data Optional form fields (if needed)
242
+ * @param params Optional query parameters
243
+ * @returns AxiosPromise
244
+ */
245
+ static importUtmAnalytics<T>(title_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
246
+ /**
247
+ * Retrieve the UTM analytics data for a title (paginated, filterable, sortable).
248
+ *
249
+ * GET /titles/{title_id}/utm
250
+ *
251
+ * @param title_id The UUID of the title
252
+ * @param params Optional query params: start_date, end_date, source, device_type, sort_by, etc.
253
+ * @returns AxiosPromise
254
+ */
255
+ static getUtmAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
256
+ /**
257
+ * Analyze UTM data with optional group_by (source, campaign, medium, device_type, etc.)
258
+ *
259
+ * GET /titles/{title_id}/utm/analysis
260
+ *
261
+ * @param title_id The UUID of the title
262
+ * @param params e.g. ?group_by=source&start_date=YYYY-MM-DD
263
+ * @returns AxiosPromise
264
+ */
265
+ static analyzeUtmAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
236
266
  }
237
267
  export default Titles;
@@ -1,4 +1,5 @@
1
1
  import Auth from "./Auth";
2
+ import Ads from "./Ads";
2
3
  import Competitions from "./Competitions";
3
4
  import Communities from "./Communities";
4
5
  import Users from "./Users";
@@ -30,6 +31,7 @@ import Scheduler from "./Scheduler";
30
31
  import Funnel from "./Funnel";
31
32
  import SocialStats from "./SocialStats";
32
33
  import Hashtags from "./Hashtags";
34
+ export { Ads };
33
35
  export { Auth };
34
36
  export { Competitions };
35
37
  export { Communities };
@@ -2,6 +2,7 @@ import { Config } from "./config";
2
2
  import Auth from "./api/Auth";
3
3
  import Competitions from "./api/Competitions";
4
4
  import { Communities, Social } from "./api";
5
+ import { Ads } from "./api";
5
6
  import { Users } from "./api";
6
7
  import { Events } from "./api";
7
8
  import { Teams } from "./api";
@@ -49,6 +50,7 @@ declare class Glitch {
49
50
  Config: typeof Config;
50
51
  };
51
52
  static api: {
53
+ Ads: typeof Ads;
52
54
  Auth: typeof Auth;
53
55
  Campaigns: typeof Campaigns;
54
56
  Competitions: typeof Competitions;