glitch-javascript-sdk 3.0.1 → 3.0.3

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/cjs/index.js CHANGED
@@ -21999,6 +21999,8 @@ var UserRoutes = /** @class */ (function () {
21999
21999
  modifyMedia: { url: '/users/me/media/{id}/modify', method: HTTP_METHODS.POST },
22000
22000
  suggestSmartTrim: { url: '/users/me/media/{id}/smart-trim', method: HTTP_METHODS.GET },
22001
22001
  shareMedia: { url: '/users/me/media/{id}/share', method: HTTP_METHODS.POST },
22002
+ sentGifts: { url: '/users/me/gifts/sent', method: HTTP_METHODS.GET },
22003
+ receivedGifts: { url: '/users/me/gifts/received', method: HTTP_METHODS.GET },
22002
22004
  };
22003
22005
  return UserRoutes;
22004
22006
  }());
@@ -22565,6 +22567,28 @@ var Users = /** @class */ (function () {
22565
22567
  Users.shareMedia = function (id, data) {
22566
22568
  return Requests.processRoute(UserRoutes.routes.shareMedia, data, { id: id });
22567
22569
  };
22570
+ /**
22571
+ * List all gifts purchased by the current user.
22572
+ *
22573
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userSentGifts
22574
+ *
22575
+ * @param params Optional filters: title_id, status, gift_type, min_amount, max_amount, start_date, end_date, sort_by, sort_order.
22576
+ * @returns promise
22577
+ */
22578
+ Users.sentGifts = function (params) {
22579
+ return Requests.processRoute(UserRoutes.routes.sentGifts, undefined, undefined, params);
22580
+ };
22581
+ /**
22582
+ * List all gifts received by the current user.
22583
+ *
22584
+ * @see https://api.glitch.fun/api/documentation#/Users%20Route/userReceivedGifts
22585
+ *
22586
+ * @param params Optional filters: title_id, status, start_date, sort_by.
22587
+ * @returns promise
22588
+ */
22589
+ Users.receivedGifts = function (params) {
22590
+ return Requests.processRoute(UserRoutes.routes.receivedGifts, undefined, undefined, params);
22591
+ };
22568
22592
  return Users;
22569
22593
  }());
22570
22594
 
@@ -23690,6 +23714,11 @@ var PostsRoute = /** @class */ (function () {
23690
23714
  update: { url: '/posts/{post_id}', method: HTTP_METHODS.PUT },
23691
23715
  delete: { url: '/posts/{post_id}', method: HTTP_METHODS.DELETE },
23692
23716
  toggleInteraction: { url: '/posts/{post_id}/toggleInteraction', method: HTTP_METHODS.POST },
23717
+ join: { url: '/posts/{post_id}/join', method: HTTP_METHODS.POST },
23718
+ follow: { url: '/posts/{post_id}/follow', method: HTTP_METHODS.POST },
23719
+ leave: { url: '/posts/{post_id}/leave', method: HTTP_METHODS.DELETE },
23720
+ resolve: { url: '/posts/{post_id}/resolve', method: HTTP_METHODS.POST },
23721
+ updatePreferences: { url: '/posts/{post_id}/participants/me', method: HTTP_METHODS.PUT },
23693
23722
  };
23694
23723
  return PostsRoute;
23695
23724
  }());
@@ -23855,6 +23884,36 @@ var Posts = /** @class */ (function () {
23855
23884
  Posts.toggleInteraction = function (post_id, data, params) {
23856
23885
  return Requests.processRoute(PostsRoute.routes.toggleInteraction, data, { post_id: post_id }, params);
23857
23886
  };
23887
+ /**
23888
+ * Join a Play Together session.
23889
+ */
23890
+ Posts.joinSession = function (post_id, data) {
23891
+ return Requests.processRoute(PostsRoute.routes.join, data, { post_id: post_id });
23892
+ };
23893
+ /**
23894
+ * Follow a bug report for updates.
23895
+ */
23896
+ Posts.followBug = function (post_id, data) {
23897
+ return Requests.processRoute(PostsRoute.routes.follow, data, { post_id: post_id });
23898
+ };
23899
+ /**
23900
+ * Update notification preferences for a post.
23901
+ */
23902
+ Posts.updatePreferences = function (post_id, data) {
23903
+ return Requests.processRoute(PostsRoute.routes.updatePreferences, data, { post_id: post_id });
23904
+ };
23905
+ /**
23906
+ * Leave a session or unfollow a bug.
23907
+ */
23908
+ Posts.leave = function (post_id) {
23909
+ return Requests.processRoute(PostsRoute.routes.leave, {}, { post_id: post_id });
23910
+ };
23911
+ /**
23912
+ * Mark a bug as resolved (Admin only).
23913
+ */
23914
+ Posts.resolveBug = function (post_id) {
23915
+ return Requests.processRoute(PostsRoute.routes.resolve, {}, { post_id: post_id });
23916
+ };
23858
23917
  return Posts;
23859
23918
  }());
23860
23919
 
@@ -27016,6 +27075,9 @@ var SubscriptionsRoute = /** @class */ (function () {
27016
27075
  purchaseLicense: { url: '/titles/{title_id}/purchase', method: HTTP_METHODS.POST },
27017
27076
  listMyLicenses: { url: '/subscriptions/my-licenses', method: HTTP_METHODS.GET },
27018
27077
  refundLicense: { url: '/subscriptions/licenses/{license_id}/refund', method: HTTP_METHODS.POST },
27078
+ purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
27079
+ redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
27080
+ cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
27019
27081
  };
27020
27082
  return SubscriptionsRoute;
27021
27083
  }());
@@ -27143,6 +27205,40 @@ var Subscriptions = /** @class */ (function () {
27143
27205
  Subscriptions.refundLicense = function (license_id) {
27144
27206
  return Requests.processRoute(SubscriptionsRoute.routes.refundLicense, {}, { license_id: license_id });
27145
27207
  };
27208
+ /**
27209
+ * Purchase a game or subscription as a gift for another user.
27210
+ *
27211
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/purchaseGift
27212
+ *
27213
+ * @param data { gift_type: 'premium'|'rental'|'subscription', payment_method_id: string, title_id?: string, recipient_id?: string, recipient_email?: string, recipient_name?: string }
27214
+ * @returns promise
27215
+ */
27216
+ Subscriptions.purchaseGift = function (data) {
27217
+ return Requests.processRoute(SubscriptionsRoute.routes.purchaseGift, data);
27218
+ };
27219
+ /**
27220
+ * Redeem a gift code to grant access to a game or subscription.
27221
+ *
27222
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/redeemGift
27223
+ *
27224
+ * @param redemption_code The unique GLITCH-XXXX-XXXX code.
27225
+ * @returns promise
27226
+ */
27227
+ Subscriptions.redeemGift = function (redemption_code) {
27228
+ return Requests.processRoute(SubscriptionsRoute.routes.redeemGift, { redemption_code: redemption_code });
27229
+ };
27230
+ /**
27231
+ * Cancel an unredeemed gift and trigger a refund.
27232
+ * Only the user who purchased the gift (the giver) can perform this action.
27233
+ *
27234
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
27235
+ *
27236
+ * @param gift_id The UUID of the gift to cancel.
27237
+ * @returns promise
27238
+ */
27239
+ Subscriptions.cancelGift = function (gift_id) {
27240
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id: gift_id });
27241
+ };
27146
27242
  return Subscriptions;
27147
27243
  }());
27148
27244