glitch-javascript-sdk 3.0.2 → 3.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.
package/dist/index.d.ts CHANGED
@@ -4410,7 +4410,7 @@ declare class Titles {
4410
4410
  * Initializes a play session. Handles age-gating and license verification.
4411
4411
  * Returns the CDN URL for WASM/iFrame or Signaling URL for Pixel Streaming.
4412
4412
  */
4413
- static getPlaySession<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
4413
+ static getPlaySession<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
4414
4414
  /**
4415
4415
  * List all developer payouts for a title.
4416
4416
  */
@@ -5478,6 +5478,16 @@ declare class Subscriptions {
5478
5478
  * @returns promise
5479
5479
  */
5480
5480
  static redeemGift<T>(redemption_code: string): AxiosPromise<Response<T>>;
5481
+ /**
5482
+ * Cancel an unredeemed gift and trigger a refund.
5483
+ * Only the user who purchased the gift (the giver) can perform this action.
5484
+ *
5485
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
5486
+ *
5487
+ * @param gift_id The UUID of the gift to cancel.
5488
+ * @returns promise
5489
+ */
5490
+ static cancelGift<T>(gift_id: string): AxiosPromise<Response<T>>;
5481
5491
  }
5482
5492
 
5483
5493
  declare class Messages {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -162,6 +162,18 @@ class Subscriptions {
162
162
  return Requests.processRoute(SubscriptionsRoute.routes.redeemGift, { redemption_code });
163
163
  }
164
164
 
165
+ /**
166
+ * Cancel an unredeemed gift and trigger a refund.
167
+ * Only the user who purchased the gift (the giver) can perform this action.
168
+ *
169
+ * @see https://api.glitch.fun/api/documentation#/Subscriptions/cancelGift
170
+ *
171
+ * @param gift_id The UUID of the gift to cancel.
172
+ * @returns promise
173
+ */
174
+ public static cancelGift<T>(gift_id: string): AxiosPromise<Response<T>> {
175
+ return Requests.processRoute(SubscriptionsRoute.routes.cancelGift, {}, { gift_id });
176
+ }
165
177
 
166
178
  }
167
179
 
package/src/api/Titles.ts CHANGED
@@ -952,8 +952,8 @@ class Titles {
952
952
  * Initializes a play session. Handles age-gating and license verification.
953
953
  * Returns the CDN URL for WASM/iFrame or Signaling URL for Pixel Streaming.
954
954
  */
955
- public static getPlaySession<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
956
- return Requests.processRoute(TitlesRoute.routes.getPlaySession, {}, { title_id }, params);
955
+ public static getPlaySession<T>(title_id: string, data?: object, params?: Record<string, any>): AxiosPromise<Response<T>> {
956
+ return Requests.processRoute(TitlesRoute.routes.getPlaySession, data, { title_id }, params);
957
957
  }
958
958
 
959
959
  /**
@@ -26,6 +26,7 @@ class SubscriptionsRoute {
26
26
 
27
27
  purchaseGift: { url: '/subscriptions/gifts/purchase', method: HTTP_METHODS.POST },
28
28
  redeemGift: { url: '/subscriptions/gifts/redeem', method: HTTP_METHODS.POST },
29
+ cancelGift: { url: '/subscriptions/gifts/{gift_id}', method: HTTP_METHODS.DELETE },
29
30
 
30
31
  };
31
32
 
@@ -183,7 +183,7 @@ class TitlesRoute {
183
183
  // Aegis Deployment
184
184
  getDeploymentUploadUrl: { url: '/titles/{title_id}/deployments/presigned-url', method: HTTP_METHODS.POST },
185
185
  confirmDeployment: { url: '/titles/{title_id}/deployments/confirm', method: HTTP_METHODS.POST },
186
- getPlaySession: { url: '/titles/{title_id}/play', method: HTTP_METHODS.GET },
186
+ getPlaySession: { url: '/titles/{title_id}/play', method: HTTP_METHODS.POST },
187
187
 
188
188
  initiateMultipartUpload: { url: '/titles/{title_id}/deployments/multipart/initiate', method: HTTP_METHODS.POST },
189
189
  getMultipartUrls: { url: '/titles/{title_id}/deployments/multipart/urls', method: HTTP_METHODS.POST },