glitch-javascript-sdk 3.0.1 → 3.0.2
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 +83 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Posts.d.ts +20 -0
- package/dist/esm/api/Subscriptions.d.ts +18 -0
- package/dist/esm/api/Users.d.ts +18 -0
- package/dist/esm/index.js +83 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +56 -0
- package/package.json +1 -1
- package/src/api/Posts.ts +35 -0
- package/src/api/Subscriptions.ts +24 -0
- package/src/api/Users.ts +24 -0
- package/src/routes/PostsRoute.ts +16 -11
- package/src/routes/SubscriptionsRoute.ts +3 -0
- package/src/routes/UserRoutes.ts +3 -0
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,8 @@ 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 },
|
|
27019
27080
|
};
|
|
27020
27081
|
return SubscriptionsRoute;
|
|
27021
27082
|
}());
|
|
@@ -27143,6 +27204,28 @@ var Subscriptions = /** @class */ (function () {
|
|
|
27143
27204
|
Subscriptions.refundLicense = function (license_id) {
|
|
27144
27205
|
return Requests.processRoute(SubscriptionsRoute.routes.refundLicense, {}, { license_id: license_id });
|
|
27145
27206
|
};
|
|
27207
|
+
/**
|
|
27208
|
+
* Purchase a game or subscription as a gift for another user.
|
|
27209
|
+
*
|
|
27210
|
+
* @see https://api.glitch.fun/api/documentation#/Subscriptions/purchaseGift
|
|
27211
|
+
*
|
|
27212
|
+
* @param data { gift_type: 'premium'|'rental'|'subscription', payment_method_id: string, title_id?: string, recipient_id?: string, recipient_email?: string, recipient_name?: string }
|
|
27213
|
+
* @returns promise
|
|
27214
|
+
*/
|
|
27215
|
+
Subscriptions.purchaseGift = function (data) {
|
|
27216
|
+
return Requests.processRoute(SubscriptionsRoute.routes.purchaseGift, data);
|
|
27217
|
+
};
|
|
27218
|
+
/**
|
|
27219
|
+
* Redeem a gift code to grant access to a game or subscription.
|
|
27220
|
+
*
|
|
27221
|
+
* @see https://api.glitch.fun/api/documentation#/Subscriptions/redeemGift
|
|
27222
|
+
*
|
|
27223
|
+
* @param redemption_code The unique GLITCH-XXXX-XXXX code.
|
|
27224
|
+
* @returns promise
|
|
27225
|
+
*/
|
|
27226
|
+
Subscriptions.redeemGift = function (redemption_code) {
|
|
27227
|
+
return Requests.processRoute(SubscriptionsRoute.routes.redeemGift, { redemption_code: redemption_code });
|
|
27228
|
+
};
|
|
27146
27229
|
return Subscriptions;
|
|
27147
27230
|
}());
|
|
27148
27231
|
|