glitch-javascript-sdk 1.9.5 → 1.9.6

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,23 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class AIUsage {
4
+ /**
5
+ * List all AI usage entries with optional filters (date range, service, model, etc.).
6
+ *
7
+ * @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsage
8
+ *
9
+ * @param params Query parameters for filtering and grouping
10
+ * @returns AxiosPromise
11
+ */
12
+ static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
13
+ /**
14
+ * Get summarized AI usage statistics (token totals, cost, grouped by service/model).
15
+ *
16
+ * @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsageSummary
17
+ *
18
+ * @param params Query parameters for filtering by date range
19
+ * @returns AxiosPromise
20
+ */
21
+ static summary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
22
+ }
23
+ export default AIUsage;
@@ -0,0 +1,21 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class ShortLinks {
4
+ /**
5
+ * List all short links with optional filters
6
+ */
7
+ static list<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
8
+ /**
9
+ * Create a new short link
10
+ */
11
+ static create<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
12
+ /**
13
+ * Get a specific short link by ID
14
+ */
15
+ static view<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
16
+ /**
17
+ * Update a short link
18
+ */
19
+ static update<T>(id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ }
21
+ export default ShortLinks;
@@ -273,5 +273,21 @@ declare class Titles {
273
273
  * @returns AxiosPromise
274
274
  */
275
275
  static analyzeUtmAnalytics<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
276
+ /**
277
+ * List all chat sessions for a title.
278
+ */
279
+ static chatListSessions<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
280
+ /**
281
+ * Get a specific chat session and its messages.
282
+ */
283
+ static chatShowSession<T>(title_id: string, session_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
284
+ /**
285
+ * Search messages across all sessions of a title.
286
+ */
287
+ static chatListMessages<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
288
+ /**
289
+ * Update a specific chat message.
290
+ */
291
+ static chatUpdateMessage<T>(title_id: string, message_id: string, data: object): AxiosPromise<Response<T>>;
276
292
  }
277
293
  export default Titles;
@@ -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
  export { Ads };
37
39
  export { Auth };
38
40
  export { Competitions };
@@ -68,3 +70,5 @@ export { SocialStats };
68
70
  export { Hashtags };
69
71
  export { WebsiteAnalytics };
70
72
  export { Fingerprinting };
73
+ export { ShortLinks };
74
+ export { AIUsage };
@@ -33,6 +33,8 @@ import { SocialStats } from "./api";
33
33
  import { Hashtags } from "./api";
34
34
  import { WebsiteAnalytics } from "./api";
35
35
  import { Fingerprinting } from "./api";
36
+ import { ShortLinks } from "./api";
37
+ import { AIUsage } from "./api";
36
38
  import Requests from "./util/Requests";
37
39
  import Parser from "./util/Parser";
38
40
  import Session from "./util/Session";
@@ -87,6 +89,8 @@ declare class Glitch {
87
89
  SocialStats: typeof SocialStats;
88
90
  WebsiteAnalytics: typeof WebsiteAnalytics;
89
91
  Fingerprinting: typeof Fingerprinting;
92
+ ShortLinks: typeof ShortLinks;
93
+ AIUsage: typeof AIUsage;
90
94
  };
91
95
  static util: {
92
96
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -10871,6 +10871,22 @@ var TitlesRoute = /** @class */ (function () {
10871
10871
  url: "/titles/{title_id}/utm/analysis",
10872
10872
  method: HTTP_METHODS.GET,
10873
10873
  },
10874
+ chatListSessions: {
10875
+ url: '/titles/{title_id}/chat/sessions',
10876
+ method: HTTP_METHODS.GET
10877
+ },
10878
+ chatShowSession: {
10879
+ url: '/titles/{title_id}/chat/sessions/{session_id}',
10880
+ method: HTTP_METHODS.GET
10881
+ },
10882
+ chatListMessages: {
10883
+ url: '/titles/{title_id}/chat/messages',
10884
+ method: HTTP_METHODS.GET
10885
+ },
10886
+ chatUpdateMessage: {
10887
+ url: '/titles/{title_id}/chat/messages/{message_id}',
10888
+ method: HTTP_METHODS.PUT
10889
+ },
10874
10890
  };
10875
10891
  return TitlesRoute;
10876
10892
  }());
@@ -11226,6 +11242,30 @@ var Titles = /** @class */ (function () {
11226
11242
  Titles.analyzeUtmAnalytics = function (title_id, params) {
11227
11243
  return Requests.processRoute(TitlesRoute.routes.analyzeUtmAnalytics, {}, { title_id: title_id }, params);
11228
11244
  };
11245
+ /**
11246
+ * List all chat sessions for a title.
11247
+ */
11248
+ Titles.chatListSessions = function (title_id, params) {
11249
+ return Requests.processRoute(TitlesRoute.routes.chatListSessions, {}, { title_id: title_id }, params);
11250
+ };
11251
+ /**
11252
+ * Get a specific chat session and its messages.
11253
+ */
11254
+ Titles.chatShowSession = function (title_id, session_id, params) {
11255
+ return Requests.processRoute(TitlesRoute.routes.chatShowSession, {}, { title_id: title_id, session_id: session_id }, params);
11256
+ };
11257
+ /**
11258
+ * Search messages across all sessions of a title.
11259
+ */
11260
+ Titles.chatListMessages = function (title_id, params) {
11261
+ return Requests.processRoute(TitlesRoute.routes.chatListMessages, {}, { title_id: title_id }, params);
11262
+ };
11263
+ /**
11264
+ * Update a specific chat message.
11265
+ */
11266
+ Titles.chatUpdateMessage = function (title_id, message_id, data) {
11267
+ return Requests.processRoute(TitlesRoute.routes.chatUpdateMessage, data, { title_id: title_id, message_id: message_id });
11268
+ };
11229
11269
  return Titles;
11230
11270
  }());
11231
11271
 
@@ -14031,6 +14071,88 @@ var WebsiteAnalytics = /** @class */ (function () {
14031
14071
  return WebsiteAnalytics;
14032
14072
  }());
14033
14073
 
14074
+ var ShortLinksRoute = /** @class */ (function () {
14075
+ function ShortLinksRoute() {
14076
+ }
14077
+ ShortLinksRoute.routes = {
14078
+ listShortLinks: { url: '/shortlinks', method: HTTP_METHODS.GET },
14079
+ createShortLink: { url: '/shortlinks', method: HTTP_METHODS.POST },
14080
+ viewShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.GET },
14081
+ updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
14082
+ // Delete can be added if supported
14083
+ // deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
14084
+ };
14085
+ return ShortLinksRoute;
14086
+ }());
14087
+
14088
+ var ShortLinks = /** @class */ (function () {
14089
+ function ShortLinks() {
14090
+ }
14091
+ /**
14092
+ * List all short links with optional filters
14093
+ */
14094
+ ShortLinks.list = function (params) {
14095
+ return Requests.processRoute(ShortLinksRoute.routes.listShortLinks, undefined, undefined, params);
14096
+ };
14097
+ /**
14098
+ * Create a new short link
14099
+ */
14100
+ ShortLinks.create = function (data, params) {
14101
+ return Requests.processRoute(ShortLinksRoute.routes.createShortLink, data, {}, params);
14102
+ };
14103
+ /**
14104
+ * Get a specific short link by ID
14105
+ */
14106
+ ShortLinks.view = function (id, params) {
14107
+ return Requests.processRoute(ShortLinksRoute.routes.viewShortLink, {}, { id: id }, params);
14108
+ };
14109
+ /**
14110
+ * Update a short link
14111
+ */
14112
+ ShortLinks.update = function (id, data, params) {
14113
+ return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id: id }, params);
14114
+ };
14115
+ return ShortLinks;
14116
+ }());
14117
+
14118
+ var AIUsageRoute = /** @class */ (function () {
14119
+ function AIUsageRoute() {
14120
+ }
14121
+ AIUsageRoute.routes = {
14122
+ listUsage: { url: '/billing/ai-usage', method: HTTP_METHODS.GET },
14123
+ summaryUsage: { url: '/billing/ai-usage/summary', method: HTTP_METHODS.GET }
14124
+ };
14125
+ return AIUsageRoute;
14126
+ }());
14127
+
14128
+ var AIUsage = /** @class */ (function () {
14129
+ function AIUsage() {
14130
+ }
14131
+ /**
14132
+ * List all AI usage entries with optional filters (date range, service, model, etc.).
14133
+ *
14134
+ * @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsage
14135
+ *
14136
+ * @param params Query parameters for filtering and grouping
14137
+ * @returns AxiosPromise
14138
+ */
14139
+ AIUsage.list = function (params) {
14140
+ return Requests.processRoute(AIUsageRoute.routes.listUsage, undefined, undefined, params);
14141
+ };
14142
+ /**
14143
+ * Get summarized AI usage statistics (token totals, cost, grouped by service/model).
14144
+ *
14145
+ * @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsageSummary
14146
+ *
14147
+ * @param params Query parameters for filtering by date range
14148
+ * @returns AxiosPromise
14149
+ */
14150
+ AIUsage.summary = function (params) {
14151
+ return Requests.processRoute(AIUsageRoute.routes.summaryUsage, undefined, undefined, params);
14152
+ };
14153
+ return AIUsage;
14154
+ }());
14155
+
14034
14156
  var Parser = /** @class */ (function () {
14035
14157
  function Parser() {
14036
14158
  }
@@ -14553,7 +14675,9 @@ var Glitch = /** @class */ (function () {
14553
14675
  Funnel: Funnel,
14554
14676
  SocialStats: SocialStats,
14555
14677
  WebsiteAnalytics: WebsiteAnalytics,
14556
- Fingerprinting: Fingerprinting
14678
+ Fingerprinting: Fingerprinting,
14679
+ ShortLinks: ShortLinks,
14680
+ AIUsage: AIUsage
14557
14681
  };
14558
14682
  Glitch.util = {
14559
14683
  Requests: Requests,