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
|
@@ -555,5 +555,23 @@ declare class Communities {
|
|
|
555
555
|
* @returns Promise
|
|
556
556
|
*/
|
|
557
557
|
static registerNewsletterSubscriber<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
558
|
+
/**
|
|
559
|
+
* Get newsletter overall reports (subscriber changes, unsubscribes, etc.).
|
|
560
|
+
*
|
|
561
|
+
* @param community_id The ID of the community.
|
|
562
|
+
* @param newsletter_id The ID of the newsletter.
|
|
563
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
564
|
+
* @returns Promise with aggregated data
|
|
565
|
+
*/
|
|
566
|
+
static newsletterReports<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
567
|
+
/**
|
|
568
|
+
* Get campaign-level stats for a newsletter.
|
|
569
|
+
*
|
|
570
|
+
* @param community_id The ID of the community.
|
|
571
|
+
* @param newsletter_id The ID of the newsletter.
|
|
572
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
573
|
+
* @returns Promise with campaign stats
|
|
574
|
+
*/
|
|
575
|
+
static newsletterCampaignReports<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
558
576
|
}
|
|
559
577
|
export default Communities;
|
package/dist/esm/api/Titles.d.ts
CHANGED
|
@@ -141,9 +141,37 @@ declare class Titles {
|
|
|
141
141
|
* Remove media from a title.
|
|
142
142
|
*/
|
|
143
143
|
static removeMedia<T>(title_id: string, media_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
144
|
+
/**
|
|
145
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
146
|
+
*
|
|
147
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
148
|
+
*
|
|
149
|
+
* @param title_id The ID of the title to update
|
|
150
|
+
* @param media_order An array of objects, each containing:
|
|
151
|
+
* - media_id: string (the UUID of the media)
|
|
152
|
+
* - order: number (the new order/index)
|
|
153
|
+
* @returns Promise containing the server response
|
|
154
|
+
*/
|
|
144
155
|
static updateMediaOrder<T>(title_id: string, media_order: {
|
|
145
156
|
media_id: string;
|
|
146
157
|
order: number;
|
|
147
158
|
}[]): AxiosPromise<Response<T>>;
|
|
159
|
+
/**
|
|
160
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
161
|
+
*
|
|
162
|
+
* @param title_id The UUID of the title
|
|
163
|
+
* @param file The CSV or Excel file
|
|
164
|
+
* @param data Any additional form data, e.g. platform
|
|
165
|
+
* @returns AxiosPromise
|
|
166
|
+
*/
|
|
167
|
+
static importWishlist<T>(title_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
168
|
+
/**
|
|
169
|
+
* Retrieve the wishlist data for a specific title.
|
|
170
|
+
*
|
|
171
|
+
* @param title_id The UUID of the title
|
|
172
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
173
|
+
* @returns AxiosPromise
|
|
174
|
+
*/
|
|
175
|
+
static getWishlist<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
148
176
|
}
|
|
149
177
|
export default Titles;
|
package/dist/esm/index.js
CHANGED
|
@@ -6622,6 +6622,14 @@ var CommunitiesRoute = /** @class */ (function () {
|
|
|
6622
6622
|
deleteNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.DELETE },
|
|
6623
6623
|
importNewsletterSubscribers: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/import', method: HTTP_METHODS.POST },
|
|
6624
6624
|
uploadNewsletterBannerImage: { url: '/communities/{community_id}/newsletters/{newsletter_id}/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
6625
|
+
newsletterReports: {
|
|
6626
|
+
url: '/communities/{community_id}/newsletters/{newsletter_id}/reports',
|
|
6627
|
+
method: HTTP_METHODS.GET
|
|
6628
|
+
},
|
|
6629
|
+
newsletterCampaignReports: {
|
|
6630
|
+
url: '/communities/{community_id}/newsletters/{newsletter_id}/reports/campaign',
|
|
6631
|
+
method: HTTP_METHODS.GET
|
|
6632
|
+
},
|
|
6625
6633
|
// Campaigns
|
|
6626
6634
|
listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
|
|
6627
6635
|
createCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.POST },
|
|
@@ -7334,6 +7342,28 @@ var Communities = /** @class */ (function () {
|
|
|
7334
7342
|
Communities.registerNewsletterSubscriber = function (community_id, newsletter_id, data, params) {
|
|
7335
7343
|
return Requests.processRoute(CommunitiesRoute.routes.registerNewsletterSubscriber, data, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7336
7344
|
};
|
|
7345
|
+
/**
|
|
7346
|
+
* Get newsletter overall reports (subscriber changes, unsubscribes, etc.).
|
|
7347
|
+
*
|
|
7348
|
+
* @param community_id The ID of the community.
|
|
7349
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7350
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
7351
|
+
* @returns Promise with aggregated data
|
|
7352
|
+
*/
|
|
7353
|
+
Communities.newsletterReports = function (community_id, newsletter_id, params) {
|
|
7354
|
+
return Requests.processRoute(CommunitiesRoute.routes.newsletterReports, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7355
|
+
};
|
|
7356
|
+
/**
|
|
7357
|
+
* Get campaign-level stats for a newsletter.
|
|
7358
|
+
*
|
|
7359
|
+
* @param community_id The ID of the community.
|
|
7360
|
+
* @param newsletter_id The ID of the newsletter.
|
|
7361
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
7362
|
+
* @returns Promise with campaign stats
|
|
7363
|
+
*/
|
|
7364
|
+
Communities.newsletterCampaignReports = function (community_id, newsletter_id, params) {
|
|
7365
|
+
return Requests.processRoute(CommunitiesRoute.routes.newsletterCampaignReports, undefined, { community_id: community_id, newsletter_id: newsletter_id }, params);
|
|
7366
|
+
};
|
|
7337
7367
|
return Communities;
|
|
7338
7368
|
}());
|
|
7339
7369
|
|
|
@@ -9544,6 +9574,8 @@ var TitlesRoute = /** @class */ (function () {
|
|
|
9544
9574
|
addMedia: { url: '/titles/{title_id}/addMedia', method: HTTP_METHODS.POST },
|
|
9545
9575
|
removeMedia: { url: '/titles/{title_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
|
|
9546
9576
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
9577
|
+
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
9578
|
+
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
9547
9579
|
};
|
|
9548
9580
|
return TitlesRoute;
|
|
9549
9581
|
}());
|
|
@@ -9725,9 +9757,43 @@ var Titles = /** @class */ (function () {
|
|
|
9725
9757
|
Titles.removeMedia = function (title_id, media_id, params) {
|
|
9726
9758
|
return Requests.processRoute(TitlesRoute.routes.removeMedia, {}, { title_id: title_id, media_id: media_id }, params);
|
|
9727
9759
|
};
|
|
9760
|
+
/**
|
|
9761
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
9762
|
+
*
|
|
9763
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
9764
|
+
*
|
|
9765
|
+
* @param title_id The ID of the title to update
|
|
9766
|
+
* @param media_order An array of objects, each containing:
|
|
9767
|
+
* - media_id: string (the UUID of the media)
|
|
9768
|
+
* - order: number (the new order/index)
|
|
9769
|
+
* @returns Promise containing the server response
|
|
9770
|
+
*/
|
|
9728
9771
|
Titles.updateMediaOrder = function (title_id, media_order) {
|
|
9729
9772
|
return Requests.processRoute(TitlesRoute.routes.updateMediaOrder, { media_order: media_order }, { title_id: title_id });
|
|
9730
9773
|
};
|
|
9774
|
+
/**
|
|
9775
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
9776
|
+
*
|
|
9777
|
+
* @param title_id The UUID of the title
|
|
9778
|
+
* @param file The CSV or Excel file
|
|
9779
|
+
* @param data Any additional form data, e.g. platform
|
|
9780
|
+
* @returns AxiosPromise
|
|
9781
|
+
*/
|
|
9782
|
+
Titles.importWishlist = function (title_id, file, data, params) {
|
|
9783
|
+
var url = TitlesRoute.routes.importWishlist.url.replace('{title_id}', title_id);
|
|
9784
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
9785
|
+
};
|
|
9786
|
+
/**
|
|
9787
|
+
* Retrieve the wishlist data for a specific title.
|
|
9788
|
+
*
|
|
9789
|
+
* @param title_id The UUID of the title
|
|
9790
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
9791
|
+
* @returns AxiosPromise
|
|
9792
|
+
*/
|
|
9793
|
+
Titles.getWishlist = function (title_id, params) {
|
|
9794
|
+
TitlesRoute.routes.getWishlist.url.replace('{title_id}', title_id);
|
|
9795
|
+
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id: title_id }, params);
|
|
9796
|
+
};
|
|
9731
9797
|
return Titles;
|
|
9732
9798
|
}());
|
|
9733
9799
|
|