glitch-javascript-sdk 2.1.7 → 2.1.9

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,18 @@ 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>>;
3940
3952
  }
3941
3953
 
3942
3954
  declare class Campaigns {
@@ -5179,7 +5191,7 @@ declare class PlayTests {
5179
5191
 
5180
5192
  interface SteamCapsuleCropRequest {
5181
5193
  media_id: string;
5182
- capsule_type: 'header' | 'small' | 'main' | 'vertical' | 'library' | 'library_header' | 'library_hero' | 'page_background';
5194
+ capsule_type: 'header' | 'small' | 'main' | 'vertical' | 'library' | 'library_header' | 'library_hero' | 'page_background' | 'screenshot' | 'app_icon' | 'shortcut_icon';
5183
5195
  crop_x?: number;
5184
5196
  crop_y?: number;
5185
5197
  crop_width?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.1.7",
3
+ "version": "2.1.9",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Media.ts CHANGED
@@ -5,7 +5,7 @@ import { AxiosProgressEvent, AxiosPromise } from "axios";
5
5
 
6
6
  export interface SteamCapsuleCropRequest {
7
7
  media_id: string;
8
- capsule_type: 'header' | 'small' | 'main' | 'vertical' | 'library' | 'library_header' | 'library_hero' | 'page_background';
8
+ capsule_type: 'header' | 'small' | 'main' | 'vertical' | 'library' | 'library_header' | 'library_hero' | 'page_background' | 'screenshot' | 'app_icon' | 'shortcut_icon';
9
9
  crop_x?: number;
10
10
  crop_y?: number;
11
11
  crop_width?: number;
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,20 @@ 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
+ }
724
738
 
725
739
  }
726
740
 
@@ -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