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/cjs/index.js
CHANGED
|
@@ -20133,6 +20133,58 @@ var AdsRoute = /** @class */ (function () {
|
|
|
20133
20133
|
url: "/ads/reports/time-performance",
|
|
20134
20134
|
method: HTTP_METHODS.GET,
|
|
20135
20135
|
},
|
|
20136
|
+
getGoogleGeoSuggestions: {
|
|
20137
|
+
url: "/ads/google/targeting/geo/suggest",
|
|
20138
|
+
method: HTTP_METHODS.GET,
|
|
20139
|
+
},
|
|
20140
|
+
addGoogleLocationTargets: {
|
|
20141
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
20142
|
+
method: HTTP_METHODS.POST,
|
|
20143
|
+
},
|
|
20144
|
+
getGoogleLocationTargets: {
|
|
20145
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
20146
|
+
method: HTTP_METHODS.GET,
|
|
20147
|
+
},
|
|
20148
|
+
removeGoogleLocationTargets: {
|
|
20149
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
|
|
20150
|
+
method: HTTP_METHODS.DELETE,
|
|
20151
|
+
},
|
|
20152
|
+
addGoogleProximityTarget: {
|
|
20153
|
+
url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity",
|
|
20154
|
+
method: HTTP_METHODS.POST,
|
|
20155
|
+
},
|
|
20156
|
+
updateGoogleTargetingSettings: {
|
|
20157
|
+
url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
|
|
20158
|
+
method: HTTP_METHODS.PUT,
|
|
20159
|
+
},
|
|
20160
|
+
getGoogleTargetingSettings: {
|
|
20161
|
+
url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
|
|
20162
|
+
method: HTTP_METHODS.GET,
|
|
20163
|
+
},
|
|
20164
|
+
getGoogleAdPosts: {
|
|
20165
|
+
url: "/ads/posts/google",
|
|
20166
|
+
method: HTTP_METHODS.GET,
|
|
20167
|
+
},
|
|
20168
|
+
createGoogleAdPost: {
|
|
20169
|
+
url: "/ads/posts/google",
|
|
20170
|
+
method: HTTP_METHODS.POST,
|
|
20171
|
+
},
|
|
20172
|
+
updateGoogleAdPost: {
|
|
20173
|
+
url: "/ads/posts/google/{post_id}",
|
|
20174
|
+
method: HTTP_METHODS.PUT,
|
|
20175
|
+
},
|
|
20176
|
+
deleteGoogleAdPost: {
|
|
20177
|
+
url: "/ads/posts/google/{post_id}",
|
|
20178
|
+
method: HTTP_METHODS.DELETE,
|
|
20179
|
+
},
|
|
20180
|
+
pauseGoogleAdPost: {
|
|
20181
|
+
url: "/ads/posts/google/{post_id}/pause",
|
|
20182
|
+
method: HTTP_METHODS.POST,
|
|
20183
|
+
},
|
|
20184
|
+
enableGoogleAdPost: {
|
|
20185
|
+
url: "/ads/posts/google/{post_id}/enable",
|
|
20186
|
+
method: HTTP_METHODS.POST,
|
|
20187
|
+
},
|
|
20136
20188
|
};
|
|
20137
20189
|
return AdsRoute;
|
|
20138
20190
|
}());
|
|
@@ -20732,6 +20784,72 @@ var Ads = /** @class */ (function () {
|
|
|
20732
20784
|
Ads.getTimePerformanceReport = function (params) {
|
|
20733
20785
|
return Requests.processRoute(AdsRoute.routes.getTimePerformanceReport, undefined, undefined, params);
|
|
20734
20786
|
};
|
|
20787
|
+
/**
|
|
20788
|
+
* GET /ads/google/targeting/geo/suggest
|
|
20789
|
+
*/
|
|
20790
|
+
Ads.listGoogleGeoSuggestions = function (params) {
|
|
20791
|
+
return Requests.processRoute(AdsRoute.routes.getGoogleGeoSuggestions, undefined, undefined, params);
|
|
20792
|
+
};
|
|
20793
|
+
/**
|
|
20794
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
20795
|
+
*/
|
|
20796
|
+
Ads.addGoogleLocationTargets = function (customer_id, campaign_id, data) {
|
|
20797
|
+
return Requests.processRoute(AdsRoute.routes.addGoogleLocationTargets, data, { customer_id: customer_id, campaign_id: campaign_id });
|
|
20798
|
+
};
|
|
20799
|
+
/**
|
|
20800
|
+
* GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
20801
|
+
*/
|
|
20802
|
+
Ads.getGoogleLocationTargets = function (customer_id, campaign_id, params) {
|
|
20803
|
+
return Requests.processRoute(AdsRoute.routes.getGoogleLocationTargets, undefined, { customer_id: customer_id, campaign_id: campaign_id }, params);
|
|
20804
|
+
};
|
|
20805
|
+
/**
|
|
20806
|
+
* DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
|
|
20807
|
+
*/
|
|
20808
|
+
Ads.removeGoogleLocationTargets = function (customer_id, campaign_id, data) {
|
|
20809
|
+
return Requests.processRoute(AdsRoute.routes.removeGoogleLocationTargets, data, { customer_id: customer_id, campaign_id: campaign_id });
|
|
20810
|
+
};
|
|
20811
|
+
/**
|
|
20812
|
+
* POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
|
|
20813
|
+
*/
|
|
20814
|
+
Ads.addGoogleProximityTarget = function (customer_id, campaign_id, data) {
|
|
20815
|
+
return Requests.processRoute(AdsRoute.routes.addGoogleProximityTarget, data, { customer_id: customer_id, campaign_id: campaign_id });
|
|
20816
|
+
};
|
|
20817
|
+
/**
|
|
20818
|
+
* PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
20819
|
+
*/
|
|
20820
|
+
Ads.updateGoogleTargetingSettings = function (resource_type, customer_id, resource_id, data) {
|
|
20821
|
+
return Requests.processRoute(AdsRoute.routes.updateGoogleTargetingSettings, data, { resource_type: resource_type, customer_id: customer_id, resource_id: resource_id });
|
|
20822
|
+
};
|
|
20823
|
+
/**
|
|
20824
|
+
* GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
|
|
20825
|
+
*/
|
|
20826
|
+
Ads.getGoogleTargetingSettings = function (resource_type, customer_id, resource_id, params) {
|
|
20827
|
+
return Requests.processRoute(AdsRoute.routes.getGoogleTargetingSettings, undefined, { resource_type: resource_type, customer_id: customer_id, resource_id: resource_id }, params);
|
|
20828
|
+
};
|
|
20829
|
+
/** GET /ads/posts/google */
|
|
20830
|
+
Ads.listGoogleAdPosts = function (params) {
|
|
20831
|
+
return Requests.processRoute(AdsRoute.routes.getGoogleAdPosts, undefined, undefined, params);
|
|
20832
|
+
};
|
|
20833
|
+
/** POST /ads/posts/google */
|
|
20834
|
+
Ads.createGoogleAdPost = function (data, params) {
|
|
20835
|
+
return Requests.processRoute(AdsRoute.routes.createGoogleAdPost, data, {}, params);
|
|
20836
|
+
};
|
|
20837
|
+
/** PUT /ads/posts/google/{post_id} */
|
|
20838
|
+
Ads.updateGoogleAdPost = function (post_id, data, params) {
|
|
20839
|
+
return Requests.processRoute(AdsRoute.routes.updateGoogleAdPost, data, { post_id: post_id }, params);
|
|
20840
|
+
};
|
|
20841
|
+
/** DELETE /ads/posts/google/{post_id} */
|
|
20842
|
+
Ads.deleteGoogleAdPost = function (post_id, params) {
|
|
20843
|
+
return Requests.processRoute(AdsRoute.routes.deleteGoogleAdPost, {}, { post_id: post_id }, params);
|
|
20844
|
+
};
|
|
20845
|
+
/** POST /ads/posts/google/{post_id}/pause */
|
|
20846
|
+
Ads.pauseGoogleAdPost = function (post_id, params) {
|
|
20847
|
+
return Requests.processRoute(AdsRoute.routes.pauseGoogleAdPost, {}, { post_id: post_id }, params);
|
|
20848
|
+
};
|
|
20849
|
+
/** POST /ads/posts/google/{post_id}/enable */
|
|
20850
|
+
Ads.enableGoogleAdPost = function (post_id, params) {
|
|
20851
|
+
return Requests.processRoute(AdsRoute.routes.enableGoogleAdPost, {}, { post_id: post_id }, params);
|
|
20852
|
+
};
|
|
20735
20853
|
return Ads;
|
|
20736
20854
|
}());
|
|
20737
20855
|
|
|
@@ -24055,6 +24173,22 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
24055
24173
|
url: "/titles/{title_id}/utm/analysis",
|
|
24056
24174
|
method: HTTP_METHODS.GET,
|
|
24057
24175
|
},
|
|
24176
|
+
chatListSessions: {
|
|
24177
|
+
url: '/titles/{title_id}/chat/sessions',
|
|
24178
|
+
method: HTTP_METHODS.GET
|
|
24179
|
+
},
|
|
24180
|
+
chatShowSession: {
|
|
24181
|
+
url: '/titles/{title_id}/chat/sessions/{session_id}',
|
|
24182
|
+
method: HTTP_METHODS.GET
|
|
24183
|
+
},
|
|
24184
|
+
chatListMessages: {
|
|
24185
|
+
url: '/titles/{title_id}/chat/messages',
|
|
24186
|
+
method: HTTP_METHODS.GET
|
|
24187
|
+
},
|
|
24188
|
+
chatUpdateMessage: {
|
|
24189
|
+
url: '/titles/{title_id}/chat/messages/{message_id}',
|
|
24190
|
+
method: HTTP_METHODS.PUT
|
|
24191
|
+
},
|
|
24058
24192
|
};
|
|
24059
24193
|
return TitlesRoute;
|
|
24060
24194
|
}());
|
|
@@ -24410,6 +24544,30 @@ var Titles = /** @class */ (function () {
|
|
|
24410
24544
|
Titles.analyzeUtmAnalytics = function (title_id, params) {
|
|
24411
24545
|
return Requests.processRoute(TitlesRoute.routes.analyzeUtmAnalytics, {}, { title_id: title_id }, params);
|
|
24412
24546
|
};
|
|
24547
|
+
/**
|
|
24548
|
+
* List all chat sessions for a title.
|
|
24549
|
+
*/
|
|
24550
|
+
Titles.chatListSessions = function (title_id, params) {
|
|
24551
|
+
return Requests.processRoute(TitlesRoute.routes.chatListSessions, {}, { title_id: title_id }, params);
|
|
24552
|
+
};
|
|
24553
|
+
/**
|
|
24554
|
+
* Get a specific chat session and its messages.
|
|
24555
|
+
*/
|
|
24556
|
+
Titles.chatShowSession = function (title_id, session_id, params) {
|
|
24557
|
+
return Requests.processRoute(TitlesRoute.routes.chatShowSession, {}, { title_id: title_id, session_id: session_id }, params);
|
|
24558
|
+
};
|
|
24559
|
+
/**
|
|
24560
|
+
* Search messages across all sessions of a title.
|
|
24561
|
+
*/
|
|
24562
|
+
Titles.chatListMessages = function (title_id, params) {
|
|
24563
|
+
return Requests.processRoute(TitlesRoute.routes.chatListMessages, {}, { title_id: title_id }, params);
|
|
24564
|
+
};
|
|
24565
|
+
/**
|
|
24566
|
+
* Update a specific chat message.
|
|
24567
|
+
*/
|
|
24568
|
+
Titles.chatUpdateMessage = function (title_id, message_id, data) {
|
|
24569
|
+
return Requests.processRoute(TitlesRoute.routes.chatUpdateMessage, data, { title_id: title_id, message_id: message_id });
|
|
24570
|
+
};
|
|
24413
24571
|
return Titles;
|
|
24414
24572
|
}());
|
|
24415
24573
|
|
|
@@ -27215,6 +27373,88 @@ var WebsiteAnalytics = /** @class */ (function () {
|
|
|
27215
27373
|
return WebsiteAnalytics;
|
|
27216
27374
|
}());
|
|
27217
27375
|
|
|
27376
|
+
var ShortLinksRoute = /** @class */ (function () {
|
|
27377
|
+
function ShortLinksRoute() {
|
|
27378
|
+
}
|
|
27379
|
+
ShortLinksRoute.routes = {
|
|
27380
|
+
listShortLinks: { url: '/shortlinks', method: HTTP_METHODS.GET },
|
|
27381
|
+
createShortLink: { url: '/shortlinks', method: HTTP_METHODS.POST },
|
|
27382
|
+
viewShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.GET },
|
|
27383
|
+
updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
|
|
27384
|
+
// Delete can be added if supported
|
|
27385
|
+
// deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
|
|
27386
|
+
};
|
|
27387
|
+
return ShortLinksRoute;
|
|
27388
|
+
}());
|
|
27389
|
+
|
|
27390
|
+
var ShortLinks = /** @class */ (function () {
|
|
27391
|
+
function ShortLinks() {
|
|
27392
|
+
}
|
|
27393
|
+
/**
|
|
27394
|
+
* List all short links with optional filters
|
|
27395
|
+
*/
|
|
27396
|
+
ShortLinks.list = function (params) {
|
|
27397
|
+
return Requests.processRoute(ShortLinksRoute.routes.listShortLinks, undefined, undefined, params);
|
|
27398
|
+
};
|
|
27399
|
+
/**
|
|
27400
|
+
* Create a new short link
|
|
27401
|
+
*/
|
|
27402
|
+
ShortLinks.create = function (data, params) {
|
|
27403
|
+
return Requests.processRoute(ShortLinksRoute.routes.createShortLink, data, {}, params);
|
|
27404
|
+
};
|
|
27405
|
+
/**
|
|
27406
|
+
* Get a specific short link by ID
|
|
27407
|
+
*/
|
|
27408
|
+
ShortLinks.view = function (id, params) {
|
|
27409
|
+
return Requests.processRoute(ShortLinksRoute.routes.viewShortLink, {}, { id: id }, params);
|
|
27410
|
+
};
|
|
27411
|
+
/**
|
|
27412
|
+
* Update a short link
|
|
27413
|
+
*/
|
|
27414
|
+
ShortLinks.update = function (id, data, params) {
|
|
27415
|
+
return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id: id }, params);
|
|
27416
|
+
};
|
|
27417
|
+
return ShortLinks;
|
|
27418
|
+
}());
|
|
27419
|
+
|
|
27420
|
+
var AIUsageRoute = /** @class */ (function () {
|
|
27421
|
+
function AIUsageRoute() {
|
|
27422
|
+
}
|
|
27423
|
+
AIUsageRoute.routes = {
|
|
27424
|
+
listUsage: { url: '/billing/ai-usage', method: HTTP_METHODS.GET },
|
|
27425
|
+
summaryUsage: { url: '/billing/ai-usage/summary', method: HTTP_METHODS.GET }
|
|
27426
|
+
};
|
|
27427
|
+
return AIUsageRoute;
|
|
27428
|
+
}());
|
|
27429
|
+
|
|
27430
|
+
var AIUsage = /** @class */ (function () {
|
|
27431
|
+
function AIUsage() {
|
|
27432
|
+
}
|
|
27433
|
+
/**
|
|
27434
|
+
* List all AI usage entries with optional filters (date range, service, model, etc.).
|
|
27435
|
+
*
|
|
27436
|
+
* @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsage
|
|
27437
|
+
*
|
|
27438
|
+
* @param params Query parameters for filtering and grouping
|
|
27439
|
+
* @returns AxiosPromise
|
|
27440
|
+
*/
|
|
27441
|
+
AIUsage.list = function (params) {
|
|
27442
|
+
return Requests.processRoute(AIUsageRoute.routes.listUsage, undefined, undefined, params);
|
|
27443
|
+
};
|
|
27444
|
+
/**
|
|
27445
|
+
* Get summarized AI usage statistics (token totals, cost, grouped by service/model).
|
|
27446
|
+
*
|
|
27447
|
+
* @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsageSummary
|
|
27448
|
+
*
|
|
27449
|
+
* @param params Query parameters for filtering by date range
|
|
27450
|
+
* @returns AxiosPromise
|
|
27451
|
+
*/
|
|
27452
|
+
AIUsage.summary = function (params) {
|
|
27453
|
+
return Requests.processRoute(AIUsageRoute.routes.summaryUsage, undefined, undefined, params);
|
|
27454
|
+
};
|
|
27455
|
+
return AIUsage;
|
|
27456
|
+
}());
|
|
27457
|
+
|
|
27218
27458
|
var Parser = /** @class */ (function () {
|
|
27219
27459
|
function Parser() {
|
|
27220
27460
|
}
|
|
@@ -27737,7 +27977,9 @@ var Glitch = /** @class */ (function () {
|
|
|
27737
27977
|
Funnel: Funnel,
|
|
27738
27978
|
SocialStats: SocialStats,
|
|
27739
27979
|
WebsiteAnalytics: WebsiteAnalytics,
|
|
27740
|
-
Fingerprinting: Fingerprinting
|
|
27980
|
+
Fingerprinting: Fingerprinting,
|
|
27981
|
+
ShortLinks: ShortLinks,
|
|
27982
|
+
AIUsage: AIUsage
|
|
27741
27983
|
};
|
|
27742
27984
|
Glitch.util = {
|
|
27743
27985
|
Requests: Requests,
|