glitch-javascript-sdk 2.1.8 → 2.2.0

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/index.d.ts CHANGED
@@ -3937,6 +3937,26 @@ declare class Titles {
3937
3937
  * @returns AxiosPromise
3938
3938
  */
3939
3939
  static importKeys<T>(title_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
3940
+ /**
3941
+ * Update administrator email preferences for a title.
3942
+ *
3943
+ * @see https://api.glitch.fun/api/documentation#/Titles/updateTitleAdministrator
3944
+ *
3945
+ * @param title_id The id of the title.
3946
+ * @param user_id The id of the user/administrator.
3947
+ * @param data The preference data to update (notify_promotion_schedule_reminder_email, notify_weekly_promotion_performance_email).
3948
+ *
3949
+ * @returns Promise
3950
+ */
3951
+ static updateAdministrator<T>(title_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
3952
+ /**
3953
+ * List ad conversion events for a title with filtering
3954
+ */
3955
+ static listAdConversionEvents<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
3956
+ /**
3957
+ * Retry a failed or pending ad conversion event
3958
+ */
3959
+ static retryAdConversionEvent<T>(title_id: string, event_id: string): AxiosPromise<Response<T>>;
3940
3960
  }
3941
3961
 
3942
3962
  declare class Campaigns {
@@ -4613,6 +4633,14 @@ declare class Campaigns {
4613
4633
  static sourcingGetGamesByIds<T>(campaign_id: string, data: {
4614
4634
  igdb_ids: number[];
4615
4635
  }): AxiosPromise<Response<T>>;
4636
+ /**
4637
+ * Get full game details from a list of IGDB IDs.
4638
+ * @param campaign_id The UUID of the campaign.
4639
+ * @param data An object containing the array of IGDB IDs.
4640
+ * @param data.igdb_ids An array of IGDB game IDs.
4641
+ * @returns promise
4642
+ */
4643
+ static updateAutoInviteCriteria<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
4616
4644
  }
4617
4645
 
4618
4646
  declare class Subscriptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.1.8",
3
+ "version": "2.2.0",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -937,6 +937,17 @@ class Campaigns {
937
937
  return Requests.processRoute(CampaignsRoute.routes.sourcingGetGamesByIds, data, { campaign_id });
938
938
  }
939
939
 
940
+ /**
941
+ * Get full game details from a list of IGDB IDs.
942
+ * @param campaign_id The UUID of the campaign.
943
+ * @param data An object containing the array of IGDB IDs.
944
+ * @param data.igdb_ids An array of IGDB game IDs.
945
+ * @returns promise
946
+ */
947
+ public static updateAutoInviteCriteria<T>(campaign_id: string, data: object): AxiosPromise<Response<T>> {
948
+ return Requests.processRoute(CampaignsRoute.routes.updateAutoInviteCriteria, data, { campaign_id });
949
+ }
950
+
940
951
 
941
952
  }
942
953
 
package/src/api/Titles.ts CHANGED
@@ -552,164 +552,164 @@ class Titles {
552
552
  );
553
553
  }
554
554
 
555
- /**
556
- * List all purchase events for a specific title.
557
- * Matches GET /titles/{title_id}/purchases
558
- */
559
- public static listPurchases<T>(
560
- title_id: string,
561
- params?: Record<string, any>
562
- ): AxiosPromise<Response<T>> {
563
- return Requests.processRoute(
564
- TitlesRoute.routes.purchasesList,
565
- {},
566
- { title_id },
567
- params
568
- );
569
- }
570
-
571
- /**
572
- * Retrieve a single purchase record by ID.
573
- * Matches GET /titles/{title_id}/purchases/{purchase_id}
574
- */
575
- public static viewPurchase<T>(
576
- title_id: string,
577
- purchase_id: string,
578
- params?: Record<string, any>
579
- ): AxiosPromise<Response<T>> {
580
- return Requests.processRoute(
581
- TitlesRoute.routes.purchasesShow,
582
- {},
583
- { title_id, purchase_id },
584
- params
585
- );
586
- }
587
-
588
- /**
589
- * Create a new purchase record.
590
- * Matches POST /titles/{title_id}/purchases
591
- */
592
- public static createPurchase<T>(
593
- title_id: string,
594
- data: object,
595
- params?: Record<string, any>
596
- ): AxiosPromise<Response<T>> {
597
- return Requests.processRoute(
598
- TitlesRoute.routes.purchasesCreate,
599
- data,
600
- { title_id },
601
- params
602
- );
603
- }
604
-
605
- /**
606
- * Get a summary of total revenue, grouped by day or purchase_type.
607
- * Matches GET /titles/{title_id}/purchases/summary
608
- */
609
- public static purchaseSummary<T>(
610
- title_id: string,
611
- params?: Record<string, any>
612
- ): AxiosPromise<Response<T>> {
613
- return Requests.processRoute(
614
- TitlesRoute.routes.purchasesSummary,
615
- {},
616
- { title_id },
617
- params
618
- );
619
- }
620
-
621
- /**
622
- * Revenue by time (daily, weekly, or monthly).
623
- * Matches GET /titles/{title_id}/purchases/reports/time
624
- */
625
- public static purchaseRevenueByTime<T>(
626
- title_id: string,
627
- params?: Record<string, any>
628
- ): AxiosPromise<Response<T>> {
629
- return Requests.processRoute(
630
- TitlesRoute.routes.purchasesTimeReport,
631
- {},
632
- { title_id },
633
- params
634
- );
635
- }
636
-
637
- /**
638
- * 30-day LTV (Lifetime Value) per install.
639
- * Matches GET /titles/{title_id}/purchases/reports/ltv30
640
- */
641
- public static purchaseLtv30<T>(
642
- title_id: string,
643
- params?: Record<string, any>
644
- ): AxiosPromise<Response<T>> {
645
- return Requests.processRoute(
646
- TitlesRoute.routes.purchasesLtv30Report,
647
- {},
648
- { title_id },
649
- params
650
- );
651
- }
652
-
653
- /**
654
- * Show breakdown of revenue per currency, with optional USD conversion.
655
- * Matches GET /titles/{title_id}/purchases/reports/currency
656
- */
657
- public static purchaseCurrencyBreakdown<T>(
658
- title_id: string,
659
- params?: Record<string, any>
660
- ): AxiosPromise<Response<T>> {
661
- return Requests.processRoute(
662
- TitlesRoute.routes.purchasesCurrencyBreakdown,
663
- {},
664
- { title_id },
665
- params
666
- );
667
- }
668
-
669
- /**
670
- * Distribution of installs by total revenue, plus a histogram array.
671
- * Matches GET /titles/{title_id}/purchases/reports/install-distribution
672
- */
673
- public static installRevenueDistribution<T>(
674
- title_id: string,
675
- params?: Record<string, any>
676
- ): AxiosPromise<Response<T>> {
677
- return Requests.processRoute(
678
- TitlesRoute.routes.purchasesInstallDistribution,
679
- {},
680
- { title_id },
681
- params
682
- );
683
- }
684
-
685
- /**
686
- * Stats by item SKU, purchase type, and repeat purchase analysis.
687
- * Matches GET /titles/{title_id}/purchases/reports/item-type-stats
688
- */
689
- public static itemAndPurchaseTypeStats<T>(
690
- title_id: string,
691
- params?: Record<string, any>
692
- ): AxiosPromise<Response<T>> {
693
- return Requests.processRoute(
694
- TitlesRoute.routes.purchasesItemTypeStats,
695
- {},
696
- { title_id },
697
- params
698
- );
699
- }
700
-
701
- /**
702
- * Bulk import access keys for a title from a CSV or Excel file.
703
- * The file must contain 'platform' and 'code' columns.
704
- *
705
- * @see https://api.glitch.fun/api/documentation#/Titles/importTitleKeys
706
- *
707
- * @param title_id The UUID of the title.
708
- * @param file The CSV or Excel file to upload.
709
- * @param data Optional additional form data.
710
- * @param params Optional query parameters.
711
- * @returns AxiosPromise
555
+ /**
556
+ * List all purchase events for a specific title.
557
+ * Matches GET /titles/{title_id}/purchases
558
+ */
559
+ public static listPurchases<T>(
560
+ title_id: string,
561
+ params?: Record<string, any>
562
+ ): AxiosPromise<Response<T>> {
563
+ return Requests.processRoute(
564
+ TitlesRoute.routes.purchasesList,
565
+ {},
566
+ { title_id },
567
+ params
568
+ );
569
+ }
570
+
571
+ /**
572
+ * Retrieve a single purchase record by ID.
573
+ * Matches GET /titles/{title_id}/purchases/{purchase_id}
574
+ */
575
+ public static viewPurchase<T>(
576
+ title_id: string,
577
+ purchase_id: string,
578
+ params?: Record<string, any>
579
+ ): AxiosPromise<Response<T>> {
580
+ return Requests.processRoute(
581
+ TitlesRoute.routes.purchasesShow,
582
+ {},
583
+ { title_id, purchase_id },
584
+ params
585
+ );
586
+ }
587
+
588
+ /**
589
+ * Create a new purchase record.
590
+ * Matches POST /titles/{title_id}/purchases
591
+ */
592
+ public static createPurchase<T>(
593
+ title_id: string,
594
+ data: object,
595
+ params?: Record<string, any>
596
+ ): AxiosPromise<Response<T>> {
597
+ return Requests.processRoute(
598
+ TitlesRoute.routes.purchasesCreate,
599
+ data,
600
+ { title_id },
601
+ params
602
+ );
603
+ }
604
+
605
+ /**
606
+ * Get a summary of total revenue, grouped by day or purchase_type.
607
+ * Matches GET /titles/{title_id}/purchases/summary
608
+ */
609
+ public static purchaseSummary<T>(
610
+ title_id: string,
611
+ params?: Record<string, any>
612
+ ): AxiosPromise<Response<T>> {
613
+ return Requests.processRoute(
614
+ TitlesRoute.routes.purchasesSummary,
615
+ {},
616
+ { title_id },
617
+ params
618
+ );
619
+ }
620
+
621
+ /**
622
+ * Revenue by time (daily, weekly, or monthly).
623
+ * Matches GET /titles/{title_id}/purchases/reports/time
624
+ */
625
+ public static purchaseRevenueByTime<T>(
626
+ title_id: string,
627
+ params?: Record<string, any>
628
+ ): AxiosPromise<Response<T>> {
629
+ return Requests.processRoute(
630
+ TitlesRoute.routes.purchasesTimeReport,
631
+ {},
632
+ { title_id },
633
+ params
634
+ );
635
+ }
636
+
637
+ /**
638
+ * 30-day LTV (Lifetime Value) per install.
639
+ * Matches GET /titles/{title_id}/purchases/reports/ltv30
640
+ */
641
+ public static purchaseLtv30<T>(
642
+ title_id: string,
643
+ params?: Record<string, any>
644
+ ): AxiosPromise<Response<T>> {
645
+ return Requests.processRoute(
646
+ TitlesRoute.routes.purchasesLtv30Report,
647
+ {},
648
+ { title_id },
649
+ params
650
+ );
651
+ }
652
+
653
+ /**
654
+ * Show breakdown of revenue per currency, with optional USD conversion.
655
+ * Matches GET /titles/{title_id}/purchases/reports/currency
656
+ */
657
+ public static purchaseCurrencyBreakdown<T>(
658
+ title_id: string,
659
+ params?: Record<string, any>
660
+ ): AxiosPromise<Response<T>> {
661
+ return Requests.processRoute(
662
+ TitlesRoute.routes.purchasesCurrencyBreakdown,
663
+ {},
664
+ { title_id },
665
+ params
666
+ );
667
+ }
668
+
669
+ /**
670
+ * Distribution of installs by total revenue, plus a histogram array.
671
+ * Matches GET /titles/{title_id}/purchases/reports/install-distribution
672
+ */
673
+ public static installRevenueDistribution<T>(
674
+ title_id: string,
675
+ params?: Record<string, any>
676
+ ): AxiosPromise<Response<T>> {
677
+ return Requests.processRoute(
678
+ TitlesRoute.routes.purchasesInstallDistribution,
679
+ {},
680
+ { title_id },
681
+ params
682
+ );
683
+ }
684
+
685
+ /**
686
+ * Stats by item SKU, purchase type, and repeat purchase analysis.
687
+ * Matches GET /titles/{title_id}/purchases/reports/item-type-stats
712
688
  */
689
+ public static itemAndPurchaseTypeStats<T>(
690
+ title_id: string,
691
+ params?: Record<string, any>
692
+ ): AxiosPromise<Response<T>> {
693
+ return Requests.processRoute(
694
+ TitlesRoute.routes.purchasesItemTypeStats,
695
+ {},
696
+ { title_id },
697
+ params
698
+ );
699
+ }
700
+
701
+ /**
702
+ * Bulk import access keys for a title from a CSV or Excel file.
703
+ * The file must contain 'platform' and 'code' columns.
704
+ *
705
+ * @see https://api.glitch.fun/api/documentation#/Titles/importTitleKeys
706
+ *
707
+ * @param title_id The UUID of the title.
708
+ * @param file The CSV or Excel file to upload.
709
+ * @param data Optional additional form data.
710
+ * @param params Optional query parameters.
711
+ * @returns AxiosPromise
712
+ */
713
713
  public static importKeys<T>(
714
714
  title_id: string,
715
715
  file: File | Blob,
@@ -721,6 +721,49 @@ class Titles {
721
721
  }
722
722
 
723
723
 
724
+ /**
725
+ * Update administrator email preferences for a title.
726
+ *
727
+ * @see https://api.glitch.fun/api/documentation#/Titles/updateTitleAdministrator
728
+ *
729
+ * @param title_id The id of the title.
730
+ * @param user_id The id of the user/administrator.
731
+ * @param data The preference data to update (notify_promotion_schedule_reminder_email, notify_weekly_promotion_performance_email).
732
+ *
733
+ * @returns Promise
734
+ */
735
+ public static updateAdministrator<T>(title_id: string, user_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
736
+ return Requests.processRoute(TitlesRoute.routes.updateAdministrator, data, { title_id: title_id, user_id: user_id }, params);
737
+ }
738
+
739
+ /**
740
+ * List ad conversion events for a title with filtering
741
+ */
742
+ public static listAdConversionEvents<T>(
743
+ title_id: string,
744
+ params?: Record<string, any>
745
+ ): AxiosPromise<Response<T>> {
746
+ return Requests.processRoute(
747
+ TitlesRoute.routes.listAdConversionEvents,
748
+ {},
749
+ { title_id },
750
+ params
751
+ );
752
+ }
753
+
754
+ /**
755
+ * Retry a failed or pending ad conversion event
756
+ */
757
+ public static retryAdConversionEvent<T>(
758
+ title_id: string,
759
+ event_id: string
760
+ ): AxiosPromise<Response<T>> {
761
+ return Requests.processRoute(
762
+ TitlesRoute.routes.retryAdConversionEvent,
763
+ {},
764
+ { title_id, event_id }
765
+ );
766
+ }
724
767
 
725
768
  }
726
769
 
@@ -76,6 +76,8 @@ class CampaignsRoute {
76
76
  exportSourcedCreators: { url: '/campaigns/{campaign_id}/sourcing/creators/export', method: HTTP_METHODS.GET },
77
77
  sourcingSearchAnyIgdbGame: { url: '/campaigns/{campaign_id}/sourcing/search-any-game', method: HTTP_METHODS.GET },
78
78
  sourcingGetGamesByIds: { url: '/campaigns/{campaign_id}/sourcing/games-by-ids', method: HTTP_METHODS.POST },
79
+ updateAutoInviteCriteria: { url: '/campaigns/{campaign_id}/sourcing/auto-invite-criteria', method: HTTP_METHODS.PUT },
80
+
79
81
 
80
82
  };
81
83
 
@@ -32,6 +32,7 @@ class TitlesRoute {
32
32
  activeRetentions: { url: '/titles/{title_id}/retentions/active', method: HTTP_METHODS.GET },
33
33
  retentionAnalysis: { url: '/titles/{title_id}/retentions/analysis', method: HTTP_METHODS.GET },
34
34
  distinctDimensions: { url: '/titles/{title_id}/installs/distinctDimensions', method: HTTP_METHODS.GET },
35
+ updateAdministrator: { url: '/titles/{title_id}/updateAdministrator/{user_id}', method: HTTP_METHODS.PUT },
35
36
  listSessions: {
36
37
  url: '/titles/{title_id}/installs/sessions',
37
38
  method: HTTP_METHODS.GET
@@ -99,45 +100,54 @@ class TitlesRoute {
99
100
  // ─────────────────────────────────────────────────────────────────
100
101
  // Purchase/Revenue Endpoints
101
102
  // ─────────────────────────────────────────────────────────────────
102
- purchasesList: {
103
- url: "/titles/{title_id}/purchases",
104
- method: HTTP_METHODS.GET,
105
- },
106
- purchasesShow: {
107
- url: "/titles/{title_id}/purchases/{purchase_id}",
108
- method: HTTP_METHODS.GET,
109
- },
110
- purchasesCreate: {
111
- url: "/titles/{title_id}/purchases",
112
- method: HTTP_METHODS.POST,
113
- },
114
- purchasesSummary: {
115
- url: "/titles/{title_id}/purchases/summary",
116
- method: HTTP_METHODS.GET,
117
- },
118
-
103
+ purchasesList: {
104
+ url: "/titles/{title_id}/purchases",
105
+ method: HTTP_METHODS.GET,
106
+ },
107
+ purchasesShow: {
108
+ url: "/titles/{title_id}/purchases/{purchase_id}",
109
+ method: HTTP_METHODS.GET,
110
+ },
111
+ purchasesCreate: {
112
+ url: "/titles/{title_id}/purchases",
113
+ method: HTTP_METHODS.POST,
114
+ },
115
+ purchasesSummary: {
116
+ url: "/titles/{title_id}/purchases/summary",
117
+ method: HTTP_METHODS.GET,
118
+ },
119
+
119
120
  // Advanced analytics sub-routes
120
- purchasesTimeReport: {
121
- url: "/titles/{title_id}/purchases/reports/time",
122
- method: HTTP_METHODS.GET,
123
- },
124
- purchasesLtv30Report: {
125
- url: "/titles/{title_id}/purchases/reports/ltv30",
126
- method: HTTP_METHODS.GET,
127
- },
128
- purchasesCurrencyBreakdown: {
129
- url: "/titles/{title_id}/purchases/reports/currency",
130
- method: HTTP_METHODS.GET,
131
- },
132
- purchasesInstallDistribution: {
133
- url: "/titles/{title_id}/purchases/reports/install-distribution",
134
- method: HTTP_METHODS.GET,
135
- },
136
- purchasesItemTypeStats: {
137
- url: "/titles/{title_id}/purchases/reports/item-type-stats",
138
- method: HTTP_METHODS.GET,
139
- },
140
-
121
+ purchasesTimeReport: {
122
+ url: "/titles/{title_id}/purchases/reports/time",
123
+ method: HTTP_METHODS.GET,
124
+ },
125
+ purchasesLtv30Report: {
126
+ url: "/titles/{title_id}/purchases/reports/ltv30",
127
+ method: HTTP_METHODS.GET,
128
+ },
129
+ purchasesCurrencyBreakdown: {
130
+ url: "/titles/{title_id}/purchases/reports/currency",
131
+ method: HTTP_METHODS.GET,
132
+ },
133
+ purchasesInstallDistribution: {
134
+ url: "/titles/{title_id}/purchases/reports/install-distribution",
135
+ method: HTTP_METHODS.GET,
136
+ },
137
+ purchasesItemTypeStats: {
138
+ url: "/titles/{title_id}/purchases/reports/item-type-stats",
139
+ method: HTTP_METHODS.GET,
140
+ },
141
+
142
+ listAdConversionEvents: {
143
+ url: '/titles/{title_id}/ad-conversion-events',
144
+ method: HTTP_METHODS.GET
145
+ },
146
+ retryAdConversionEvent: {
147
+ url: '/titles/{title_id}/ad-conversion-events/{event_id}/retry',
148
+ method: HTTP_METHODS.POST
149
+ }
150
+
141
151
 
142
152
  };
143
153