glitch-javascript-sdk 1.5.6 → 1.5.8
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 +66 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +18 -0
- package/dist/esm/api/Titles.d.ts +28 -0
- package/dist/esm/index.js +66 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +46 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +42 -0
- package/src/api/Titles.ts +44 -0
- package/src/routes/CommunitiesRoute.ts +8 -0
- package/src/routes/TitlesRoute.ts +2 -1
package/dist/cjs/index.js
CHANGED
|
@@ -19806,6 +19806,14 @@ var CommunitiesRoute = /** @class */ (function () {
|
|
|
19806
19806
|
deleteNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.DELETE },
|
|
19807
19807
|
importNewsletterSubscribers: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/import', method: HTTP_METHODS.POST },
|
|
19808
19808
|
uploadNewsletterBannerImage: { url: '/communities/{community_id}/newsletters/{newsletter_id}/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
19809
|
+
newsletterReports: {
|
|
19810
|
+
url: '/communities/{community_id}/newsletters/{newsletter_id}/reports',
|
|
19811
|
+
method: HTTP_METHODS.GET
|
|
19812
|
+
},
|
|
19813
|
+
newsletterCampaignReports: {
|
|
19814
|
+
url: '/communities/{community_id}/newsletters/{newsletter_id}/reports/campaign',
|
|
19815
|
+
method: HTTP_METHODS.GET
|
|
19816
|
+
},
|
|
19809
19817
|
// Campaigns
|
|
19810
19818
|
listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
|
|
19811
19819
|
createCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.POST },
|
|
@@ -20518,6 +20526,28 @@ var Communities = /** @class */ (function () {
|
|
|
20518
20526
|
Communities.registerNewsletterSubscriber = function (community_id, newsletter_id, data, params) {
|
|
20519
20527
|
return Requests.processRoute(CommunitiesRoute.routes.registerNewsletterSubscriber, data, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
20520
20528
|
};
|
|
20529
|
+
/**
|
|
20530
|
+
* Get newsletter overall reports (subscriber changes, unsubscribes, etc.).
|
|
20531
|
+
*
|
|
20532
|
+
* @param community_id The ID of the community.
|
|
20533
|
+
* @param newsletter_id The ID of the newsletter.
|
|
20534
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
20535
|
+
* @returns Promise with aggregated data
|
|
20536
|
+
*/
|
|
20537
|
+
Communities.newsletterReports = function (community_id, newsletter_id, params) {
|
|
20538
|
+
return Requests.processRoute(CommunitiesRoute.routes.newsletterReports, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
20539
|
+
};
|
|
20540
|
+
/**
|
|
20541
|
+
* Get campaign-level stats for a newsletter.
|
|
20542
|
+
*
|
|
20543
|
+
* @param community_id The ID of the community.
|
|
20544
|
+
* @param newsletter_id The ID of the newsletter.
|
|
20545
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
20546
|
+
* @returns Promise with campaign stats
|
|
20547
|
+
*/
|
|
20548
|
+
Communities.newsletterCampaignReports = function (community_id, newsletter_id, params) {
|
|
20549
|
+
return Requests.processRoute(CommunitiesRoute.routes.newsletterCampaignReports, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
20550
|
+
};
|
|
20521
20551
|
return Communities;
|
|
20522
20552
|
}());
|
|
20523
20553
|
|
|
@@ -22728,6 +22758,8 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
22728
22758
|
addMedia: { url: '/titles/{title_id}/addMedia', method: HTTP_METHODS.POST },
|
|
22729
22759
|
removeMedia: { url: '/titles/{title_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
|
|
22730
22760
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
22761
|
+
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
22762
|
+
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
22731
22763
|
};
|
|
22732
22764
|
return TitlesRoute;
|
|
22733
22765
|
}());
|
|
@@ -22909,9 +22941,43 @@ var Titles = /** @class */ (function () {
|
|
|
22909
22941
|
Titles.removeMedia = function (title_id, media_id, params) {
|
|
22910
22942
|
return Requests.processRoute(TitlesRoute.routes.removeMedia, {}, { title_id: title_id, media_id: media_id }, params);
|
|
22911
22943
|
};
|
|
22944
|
+
/**
|
|
22945
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
22946
|
+
*
|
|
22947
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
22948
|
+
*
|
|
22949
|
+
* @param title_id The ID of the title to update
|
|
22950
|
+
* @param media_order An array of objects, each containing:
|
|
22951
|
+
* - media_id: string (the UUID of the media)
|
|
22952
|
+
* - order: number (the new order/index)
|
|
22953
|
+
* @returns Promise containing the server response
|
|
22954
|
+
*/
|
|
22912
22955
|
Titles.updateMediaOrder = function (title_id, media_order) {
|
|
22913
22956
|
return Requests.processRoute(TitlesRoute.routes.updateMediaOrder, { media_order: media_order }, { title_id: title_id });
|
|
22914
22957
|
};
|
|
22958
|
+
/**
|
|
22959
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
22960
|
+
*
|
|
22961
|
+
* @param title_id The UUID of the title
|
|
22962
|
+
* @param file The CSV or Excel file
|
|
22963
|
+
* @param data Any additional form data, e.g. platform
|
|
22964
|
+
* @returns AxiosPromise
|
|
22965
|
+
*/
|
|
22966
|
+
Titles.importWishlist = function (title_id, file, data, params) {
|
|
22967
|
+
var url = TitlesRoute.routes.importWishlist.url.replace('{title_id}', title_id);
|
|
22968
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
22969
|
+
};
|
|
22970
|
+
/**
|
|
22971
|
+
* Retrieve the wishlist data for a specific title.
|
|
22972
|
+
*
|
|
22973
|
+
* @param title_id The UUID of the title
|
|
22974
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
22975
|
+
* @returns AxiosPromise
|
|
22976
|
+
*/
|
|
22977
|
+
Titles.getWishlist = function (title_id, params) {
|
|
22978
|
+
TitlesRoute.routes.getWishlist.url.replace('{title_id}', title_id);
|
|
22979
|
+
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id: title_id }, params);
|
|
22980
|
+
};
|
|
22915
22981
|
return Titles;
|
|
22916
22982
|
}());
|
|
22917
22983
|
|