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.
@@ -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;
@@ -417,5 +417,45 @@ declare class Ads {
417
417
  community_id?: string;
418
418
  platform?: string;
419
419
  }): AxiosPromise<Response<T>>;
420
+ /**
421
+ * GET /ads/google/targeting/geo/suggest
422
+ */
423
+ static listGoogleGeoSuggestions<T>(params: Record<string, any>): AxiosPromise<Response<T>>;
424
+ /**
425
+ * POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
426
+ */
427
+ static addGoogleLocationTargets<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
428
+ /**
429
+ * GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
430
+ */
431
+ static getGoogleLocationTargets<T>(customer_id: number, campaign_id: number, params: Record<string, any>): AxiosPromise<Response<T>>;
432
+ /**
433
+ * DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
434
+ */
435
+ static removeGoogleLocationTargets<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
436
+ /**
437
+ * POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
438
+ */
439
+ static addGoogleProximityTarget<T>(customer_id: number, campaign_id: number, data: object): AxiosPromise<Response<T>>;
440
+ /**
441
+ * PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
442
+ */
443
+ static updateGoogleTargetingSettings<T>(resource_type: 'campaign' | 'ad_group', customer_id: number, resource_id: number, data: object): AxiosPromise<Response<T>>;
444
+ /**
445
+ * GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
446
+ */
447
+ static getGoogleTargetingSettings<T>(resource_type: 'campaign' | 'ad_group', customer_id: number, resource_id: number, params: Record<string, any>): AxiosPromise<Response<T>>;
448
+ /** GET /ads/posts/google */
449
+ static listGoogleAdPosts<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
450
+ /** POST /ads/posts/google */
451
+ static createGoogleAdPost<T>(data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
452
+ /** PUT /ads/posts/google/{post_id} */
453
+ static updateGoogleAdPost<T>(post_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
454
+ /** DELETE /ads/posts/google/{post_id} */
455
+ static deleteGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
456
+ /** POST /ads/posts/google/{post_id}/pause */
457
+ static pauseGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
458
+ /** POST /ads/posts/google/{post_id}/enable */
459
+ static enableGoogleAdPost<T>(post_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
420
460
  }
421
461
  export default Ads;
@@ -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
@@ -6949,6 +6949,58 @@ var AdsRoute = /** @class */ (function () {
6949
6949
  url: "/ads/reports/time-performance",
6950
6950
  method: HTTP_METHODS.GET,
6951
6951
  },
6952
+ getGoogleGeoSuggestions: {
6953
+ url: "/ads/google/targeting/geo/suggest",
6954
+ method: HTTP_METHODS.GET,
6955
+ },
6956
+ addGoogleLocationTargets: {
6957
+ url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
6958
+ method: HTTP_METHODS.POST,
6959
+ },
6960
+ getGoogleLocationTargets: {
6961
+ url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
6962
+ method: HTTP_METHODS.GET,
6963
+ },
6964
+ removeGoogleLocationTargets: {
6965
+ url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations",
6966
+ method: HTTP_METHODS.DELETE,
6967
+ },
6968
+ addGoogleProximityTarget: {
6969
+ url: "/ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity",
6970
+ method: HTTP_METHODS.POST,
6971
+ },
6972
+ updateGoogleTargetingSettings: {
6973
+ url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
6974
+ method: HTTP_METHODS.PUT,
6975
+ },
6976
+ getGoogleTargetingSettings: {
6977
+ url: "/ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings",
6978
+ method: HTTP_METHODS.GET,
6979
+ },
6980
+ getGoogleAdPosts: {
6981
+ url: "/ads/posts/google",
6982
+ method: HTTP_METHODS.GET,
6983
+ },
6984
+ createGoogleAdPost: {
6985
+ url: "/ads/posts/google",
6986
+ method: HTTP_METHODS.POST,
6987
+ },
6988
+ updateGoogleAdPost: {
6989
+ url: "/ads/posts/google/{post_id}",
6990
+ method: HTTP_METHODS.PUT,
6991
+ },
6992
+ deleteGoogleAdPost: {
6993
+ url: "/ads/posts/google/{post_id}",
6994
+ method: HTTP_METHODS.DELETE,
6995
+ },
6996
+ pauseGoogleAdPost: {
6997
+ url: "/ads/posts/google/{post_id}/pause",
6998
+ method: HTTP_METHODS.POST,
6999
+ },
7000
+ enableGoogleAdPost: {
7001
+ url: "/ads/posts/google/{post_id}/enable",
7002
+ method: HTTP_METHODS.POST,
7003
+ },
6952
7004
  };
6953
7005
  return AdsRoute;
6954
7006
  }());
@@ -7548,6 +7600,72 @@ var Ads = /** @class */ (function () {
7548
7600
  Ads.getTimePerformanceReport = function (params) {
7549
7601
  return Requests.processRoute(AdsRoute.routes.getTimePerformanceReport, undefined, undefined, params);
7550
7602
  };
7603
+ /**
7604
+ * GET /ads/google/targeting/geo/suggest
7605
+ */
7606
+ Ads.listGoogleGeoSuggestions = function (params) {
7607
+ return Requests.processRoute(AdsRoute.routes.getGoogleGeoSuggestions, undefined, undefined, params);
7608
+ };
7609
+ /**
7610
+ * POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
7611
+ */
7612
+ Ads.addGoogleLocationTargets = function (customer_id, campaign_id, data) {
7613
+ return Requests.processRoute(AdsRoute.routes.addGoogleLocationTargets, data, { customer_id: customer_id, campaign_id: campaign_id });
7614
+ };
7615
+ /**
7616
+ * GET /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
7617
+ */
7618
+ Ads.getGoogleLocationTargets = function (customer_id, campaign_id, params) {
7619
+ return Requests.processRoute(AdsRoute.routes.getGoogleLocationTargets, undefined, { customer_id: customer_id, campaign_id: campaign_id }, params);
7620
+ };
7621
+ /**
7622
+ * DELETE /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/locations
7623
+ */
7624
+ Ads.removeGoogleLocationTargets = function (customer_id, campaign_id, data) {
7625
+ return Requests.processRoute(AdsRoute.routes.removeGoogleLocationTargets, data, { customer_id: customer_id, campaign_id: campaign_id });
7626
+ };
7627
+ /**
7628
+ * POST /ads/google/targeting/campaigns/{customer_id}/{campaign_id}/proximity
7629
+ */
7630
+ Ads.addGoogleProximityTarget = function (customer_id, campaign_id, data) {
7631
+ return Requests.processRoute(AdsRoute.routes.addGoogleProximityTarget, data, { customer_id: customer_id, campaign_id: campaign_id });
7632
+ };
7633
+ /**
7634
+ * PUT /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
7635
+ */
7636
+ Ads.updateGoogleTargetingSettings = function (resource_type, customer_id, resource_id, data) {
7637
+ return Requests.processRoute(AdsRoute.routes.updateGoogleTargetingSettings, data, { resource_type: resource_type, customer_id: customer_id, resource_id: resource_id });
7638
+ };
7639
+ /**
7640
+ * GET /ads/google/targeting/{resource_type}/{customer_id}/{resource_id}/settings
7641
+ */
7642
+ Ads.getGoogleTargetingSettings = function (resource_type, customer_id, resource_id, params) {
7643
+ return Requests.processRoute(AdsRoute.routes.getGoogleTargetingSettings, undefined, { resource_type: resource_type, customer_id: customer_id, resource_id: resource_id }, params);
7644
+ };
7645
+ /** GET /ads/posts/google */
7646
+ Ads.listGoogleAdPosts = function (params) {
7647
+ return Requests.processRoute(AdsRoute.routes.getGoogleAdPosts, undefined, undefined, params);
7648
+ };
7649
+ /** POST /ads/posts/google */
7650
+ Ads.createGoogleAdPost = function (data, params) {
7651
+ return Requests.processRoute(AdsRoute.routes.createGoogleAdPost, data, {}, params);
7652
+ };
7653
+ /** PUT /ads/posts/google/{post_id} */
7654
+ Ads.updateGoogleAdPost = function (post_id, data, params) {
7655
+ return Requests.processRoute(AdsRoute.routes.updateGoogleAdPost, data, { post_id: post_id }, params);
7656
+ };
7657
+ /** DELETE /ads/posts/google/{post_id} */
7658
+ Ads.deleteGoogleAdPost = function (post_id, params) {
7659
+ return Requests.processRoute(AdsRoute.routes.deleteGoogleAdPost, {}, { post_id: post_id }, params);
7660
+ };
7661
+ /** POST /ads/posts/google/{post_id}/pause */
7662
+ Ads.pauseGoogleAdPost = function (post_id, params) {
7663
+ return Requests.processRoute(AdsRoute.routes.pauseGoogleAdPost, {}, { post_id: post_id }, params);
7664
+ };
7665
+ /** POST /ads/posts/google/{post_id}/enable */
7666
+ Ads.enableGoogleAdPost = function (post_id, params) {
7667
+ return Requests.processRoute(AdsRoute.routes.enableGoogleAdPost, {}, { post_id: post_id }, params);
7668
+ };
7551
7669
  return Ads;
7552
7670
  }());
7553
7671
 
@@ -10871,6 +10989,22 @@ var TitlesRoute = /** @class */ (function () {
10871
10989
  url: "/titles/{title_id}/utm/analysis",
10872
10990
  method: HTTP_METHODS.GET,
10873
10991
  },
10992
+ chatListSessions: {
10993
+ url: '/titles/{title_id}/chat/sessions',
10994
+ method: HTTP_METHODS.GET
10995
+ },
10996
+ chatShowSession: {
10997
+ url: '/titles/{title_id}/chat/sessions/{session_id}',
10998
+ method: HTTP_METHODS.GET
10999
+ },
11000
+ chatListMessages: {
11001
+ url: '/titles/{title_id}/chat/messages',
11002
+ method: HTTP_METHODS.GET
11003
+ },
11004
+ chatUpdateMessage: {
11005
+ url: '/titles/{title_id}/chat/messages/{message_id}',
11006
+ method: HTTP_METHODS.PUT
11007
+ },
10874
11008
  };
10875
11009
  return TitlesRoute;
10876
11010
  }());
@@ -11226,6 +11360,30 @@ var Titles = /** @class */ (function () {
11226
11360
  Titles.analyzeUtmAnalytics = function (title_id, params) {
11227
11361
  return Requests.processRoute(TitlesRoute.routes.analyzeUtmAnalytics, {}, { title_id: title_id }, params);
11228
11362
  };
11363
+ /**
11364
+ * List all chat sessions for a title.
11365
+ */
11366
+ Titles.chatListSessions = function (title_id, params) {
11367
+ return Requests.processRoute(TitlesRoute.routes.chatListSessions, {}, { title_id: title_id }, params);
11368
+ };
11369
+ /**
11370
+ * Get a specific chat session and its messages.
11371
+ */
11372
+ Titles.chatShowSession = function (title_id, session_id, params) {
11373
+ return Requests.processRoute(TitlesRoute.routes.chatShowSession, {}, { title_id: title_id, session_id: session_id }, params);
11374
+ };
11375
+ /**
11376
+ * Search messages across all sessions of a title.
11377
+ */
11378
+ Titles.chatListMessages = function (title_id, params) {
11379
+ return Requests.processRoute(TitlesRoute.routes.chatListMessages, {}, { title_id: title_id }, params);
11380
+ };
11381
+ /**
11382
+ * Update a specific chat message.
11383
+ */
11384
+ Titles.chatUpdateMessage = function (title_id, message_id, data) {
11385
+ return Requests.processRoute(TitlesRoute.routes.chatUpdateMessage, data, { title_id: title_id, message_id: message_id });
11386
+ };
11229
11387
  return Titles;
11230
11388
  }());
11231
11389
 
@@ -14031,6 +14189,88 @@ var WebsiteAnalytics = /** @class */ (function () {
14031
14189
  return WebsiteAnalytics;
14032
14190
  }());
14033
14191
 
14192
+ var ShortLinksRoute = /** @class */ (function () {
14193
+ function ShortLinksRoute() {
14194
+ }
14195
+ ShortLinksRoute.routes = {
14196
+ listShortLinks: { url: '/shortlinks', method: HTTP_METHODS.GET },
14197
+ createShortLink: { url: '/shortlinks', method: HTTP_METHODS.POST },
14198
+ viewShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.GET },
14199
+ updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
14200
+ // Delete can be added if supported
14201
+ // deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
14202
+ };
14203
+ return ShortLinksRoute;
14204
+ }());
14205
+
14206
+ var ShortLinks = /** @class */ (function () {
14207
+ function ShortLinks() {
14208
+ }
14209
+ /**
14210
+ * List all short links with optional filters
14211
+ */
14212
+ ShortLinks.list = function (params) {
14213
+ return Requests.processRoute(ShortLinksRoute.routes.listShortLinks, undefined, undefined, params);
14214
+ };
14215
+ /**
14216
+ * Create a new short link
14217
+ */
14218
+ ShortLinks.create = function (data, params) {
14219
+ return Requests.processRoute(ShortLinksRoute.routes.createShortLink, data, {}, params);
14220
+ };
14221
+ /**
14222
+ * Get a specific short link by ID
14223
+ */
14224
+ ShortLinks.view = function (id, params) {
14225
+ return Requests.processRoute(ShortLinksRoute.routes.viewShortLink, {}, { id: id }, params);
14226
+ };
14227
+ /**
14228
+ * Update a short link
14229
+ */
14230
+ ShortLinks.update = function (id, data, params) {
14231
+ return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id: id }, params);
14232
+ };
14233
+ return ShortLinks;
14234
+ }());
14235
+
14236
+ var AIUsageRoute = /** @class */ (function () {
14237
+ function AIUsageRoute() {
14238
+ }
14239
+ AIUsageRoute.routes = {
14240
+ listUsage: { url: '/billing/ai-usage', method: HTTP_METHODS.GET },
14241
+ summaryUsage: { url: '/billing/ai-usage/summary', method: HTTP_METHODS.GET }
14242
+ };
14243
+ return AIUsageRoute;
14244
+ }());
14245
+
14246
+ var AIUsage = /** @class */ (function () {
14247
+ function AIUsage() {
14248
+ }
14249
+ /**
14250
+ * List all AI usage entries with optional filters (date range, service, model, etc.).
14251
+ *
14252
+ * @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsage
14253
+ *
14254
+ * @param params Query parameters for filtering and grouping
14255
+ * @returns AxiosPromise
14256
+ */
14257
+ AIUsage.list = function (params) {
14258
+ return Requests.processRoute(AIUsageRoute.routes.listUsage, undefined, undefined, params);
14259
+ };
14260
+ /**
14261
+ * Get summarized AI usage statistics (token totals, cost, grouped by service/model).
14262
+ *
14263
+ * @see https://api.glitch.fun/api/documentation#/AI%20Usage/getAIUsageSummary
14264
+ *
14265
+ * @param params Query parameters for filtering by date range
14266
+ * @returns AxiosPromise
14267
+ */
14268
+ AIUsage.summary = function (params) {
14269
+ return Requests.processRoute(AIUsageRoute.routes.summaryUsage, undefined, undefined, params);
14270
+ };
14271
+ return AIUsage;
14272
+ }());
14273
+
14034
14274
  var Parser = /** @class */ (function () {
14035
14275
  function Parser() {
14036
14276
  }
@@ -14553,7 +14793,9 @@ var Glitch = /** @class */ (function () {
14553
14793
  Funnel: Funnel,
14554
14794
  SocialStats: SocialStats,
14555
14795
  WebsiteAnalytics: WebsiteAnalytics,
14556
- Fingerprinting: Fingerprinting
14796
+ Fingerprinting: Fingerprinting,
14797
+ ShortLinks: ShortLinks,
14798
+ AIUsage: AIUsage
14557
14799
  };
14558
14800
  Glitch.util = {
14559
14801
  Requests: Requests,