glitch-javascript-sdk 2.0.2 → 2.0.4

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.
@@ -17,5 +17,25 @@ declare class ShortLinks {
17
17
  * Update a short link
18
18
  */
19
19
  static update<T>(id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Get click-summary report
22
+ * - Example usage: ShortLinks.clickSummary({ short_link_id: 'uuid-here' })
23
+ */
24
+ static clickSummary<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
25
+ /**
26
+ * Get geo & device breakdown report
27
+ * - Example usage: ShortLinks.geoDeviceBreakdown({ short_link_id: 'uuid-here' })
28
+ */
29
+ static geoDeviceBreakdown<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
30
+ /**
31
+ * Get time-series report
32
+ * - Example usage: ShortLinks.timeSeries({ short_link_id: 'uuid-here', group_by: 'day' })
33
+ */
34
+ static timeSeries<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
35
+ /**
36
+ * Get referrer & UTM report
37
+ * - Example usage: ShortLinks.referrerReport({ short_link_id: 'uuid-here' })
38
+ */
39
+ static referrerReport<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
20
40
  }
21
41
  export default ShortLinks;
@@ -289,5 +289,50 @@ declare class Titles {
289
289
  * Update a specific chat message.
290
290
  */
291
291
  static chatUpdateMessage<T>(title_id: string, message_id: string, data: object): AxiosPromise<Response<T>>;
292
+ /**
293
+ * List all purchase events for a specific title.
294
+ * Matches GET /titles/{title_id}/purchases
295
+ */
296
+ static listPurchases<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
297
+ /**
298
+ * Retrieve a single purchase record by ID.
299
+ * Matches GET /titles/{title_id}/purchases/{purchase_id}
300
+ */
301
+ static viewPurchase<T>(title_id: string, purchase_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
302
+ /**
303
+ * Create a new purchase record.
304
+ * Matches POST /titles/{title_id}/purchases
305
+ */
306
+ static createPurchase<T>(title_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
307
+ /**
308
+ * Get a summary of total revenue, grouped by day or purchase_type.
309
+ * Matches GET /titles/{title_id}/purchases/summary
310
+ */
311
+ static purchaseSummary<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
312
+ /**
313
+ * Revenue by time (daily, weekly, or monthly).
314
+ * Matches GET /titles/{title_id}/purchases/reports/time
315
+ */
316
+ static purchaseRevenueByTime<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
317
+ /**
318
+ * 30-day LTV (Lifetime Value) per install.
319
+ * Matches GET /titles/{title_id}/purchases/reports/ltv30
320
+ */
321
+ static purchaseLtv30<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
322
+ /**
323
+ * Show breakdown of revenue per currency, with optional USD conversion.
324
+ * Matches GET /titles/{title_id}/purchases/reports/currency
325
+ */
326
+ static purchaseCurrencyBreakdown<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
327
+ /**
328
+ * Distribution of installs by total revenue, plus a histogram array.
329
+ * Matches GET /titles/{title_id}/purchases/reports/install-distribution
330
+ */
331
+ static installRevenueDistribution<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
332
+ /**
333
+ * Stats by item SKU, purchase type, and repeat purchase analysis.
334
+ * Matches GET /titles/{title_id}/purchases/reports/item-type-stats
335
+ */
336
+ static itemAndPurchaseTypeStats<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
292
337
  }
293
338
  export default Titles;
@@ -366,5 +366,30 @@ declare class Users {
366
366
  * @returns promise
367
367
  */
368
368
  static search<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
369
+ /**
370
+ * Resends the verification email to the authenticated user.
371
+ *
372
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/resendVerificationEmail
373
+ *
374
+ * @returns Promise
375
+ */
376
+ static resendVerificationEmail<T>(): AxiosPromise<Response<T>>;
377
+ /**
378
+ * Clear Instagram authentication information from the current user.
379
+ *
380
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearInstagramAuth
381
+ *
382
+ * @returns promise
383
+ */
384
+ static clearInstagramAuth<T>(): AxiosPromise<Response<T>>;
385
+ /**
386
+ * Gets the rules for a specific subreddit.
387
+ *
388
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditRules
389
+ *
390
+ * @param subreddit The name of the subreddit to get rules for.
391
+ * @returns Promise resolving to the list of rules
392
+ */
393
+ static getSubredditRules<T>(subreddit: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
369
394
  }
370
395
  export default Users;
package/dist/esm/index.js CHANGED
@@ -8593,13 +8593,16 @@ var UserRoutes = /** @class */ (function () {
8593
8593
  addType: { url: '/users/addType', method: HTTP_METHODS.POST },
8594
8594
  removeType: { url: '/users/removeType/{type_id}', method: HTTP_METHODS.DELETE },
8595
8595
  getCampaignInvites: { url: '/users/getCampaignInvites', method: HTTP_METHODS.GET },
8596
- getPayouts: { url: '/users/payouts', method: HTTP_METHODS.GET },
8596
+ getPayouts: { url: '/users/getCampaignPayouts', method: HTTP_METHODS.GET },
8597
8597
  verifyAccount: { url: '/users/verify', method: HTTP_METHODS.POST },
8598
8598
  getInstagramAccounts: { url: '/users/instagramAccounts', method: HTTP_METHODS.GET },
8599
8599
  getFacebookPages: { url: "/users/facebookPages", method: HTTP_METHODS.GET },
8600
8600
  getSubreddits: { url: "/users/reddit/subreddits", method: HTTP_METHODS.GET },
8601
8601
  getSubredditFlairs: { url: "/users/reddit/redditflairs/{subreddit}", method: HTTP_METHODS.GET },
8602
8602
  search: { url: '/users/search', method: HTTP_METHODS.GET },
8603
+ resendVerificationEmail: { url: '/users/resendVerificationEmail', method: HTTP_METHODS.POST },
8604
+ clearInstagramAuth: { url: '/users/clearInstagramAuth', method: HTTP_METHODS.DELETE },
8605
+ getSubredditRules: { url: "/users/reddit/redditrules/{subreddit}", method: HTTP_METHODS.GET },
8603
8606
  };
8604
8607
  return UserRoutes;
8605
8608
  }());
@@ -9052,6 +9055,37 @@ var Users = /** @class */ (function () {
9052
9055
  Users.search = function (params) {
9053
9056
  return Requests.processRoute(UserRoutes.routes.search, undefined, undefined, params);
9054
9057
  };
9058
+ /**
9059
+ * Resends the verification email to the authenticated user.
9060
+ *
9061
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/resendVerificationEmail
9062
+ *
9063
+ * @returns Promise
9064
+ */
9065
+ Users.resendVerificationEmail = function () {
9066
+ return Requests.processRoute(UserRoutes.routes.resendVerificationEmail, {});
9067
+ };
9068
+ /**
9069
+ * Clear Instagram authentication information from the current user.
9070
+ *
9071
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/clearInstagramAuth
9072
+ *
9073
+ * @returns promise
9074
+ */
9075
+ Users.clearInstagramAuth = function () {
9076
+ return Requests.processRoute(UserRoutes.routes.clearInstagramAuth, {});
9077
+ };
9078
+ /**
9079
+ * Gets the rules for a specific subreddit.
9080
+ *
9081
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/getSubredditRules
9082
+ *
9083
+ * @param subreddit The name of the subreddit to get rules for.
9084
+ * @returns Promise resolving to the list of rules
9085
+ */
9086
+ Users.getSubredditRules = function (subreddit, params) {
9087
+ return Requests.processRoute(UserRoutes.routes.getSubredditRules, undefined, { subreddit: subreddit }, params);
9088
+ };
9055
9089
  return Users;
9056
9090
  }());
9057
9091
 
@@ -11057,6 +11091,46 @@ var TitlesRoute = /** @class */ (function () {
11057
11091
  url: '/titles/{title_id}/chat/messages/{message_id}',
11058
11092
  method: HTTP_METHODS.PUT
11059
11093
  },
11094
+ // ─────────────────────────────────────────────────────────────────
11095
+ // Purchase/Revenue Endpoints
11096
+ // ─────────────────────────────────────────────────────────────────
11097
+ purchasesList: {
11098
+ url: "/titles/{title_id}/purchases",
11099
+ method: HTTP_METHODS.GET,
11100
+ },
11101
+ purchasesShow: {
11102
+ url: "/titles/{title_id}/purchases/{purchase_id}",
11103
+ method: HTTP_METHODS.GET,
11104
+ },
11105
+ purchasesCreate: {
11106
+ url: "/titles/{title_id}/purchases",
11107
+ method: HTTP_METHODS.POST,
11108
+ },
11109
+ purchasesSummary: {
11110
+ url: "/titles/{title_id}/purchases/summary",
11111
+ method: HTTP_METHODS.GET,
11112
+ },
11113
+ // Advanced analytics sub-routes
11114
+ purchasesTimeReport: {
11115
+ url: "/titles/{title_id}/purchases/reports/time",
11116
+ method: HTTP_METHODS.GET,
11117
+ },
11118
+ purchasesLtv30Report: {
11119
+ url: "/titles/{title_id}/purchases/reports/ltv30",
11120
+ method: HTTP_METHODS.GET,
11121
+ },
11122
+ purchasesCurrencyBreakdown: {
11123
+ url: "/titles/{title_id}/purchases/reports/currency",
11124
+ method: HTTP_METHODS.GET,
11125
+ },
11126
+ purchasesInstallDistribution: {
11127
+ url: "/titles/{title_id}/purchases/reports/install-distribution",
11128
+ method: HTTP_METHODS.GET,
11129
+ },
11130
+ purchasesItemTypeStats: {
11131
+ url: "/titles/{title_id}/purchases/reports/item-type-stats",
11132
+ method: HTTP_METHODS.GET,
11133
+ },
11060
11134
  };
11061
11135
  return TitlesRoute;
11062
11136
  }());
@@ -11436,6 +11510,69 @@ var Titles = /** @class */ (function () {
11436
11510
  Titles.chatUpdateMessage = function (title_id, message_id, data) {
11437
11511
  return Requests.processRoute(TitlesRoute.routes.chatUpdateMessage, data, { title_id: title_id, message_id: message_id });
11438
11512
  };
11513
+ /**
11514
+ * List all purchase events for a specific title.
11515
+ * Matches GET /titles/{title_id}/purchases
11516
+ */
11517
+ Titles.listPurchases = function (title_id, params) {
11518
+ return Requests.processRoute(TitlesRoute.routes.purchasesList, {}, { title_id: title_id }, params);
11519
+ };
11520
+ /**
11521
+ * Retrieve a single purchase record by ID.
11522
+ * Matches GET /titles/{title_id}/purchases/{purchase_id}
11523
+ */
11524
+ Titles.viewPurchase = function (title_id, purchase_id, params) {
11525
+ return Requests.processRoute(TitlesRoute.routes.purchasesShow, {}, { title_id: title_id, purchase_id: purchase_id }, params);
11526
+ };
11527
+ /**
11528
+ * Create a new purchase record.
11529
+ * Matches POST /titles/{title_id}/purchases
11530
+ */
11531
+ Titles.createPurchase = function (title_id, data, params) {
11532
+ return Requests.processRoute(TitlesRoute.routes.purchasesCreate, data, { title_id: title_id }, params);
11533
+ };
11534
+ /**
11535
+ * Get a summary of total revenue, grouped by day or purchase_type.
11536
+ * Matches GET /titles/{title_id}/purchases/summary
11537
+ */
11538
+ Titles.purchaseSummary = function (title_id, params) {
11539
+ return Requests.processRoute(TitlesRoute.routes.purchasesSummary, {}, { title_id: title_id }, params);
11540
+ };
11541
+ /**
11542
+ * Revenue by time (daily, weekly, or monthly).
11543
+ * Matches GET /titles/{title_id}/purchases/reports/time
11544
+ */
11545
+ Titles.purchaseRevenueByTime = function (title_id, params) {
11546
+ return Requests.processRoute(TitlesRoute.routes.purchasesTimeReport, {}, { title_id: title_id }, params);
11547
+ };
11548
+ /**
11549
+ * 30-day LTV (Lifetime Value) per install.
11550
+ * Matches GET /titles/{title_id}/purchases/reports/ltv30
11551
+ */
11552
+ Titles.purchaseLtv30 = function (title_id, params) {
11553
+ return Requests.processRoute(TitlesRoute.routes.purchasesLtv30Report, {}, { title_id: title_id }, params);
11554
+ };
11555
+ /**
11556
+ * Show breakdown of revenue per currency, with optional USD conversion.
11557
+ * Matches GET /titles/{title_id}/purchases/reports/currency
11558
+ */
11559
+ Titles.purchaseCurrencyBreakdown = function (title_id, params) {
11560
+ return Requests.processRoute(TitlesRoute.routes.purchasesCurrencyBreakdown, {}, { title_id: title_id }, params);
11561
+ };
11562
+ /**
11563
+ * Distribution of installs by total revenue, plus a histogram array.
11564
+ * Matches GET /titles/{title_id}/purchases/reports/install-distribution
11565
+ */
11566
+ Titles.installRevenueDistribution = function (title_id, params) {
11567
+ return Requests.processRoute(TitlesRoute.routes.purchasesInstallDistribution, {}, { title_id: title_id }, params);
11568
+ };
11569
+ /**
11570
+ * Stats by item SKU, purchase type, and repeat purchase analysis.
11571
+ * Matches GET /titles/{title_id}/purchases/reports/item-type-stats
11572
+ */
11573
+ Titles.itemAndPurchaseTypeStats = function (title_id, params) {
11574
+ return Requests.processRoute(TitlesRoute.routes.purchasesItemTypeStats, {}, { title_id: title_id }, params);
11575
+ };
11439
11576
  return Titles;
11440
11577
  }());
11441
11578
 
@@ -14428,6 +14565,10 @@ var ShortLinksRoute = /** @class */ (function () {
14428
14565
  updateShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.PUT },
14429
14566
  // Delete can be added if supported
14430
14567
  // deleteShortLink: { url: '/shortlinks/{id}', method: HTTP_METHODS.DELETE }
14568
+ clickSummary: { url: '/shortlinks/reports/click-summary', method: HTTP_METHODS.GET },
14569
+ geoDeviceBreakdown: { url: '/shortlinks/reports/geo-device', method: HTTP_METHODS.GET },
14570
+ timeSeries: { url: '/shortlinks/reports/time-series', method: HTTP_METHODS.GET },
14571
+ referrerReport: { url: '/shortlinks/reports/referrer', method: HTTP_METHODS.GET },
14431
14572
  };
14432
14573
  return ShortLinksRoute;
14433
14574
  }());
@@ -14459,6 +14600,38 @@ var ShortLinks = /** @class */ (function () {
14459
14600
  ShortLinks.update = function (id, data, params) {
14460
14601
  return Requests.processRoute(ShortLinksRoute.routes.updateShortLink, data, { id: id }, params);
14461
14602
  };
14603
+ // Uncomment when delete is supported
14604
+ // public static delete<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
14605
+ // return Requests.processRoute(ShortLinksRoute.routes.deleteShortLink, {}, { id }, params);
14606
+ // }
14607
+ /**
14608
+ * Get click-summary report
14609
+ * - Example usage: ShortLinks.clickSummary({ short_link_id: 'uuid-here' })
14610
+ */
14611
+ ShortLinks.clickSummary = function (params) {
14612
+ return Requests.processRoute(ShortLinksRoute.routes.clickSummary, undefined, undefined, params);
14613
+ };
14614
+ /**
14615
+ * Get geo & device breakdown report
14616
+ * - Example usage: ShortLinks.geoDeviceBreakdown({ short_link_id: 'uuid-here' })
14617
+ */
14618
+ ShortLinks.geoDeviceBreakdown = function (params) {
14619
+ return Requests.processRoute(ShortLinksRoute.routes.geoDeviceBreakdown, undefined, undefined, params);
14620
+ };
14621
+ /**
14622
+ * Get time-series report
14623
+ * - Example usage: ShortLinks.timeSeries({ short_link_id: 'uuid-here', group_by: 'day' })
14624
+ */
14625
+ ShortLinks.timeSeries = function (params) {
14626
+ return Requests.processRoute(ShortLinksRoute.routes.timeSeries, undefined, undefined, params);
14627
+ };
14628
+ /**
14629
+ * Get referrer & UTM report
14630
+ * - Example usage: ShortLinks.referrerReport({ short_link_id: 'uuid-here' })
14631
+ */
14632
+ ShortLinks.referrerReport = function (params) {
14633
+ return Requests.processRoute(ShortLinksRoute.routes.referrerReport, undefined, undefined, params);
14634
+ };
14462
14635
  return ShortLinks;
14463
14636
  }());
14464
14637