glitch-javascript-sdk 1.9.5 → 1.9.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 +243 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/AIUsage.d.ts +23 -0
- package/dist/esm/api/Ads.d.ts +40 -0
- package/dist/esm/api/ShortLinks.d.ts +21 -0
- package/dist/esm/api/Titles.d.ts +16 -0
- package/dist/esm/api/index.d.ts +4 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +243 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/AIUsageRoute.d.ts +7 -0
- package/dist/esm/routes/ShortLinksRoute.d.ts +7 -0
- package/dist/index.d.ts +98 -0
- package/package.json +1 -1
- package/src/api/AIUsage.ts +32 -0
- package/src/api/Ads.ts +183 -0
- package/src/api/ShortLinks.ts +41 -0
- package/src/api/Titles.ts +71 -9
- package/src/api/index.ts +5 -1
- package/src/index.ts +5 -1
- package/src/routes/AIUsageRoute.ts +11 -0
- package/src/routes/AdsRoute.ts +60 -1
- package/src/routes/ShortLinksRoute.ts +15 -0
- package/src/routes/TitlesRoute.ts +17 -0
package/dist/index.d.ts
CHANGED
|
@@ -1059,6 +1059,46 @@ declare class Ads {
|
|
|
1059
1059
|
community_id?: string;
|
|
1060
1060
|
platform?: string;
|
|
1061
1061
|
}): AxiosPromise<Response<T>>;
|
|
1062
|
+
/**
|
|
1063
|
+
* GET /ads/google/targeting/geo/suggest
|
|
1064
|
+
*/
|
|
1065
|
+
static listGoogleGeoSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1066
|
+
/**
|
|
1067
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1068
|
+
*/
|
|
1069
|
+
static addGoogleLocationTargets<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1070
|
+
/**
|
|
1071
|
+
* GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1072
|
+
*/
|
|
1073
|
+
static getGoogleLocationTargets<T>(customer_id: number, campaign_id: number, params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1074
|
+
/**
|
|
1075
|
+
* DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1076
|
+
*/
|
|
1077
|
+
static removeGoogleLocationTargets<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1078
|
+
/**
|
|
1079
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
|
|
1080
|
+
*/
|
|
1081
|
+
static addGoogleProximityTarget<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1082
|
+
/**
|
|
1083
|
+
* PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1084
|
+
*/
|
|
1085
|
+
static updateGoogleTargetingSettings<T>(resource_type: 'campaign' | 'ad_group', customer_id: number, resource_id: number, data: object): AxiosPromise<Response<T>>;
|
|
1086
|
+
/**
|
|
1087
|
+
* GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1088
|
+
*/
|
|
1089
|
+
static getGoogleTargetingSettings<T>(resource_type: 'campaign' | 'ad_group', customer_id: number, resource_id: number, params: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1090
|
+
/** GET /ads/posts/google */
|
|
1091
|
+
static listGoogleAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1092
|
+
/** POST /ads/posts/google */
|
|
1093
|
+
static createGoogleAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1094
|
+
/** PUT /ads/posts/google/{post_id} */
|
|
1095
|
+
static updateGoogleAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1096
|
+
/** DELETE /ads/posts/google/{post_id} */
|
|
1097
|
+
static deleteGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1098
|
+
/** POST /ads/posts/google/{post_id}/pause */
|
|
1099
|
+
static pauseGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1100
|
+
/** POST /ads/posts/google/{post_id}/enable */
|
|
1101
|
+
static enableGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1062
1102
|
}
|
|
1063
1103
|
|
|
1064
1104
|
declare class Communities {
|
|
@@ -3609,6 +3649,22 @@ declare class Titles {
|
|
|
3609
3649
|
* @returns AxiosPromise
|
|
3610
3650
|
*/
|
|
3611
3651
|
static analyzeUtmAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3652
|
+
/**
|
|
3653
|
+
* List all chat sessions for a title.
|
|
3654
|
+
*/
|
|
3655
|
+
static chatListSessions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3656
|
+
/**
|
|
3657
|
+
* Get a specific chat session and its messages.
|
|
3658
|
+
*/
|
|
3659
|
+
static chatShowSession<T>(title_id: string, session_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3660
|
+
/**
|
|
3661
|
+
* Search messages across all sessions of a title.
|
|
3662
|
+
*/
|
|
3663
|
+
static chatListMessages<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
3664
|
+
/**
|
|
3665
|
+
* Update a specific chat message.
|
|
3666
|
+
*/
|
|
3667
|
+
static chatUpdateMessage<T>(title_id: string, message_id: string, data: object): AxiosPromise<Response<T>>;
|
|
3612
3668
|
}
|
|
3613
3669
|
|
|
3614
3670
|
declare class Campaigns {
|
|
@@ -5492,6 +5548,46 @@ declare class WebsiteAnalytics {
|
|
|
5492
5548
|
static utmPerformance<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5493
5549
|
}
|
|
5494
5550
|
|
|
5551
|
+
declare class ShortLinks {
|
|
5552
|
+
/**
|
|
5553
|
+
* List all short links with optional filters
|
|
5554
|
+
*/
|
|
5555
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5556
|
+
/**
|
|
5557
|
+
* Create a new short link
|
|
5558
|
+
*/
|
|
5559
|
+
static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5560
|
+
/**
|
|
5561
|
+
* Get a specific short link by ID
|
|
5562
|
+
*/
|
|
5563
|
+
static view<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5564
|
+
/**
|
|
5565
|
+
* Update a short link
|
|
5566
|
+
*/
|
|
5567
|
+
static update<T>(id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5568
|
+
}
|
|
5569
|
+
|
|
5570
|
+
declare class AIUsage {
|
|
5571
|
+
/**
|
|
5572
|
+
* List all AI usage entries with optional filters (date range, service, model, etc.).
|
|
5573
|
+
*
|
|
5574
|
+
* @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsage
|
|
5575
|
+
*
|
|
5576
|
+
* @param params Query parameters for filtering and grouping
|
|
5577
|
+
* @returns AxiosPromise
|
|
5578
|
+
*/
|
|
5579
|
+
static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5580
|
+
/**
|
|
5581
|
+
* Get summarized AI usage statistics (token totals, cost, grouped by service/model).
|
|
5582
|
+
*
|
|
5583
|
+
* @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsageSummary
|
|
5584
|
+
*
|
|
5585
|
+
* @param params Query parameters for filtering by date range
|
|
5586
|
+
* @returns AxiosPromise
|
|
5587
|
+
*/
|
|
5588
|
+
static summary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
5589
|
+
}
|
|
5590
|
+
|
|
5495
5591
|
interface Route {
|
|
5496
5592
|
url: string;
|
|
5497
5593
|
method: string;
|
|
@@ -5834,6 +5930,8 @@ declare class Glitch {
|
|
|
5834
5930
|
SocialStats: typeof SocialStats;
|
|
5835
5931
|
WebsiteAnalytics: typeof WebsiteAnalytics;
|
|
5836
5932
|
Fingerprinting: typeof Fingerprinting;
|
|
5933
|
+
ShortLinks: typeof ShortLinks;
|
|
5934
|
+
AIUsage: typeof AIUsage;
|
|
5837
5935
|
};
|
|
5838
5936
|
static util: {
|
|
5839
5937
|
Requests: typeof Requests;
|
package/package.json
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import AIUsageRoute from "../routes/AIUsageRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class AIUsage {
|
|
7
|
+
/**
|
|
8
|
+
* List all AI usage entries with optional filters (date range, service, model, etc.).
|
|
9
|
+
*
|
|
10
|
+
* @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsage
|
|
11
|
+
*
|
|
12
|
+
* @param params Query parameters for filtering and grouping
|
|
13
|
+
* @returns AxiosPromise
|
|
14
|
+
*/
|
|
15
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
16
|
+
return Requests.processRoute(AIUsageRoute.routes.listUsage, undefined, undefined, params);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Get summarized AI usage statistics (token totals, cost, grouped by service/model).
|
|
21
|
+
*
|
|
22
|
+
* @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsageSummary
|
|
23
|
+
*
|
|
24
|
+
* @param params Query parameters for filtering by date range
|
|
25
|
+
* @returns AxiosPromise
|
|
26
|
+
*/
|
|
27
|
+
public static summary<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
28
|
+
return Requests.processRoute(AIUsageRoute.routes.summaryUsage, undefined, undefined, params);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default AIUsage;
|
package/src/api/Ads.ts
CHANGED
|
@@ -1090,6 +1090,189 @@ class Ads {
|
|
|
1090
1090
|
return Requests.processRoute(AdsRoute.routes.getTimePerformanceReport, undefined, undefined, params);
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
|
+
/**
|
|
1094
|
+
* GET /ads/google/targeting/geo/suggest
|
|
1095
|
+
*/
|
|
1096
|
+
public static listGoogleGeoSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>> {
|
|
1097
|
+
return Requests.processRoute(
|
|
1098
|
+
AdsRoute.routes.getGoogleGeoSuggestions,
|
|
1099
|
+
undefined,
|
|
1100
|
+
undefined,
|
|
1101
|
+
params
|
|
1102
|
+
);
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
/**
|
|
1106
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1107
|
+
*/
|
|
1108
|
+
public static addGoogleLocationTargets<T>(
|
|
1109
|
+
customer_id: number,
|
|
1110
|
+
campaign_id: number,
|
|
1111
|
+
data: object
|
|
1112
|
+
): AxiosPromise<Response<T>> {
|
|
1113
|
+
return Requests.processRoute(
|
|
1114
|
+
AdsRoute.routes.addGoogleLocationTargets,
|
|
1115
|
+
data,
|
|
1116
|
+
{ customer_id, campaign_id }
|
|
1117
|
+
);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
/**
|
|
1121
|
+
* GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1122
|
+
*/
|
|
1123
|
+
public static getGoogleLocationTargets<T>(
|
|
1124
|
+
customer_id: number,
|
|
1125
|
+
campaign_id: number,
|
|
1126
|
+
params: Record<string, any>
|
|
1127
|
+
): AxiosPromise<Response<T>> {
|
|
1128
|
+
return Requests.processRoute(
|
|
1129
|
+
AdsRoute.routes.getGoogleLocationTargets,
|
|
1130
|
+
undefined,
|
|
1131
|
+
{ customer_id, campaign_id },
|
|
1132
|
+
params
|
|
1133
|
+
);
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/**
|
|
1137
|
+
* DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
1138
|
+
*/
|
|
1139
|
+
public static removeGoogleLocationTargets<T>(
|
|
1140
|
+
customer_id: number,
|
|
1141
|
+
campaign_id: number,
|
|
1142
|
+
data: object
|
|
1143
|
+
): AxiosPromise<Response<T>> {
|
|
1144
|
+
return Requests.processRoute(
|
|
1145
|
+
AdsRoute.routes.removeGoogleLocationTargets,
|
|
1146
|
+
data,
|
|
1147
|
+
{ customer_id, campaign_id }
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
|
|
1153
|
+
*/
|
|
1154
|
+
public static addGoogleProximityTarget<T>(
|
|
1155
|
+
customer_id: number,
|
|
1156
|
+
campaign_id: number,
|
|
1157
|
+
data: object
|
|
1158
|
+
): AxiosPromise<Response<T>> {
|
|
1159
|
+
return Requests.processRoute(
|
|
1160
|
+
AdsRoute.routes.addGoogleProximityTarget,
|
|
1161
|
+
data,
|
|
1162
|
+
{ customer_id, campaign_id }
|
|
1163
|
+
);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
/**
|
|
1167
|
+
* PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1168
|
+
*/
|
|
1169
|
+
public static updateGoogleTargetingSettings<T>(
|
|
1170
|
+
resource_type: 'campaign' | 'ad_group',
|
|
1171
|
+
customer_id: number,
|
|
1172
|
+
resource_id: number,
|
|
1173
|
+
data: object
|
|
1174
|
+
): AxiosPromise<Response<T>> {
|
|
1175
|
+
return Requests.processRoute(
|
|
1176
|
+
AdsRoute.routes.updateGoogleTargetingSettings,
|
|
1177
|
+
data,
|
|
1178
|
+
{ resource_type, customer_id, resource_id }
|
|
1179
|
+
);
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
1184
|
+
*/
|
|
1185
|
+
public static getGoogleTargetingSettings<T>(
|
|
1186
|
+
resource_type: 'campaign' | 'ad_group',
|
|
1187
|
+
customer_id: number,
|
|
1188
|
+
resource_id: number,
|
|
1189
|
+
params: Record<string, any>
|
|
1190
|
+
): AxiosPromise<Response<T>> {
|
|
1191
|
+
return Requests.processRoute(
|
|
1192
|
+
AdsRoute.routes.getGoogleTargetingSettings,
|
|
1193
|
+
undefined,
|
|
1194
|
+
{ resource_type, customer_id, resource_id },
|
|
1195
|
+
params
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/** GET /ads/posts/google */
|
|
1200
|
+
public static listGoogleAdPosts<T>(
|
|
1201
|
+
params?: Record<string, any>
|
|
1202
|
+
): AxiosPromise<Response<T>> {
|
|
1203
|
+
return Requests.processRoute(
|
|
1204
|
+
AdsRoute.routes.getGoogleAdPosts,
|
|
1205
|
+
undefined,
|
|
1206
|
+
undefined,
|
|
1207
|
+
params
|
|
1208
|
+
);
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
/** POST /ads/posts/google */
|
|
1212
|
+
public static createGoogleAdPost<T>(
|
|
1213
|
+
data?: object,
|
|
1214
|
+
params?: Record<string, any>
|
|
1215
|
+
): AxiosPromise<Response<T>> {
|
|
1216
|
+
return Requests.processRoute(
|
|
1217
|
+
AdsRoute.routes.createGoogleAdPost,
|
|
1218
|
+
data,
|
|
1219
|
+
{},
|
|
1220
|
+
params
|
|
1221
|
+
);
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
/** PUT /ads/posts/google/{post_id} */
|
|
1225
|
+
public static updateGoogleAdPost<T>(
|
|
1226
|
+
post_id: string,
|
|
1227
|
+
data?: object,
|
|
1228
|
+
params?: Record<string, any>
|
|
1229
|
+
): AxiosPromise<Response<T>> {
|
|
1230
|
+
return Requests.processRoute(
|
|
1231
|
+
AdsRoute.routes.updateGoogleAdPost,
|
|
1232
|
+
data,
|
|
1233
|
+
{ post_id },
|
|
1234
|
+
params
|
|
1235
|
+
);
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/** DELETE /ads/posts/google/{post_id} */
|
|
1239
|
+
public static deleteGoogleAdPost<T>(
|
|
1240
|
+
post_id: string,
|
|
1241
|
+
params?: Record<string, any>
|
|
1242
|
+
): AxiosPromise<Response<T>> {
|
|
1243
|
+
return Requests.processRoute(
|
|
1244
|
+
AdsRoute.routes.deleteGoogleAdPost,
|
|
1245
|
+
{},
|
|
1246
|
+
{ post_id },
|
|
1247
|
+
params
|
|
1248
|
+
);
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
/** POST /ads/posts/google/{post_id}/pause */
|
|
1252
|
+
public static pauseGoogleAdPost<T>(
|
|
1253
|
+
post_id: string,
|
|
1254
|
+
params?: Record<string, any>
|
|
1255
|
+
): AxiosPromise<Response<T>> {
|
|
1256
|
+
return Requests.processRoute(
|
|
1257
|
+
AdsRoute.routes.pauseGoogleAdPost,
|
|
1258
|
+
{},
|
|
1259
|
+
{ post_id },
|
|
1260
|
+
params
|
|
1261
|
+
);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/** POST /ads/posts/google/{post_id}/enable */
|
|
1265
|
+
public static enableGoogleAdPost<T>(
|
|
1266
|
+
post_id: string,
|
|
1267
|
+
params?: Record<string, any>
|
|
1268
|
+
): AxiosPromise<Response<T>> {
|
|
1269
|
+
return Requests.processRoute(
|
|
1270
|
+
AdsRoute.routes.enableGoogleAdPost,
|
|
1271
|
+
{},
|
|
1272
|
+
{ post_id },
|
|
1273
|
+
params
|
|
1274
|
+
);
|
|
1275
|
+
}
|
|
1093
1276
|
|
|
1094
1277
|
|
|
1095
1278
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import ShortLinksRoute from "../routes/ShortLinksRoute";
|
|
2
|
+
import Requests from "../util/Requests";
|
|
3
|
+
import Response from "../util/Response";
|
|
4
|
+
import { AxiosPromise } from "axios";
|
|
5
|
+
|
|
6
|
+
class ShortLinks {
|
|
7
|
+
/**
|
|
8
|
+
* List all short links with optional filters
|
|
9
|
+
*/
|
|
10
|
+
public static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
11
|
+
return Requests.processRoute(ShortLinksRoute.routes.listShortLinks, undefined, undefined, params);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create a new short link
|
|
16
|
+
*/
|
|
17
|
+
public static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
18
|
+
return Requests.processRoute(ShortLinksRoute.routes.createShortLink, data, {}, params);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Get a specific short link by ID
|
|
23
|
+
*/
|
|
24
|
+
public static view<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
25
|
+
return Requests.processRoute(ShortLinksRoute.routes.viewShortLink, {}, { id }, params);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Update a short link
|
|
30
|
+
*/
|
|
31
|
+
public static update<T>(id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
32
|
+
return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id }, params);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Uncomment when delete is supported
|
|
36
|
+
// public static delete<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
|
|
37
|
+
// return Requests.processRoute(ShortLinksRoute.routes.deleteShortLink, {}, { id }, params);
|
|
38
|
+
// }
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default ShortLinks;
|
package/src/api/Titles.ts
CHANGED
|
@@ -409,15 +409,15 @@ class Titles {
|
|
|
409
409
|
);
|
|
410
410
|
}
|
|
411
411
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
412
|
+
/**
|
|
413
|
+
* Upload a CSV/Excel file containing daily UTM analytics for a specific title.
|
|
414
|
+
*
|
|
415
|
+
* @param title_id The UUID of the title
|
|
416
|
+
* @param file The CSV or Excel file
|
|
417
|
+
* @param data Optional form fields (if needed)
|
|
418
|
+
* @param params Optional query parameters
|
|
419
|
+
* @returns AxiosPromise
|
|
420
|
+
*/
|
|
421
421
|
public static importUtmAnalytics<T>(
|
|
422
422
|
title_id: string,
|
|
423
423
|
file: File | Blob,
|
|
@@ -491,6 +491,68 @@ class Titles {
|
|
|
491
491
|
);
|
|
492
492
|
}
|
|
493
493
|
|
|
494
|
+
/**
|
|
495
|
+
* List all chat sessions for a title.
|
|
496
|
+
*/
|
|
497
|
+
public static chatListSessions<T>(
|
|
498
|
+
title_id: string,
|
|
499
|
+
params?: Record<string, any>
|
|
500
|
+
): AxiosPromise<Response<T>> {
|
|
501
|
+
return Requests.processRoute(
|
|
502
|
+
TitlesRoute.routes.chatListSessions,
|
|
503
|
+
{},
|
|
504
|
+
{ title_id },
|
|
505
|
+
params
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Get a specific chat session and its messages.
|
|
511
|
+
*/
|
|
512
|
+
public static chatShowSession<T>(
|
|
513
|
+
title_id: string,
|
|
514
|
+
session_id: string,
|
|
515
|
+
params?: Record<string, any>
|
|
516
|
+
): AxiosPromise<Response<T>> {
|
|
517
|
+
return Requests.processRoute(
|
|
518
|
+
TitlesRoute.routes.chatShowSession,
|
|
519
|
+
{},
|
|
520
|
+
{ title_id, session_id },
|
|
521
|
+
params
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Search messages across all sessions of a title.
|
|
527
|
+
*/
|
|
528
|
+
public static chatListMessages<T>(
|
|
529
|
+
title_id: string,
|
|
530
|
+
params?: Record<string, any>
|
|
531
|
+
): AxiosPromise<Response<T>> {
|
|
532
|
+
return Requests.processRoute(
|
|
533
|
+
TitlesRoute.routes.chatListMessages,
|
|
534
|
+
{},
|
|
535
|
+
{ title_id },
|
|
536
|
+
params
|
|
537
|
+
);
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Update a specific chat message.
|
|
542
|
+
*/
|
|
543
|
+
public static chatUpdateMessage<T>(
|
|
544
|
+
title_id: string,
|
|
545
|
+
message_id: string,
|
|
546
|
+
data: object
|
|
547
|
+
): AxiosPromise<Response<T>> {
|
|
548
|
+
return Requests.processRoute(
|
|
549
|
+
TitlesRoute.routes.chatUpdateMessage,
|
|
550
|
+
data,
|
|
551
|
+
{ title_id, message_id }
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
|
|
494
556
|
|
|
495
557
|
}
|
|
496
558
|
|
package/src/api/index.ts
CHANGED
|
@@ -33,6 +33,8 @@ import Funnel from "./Funnel";
|
|
|
33
33
|
import SocialStats from "./SocialStats";
|
|
34
34
|
import Hashtags from "./Hashtags";
|
|
35
35
|
import WebsiteAnalytics from "./WebsiteAnalytics";
|
|
36
|
+
import ShortLinks from "./ShortLinks";
|
|
37
|
+
import AIUsage from "./AIUsage";
|
|
36
38
|
|
|
37
39
|
export {Ads};
|
|
38
40
|
export {Auth};
|
|
@@ -68,4 +70,6 @@ export {Funnel};
|
|
|
68
70
|
export {SocialStats};
|
|
69
71
|
export {Hashtags};
|
|
70
72
|
export {WebsiteAnalytics};
|
|
71
|
-
export {Fingerprinting};
|
|
73
|
+
export {Fingerprinting};
|
|
74
|
+
export {ShortLinks};
|
|
75
|
+
export {AIUsage};
|
package/src/index.ts
CHANGED
|
@@ -37,6 +37,8 @@ import {SocialStats} from "./api";
|
|
|
37
37
|
import {Hashtags} from "./api";
|
|
38
38
|
import {WebsiteAnalytics} from "./api";
|
|
39
39
|
import {Fingerprinting} from "./api";
|
|
40
|
+
import {ShortLinks} from "./api";
|
|
41
|
+
import {AIUsage} from "./api";
|
|
40
42
|
|
|
41
43
|
import Requests from "./util/Requests";
|
|
42
44
|
import Parser from "./util/Parser";
|
|
@@ -102,7 +104,9 @@ class Glitch {
|
|
|
102
104
|
Funnel: Funnel,
|
|
103
105
|
SocialStats : SocialStats,
|
|
104
106
|
WebsiteAnalytics: WebsiteAnalytics,
|
|
105
|
-
Fingerprinting : Fingerprinting
|
|
107
|
+
Fingerprinting : Fingerprinting,
|
|
108
|
+
ShortLinks : ShortLinks,
|
|
109
|
+
AIUsage : AIUsage
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
public static util = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class AIUsageRoute {
|
|
5
|
+
public static routes: { [key: string]: Route } = {
|
|
6
|
+
listUsage: { url: '/billing/ai-usage', method: HTTP_METHODS.GET },
|
|
7
|
+
summaryUsage: { url: '/billing/ai-usage/summary', method: HTTP_METHODS.GET }
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default AIUsageRoute;
|
package/src/routes/AdsRoute.ts
CHANGED
|
@@ -401,7 +401,66 @@ class AdsRoute {
|
|
|
401
401
|
url: "/ads/reports/time-performance",
|
|
402
402
|
method: HTTP_METHODS.GET,
|
|
403
403
|
},
|
|
404
|
-
|
|
404
|
+
|
|
405
|
+
getGoogleGeoSuggestions: {
|
|
406
|
+
url: "/ads/google/targeting/geo/suggest",
|
|
407
|
+
method: HTTP_METHODS.GET,
|
|
408
|
+
},
|
|
409
|
+
|
|
410
|
+
addGoogleLocationTargets: {
|
|
411
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
412
|
+
method: HTTP_METHODS.POST,
|
|
413
|
+
},
|
|
414
|
+
|
|
415
|
+
getGoogleLocationTargets: {
|
|
416
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
417
|
+
method: HTTP_METHODS.GET,
|
|
418
|
+
},
|
|
419
|
+
|
|
420
|
+
removeGoogleLocationTargets: {
|
|
421
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
422
|
+
method: HTTP_METHODS.DELETE,
|
|
423
|
+
},
|
|
424
|
+
|
|
425
|
+
addGoogleProximityTarget: {
|
|
426
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity",
|
|
427
|
+
method: HTTP_METHODS.POST,
|
|
428
|
+
},
|
|
429
|
+
|
|
430
|
+
updateGoogleTargetingSettings: {
|
|
431
|
+
url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
|
|
432
|
+
method: HTTP_METHODS.PUT,
|
|
433
|
+
},
|
|
434
|
+
|
|
435
|
+
getGoogleTargetingSettings: {
|
|
436
|
+
url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
|
|
437
|
+
method: HTTP_METHODS.GET,
|
|
438
|
+
},
|
|
439
|
+
getGoogleAdPosts: {
|
|
440
|
+
url: "/ads/posts/google",
|
|
441
|
+
method: HTTP_METHODS.GET,
|
|
442
|
+
},
|
|
443
|
+
createGoogleAdPost: {
|
|
444
|
+
url: "/ads/posts/google",
|
|
445
|
+
method: HTTP_METHODS.POST,
|
|
446
|
+
},
|
|
447
|
+
updateGoogleAdPost: {
|
|
448
|
+
url: "/ads/posts/google/{post_id}",
|
|
449
|
+
method: HTTP_METHODS.PUT,
|
|
450
|
+
},
|
|
451
|
+
deleteGoogleAdPost: {
|
|
452
|
+
url: "/ads/posts/google/{post_id}",
|
|
453
|
+
method: HTTP_METHODS.DELETE,
|
|
454
|
+
},
|
|
455
|
+
pauseGoogleAdPost: {
|
|
456
|
+
url: "/ads/posts/google/{post_id}/pause",
|
|
457
|
+
method: HTTP_METHODS.POST,
|
|
458
|
+
},
|
|
459
|
+
enableGoogleAdPost: {
|
|
460
|
+
url: "/ads/posts/google/{post_id}/enable",
|
|
461
|
+
method: HTTP_METHODS.POST,
|
|
462
|
+
},
|
|
463
|
+
|
|
405
464
|
};
|
|
406
465
|
}
|
|
407
466
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Route from "./interface";
|
|
2
|
+
import HTTP_METHODS from "../constants/HttpMethods";
|
|
3
|
+
|
|
4
|
+
class ShortLinksRoute {
|
|
5
|
+
public static routes: { [key: string]: Route } = {
|
|
6
|
+
listShortLinks: { url: '/shortlinks', method: HTTP_METHODS.GET },
|
|
7
|
+
createShortLink: { url: '/shortlinks', method: HTTP_METHODS.POST },
|
|
8
|
+
viewShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.GET },
|
|
9
|
+
updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
|
|
10
|
+
// Delete can be added if supported
|
|
11
|
+
// deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default ShortLinksRoute;
|
|
@@ -76,6 +76,23 @@ class TitlesRoute {
|
|
|
76
76
|
method: HTTP_METHODS.GET,
|
|
77
77
|
},
|
|
78
78
|
|
|
79
|
+
chatListSessions: {
|
|
80
|
+
url: '/titles/{title_id}/chat/sessions',
|
|
81
|
+
method: HTTP_METHODS.GET
|
|
82
|
+
},
|
|
83
|
+
chatShowSession: {
|
|
84
|
+
url: '/titles/{title_id}/chat/sessions/{session_id}',
|
|
85
|
+
method: HTTP_METHODS.GET
|
|
86
|
+
},
|
|
87
|
+
chatListMessages: {
|
|
88
|
+
url: '/titles/{title_id}/chat/messages',
|
|
89
|
+
method: HTTP_METHODS.GET
|
|
90
|
+
},
|
|
91
|
+
chatUpdateMessage: {
|
|
92
|
+
url: '/titles/{title_id}/chat/messages/{message_id}',
|
|
93
|
+
method: HTTP_METHODS.PUT
|
|
94
|
+
},
|
|
95
|
+
|
|
79
96
|
};
|
|
80
97
|
|
|
81
98
|
}
|