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/index.d.ts
CHANGED
|
@@ -1197,6 +1197,24 @@ declare class Communities {
|
|
|
1197
1197
|
* @returns Promise
|
|
1198
1198
|
*/
|
|
1199
1199
|
static registerNewsletterSubscriber<T>(community_id: string, newsletter_id: string, data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Get newsletter overall reports (subscriber changes, unsubscribes, etc.).
|
|
1202
|
+
*
|
|
1203
|
+
* @param community_id The ID of the community.
|
|
1204
|
+
* @param newsletter_id The ID of the newsletter.
|
|
1205
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
1206
|
+
* @returns Promise with aggregated data
|
|
1207
|
+
*/
|
|
1208
|
+
static newsletterReports<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Get campaign-level stats for a newsletter.
|
|
1211
|
+
*
|
|
1212
|
+
* @param community_id The ID of the community.
|
|
1213
|
+
* @param newsletter_id The ID of the newsletter.
|
|
1214
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
1215
|
+
* @returns Promise with campaign stats
|
|
1216
|
+
*/
|
|
1217
|
+
static newsletterCampaignReports<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
1200
1218
|
}
|
|
1201
1219
|
|
|
1202
1220
|
declare class Users {
|
|
@@ -2862,10 +2880,38 @@ declare class Titles {
|
|
|
2862
2880
|
* Remove media from a title.
|
|
2863
2881
|
*/
|
|
2864
2882
|
static removeMedia<T>(title_id: string, media_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2883
|
+
/**
|
|
2884
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
2885
|
+
*
|
|
2886
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
2887
|
+
*
|
|
2888
|
+
* @param title_id The ID of the title to update
|
|
2889
|
+
* @param media_order An array of objects, each containing:
|
|
2890
|
+
* - media_id: string (the UUID of the media)
|
|
2891
|
+
* - order: number (the new order/index)
|
|
2892
|
+
* @returns Promise containing the server response
|
|
2893
|
+
*/
|
|
2865
2894
|
static updateMediaOrder<T>(title_id: string, media_order: {
|
|
2866
2895
|
media_id: string;
|
|
2867
2896
|
order: number;
|
|
2868
2897
|
}[]): AxiosPromise<Response<T>>;
|
|
2898
|
+
/**
|
|
2899
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
2900
|
+
*
|
|
2901
|
+
* @param title_id The UUID of the title
|
|
2902
|
+
* @param file The CSV or Excel file
|
|
2903
|
+
* @param data Any additional form data, e.g. platform
|
|
2904
|
+
* @returns AxiosPromise
|
|
2905
|
+
*/
|
|
2906
|
+
static importWishlist<T>(title_id: string, file: File | Blob, data?: Record<string, any>, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2907
|
+
/**
|
|
2908
|
+
* Retrieve the wishlist data for a specific title.
|
|
2909
|
+
*
|
|
2910
|
+
* @param title_id The UUID of the title
|
|
2911
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
2912
|
+
* @returns AxiosPromise
|
|
2913
|
+
*/
|
|
2914
|
+
static getWishlist<T>(title_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
|
|
2869
2915
|
}
|
|
2870
2916
|
|
|
2871
2917
|
declare class Campaigns {
|
package/package.json
CHANGED
package/src/api/Communities.ts
CHANGED
|
@@ -788,6 +788,48 @@ class Communities {
|
|
|
788
788
|
return Requests.processRoute(CommunitiesRoute.routes.registerNewsletterSubscriber, data, { community_id, newsletter_id }, params);
|
|
789
789
|
}
|
|
790
790
|
|
|
791
|
+
/**
|
|
792
|
+
* Get newsletter overall reports (subscriber changes, unsubscribes, etc.).
|
|
793
|
+
*
|
|
794
|
+
* @param community_id The ID of the community.
|
|
795
|
+
* @param newsletter_id The ID of the newsletter.
|
|
796
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
797
|
+
* @returns Promise with aggregated data
|
|
798
|
+
*/
|
|
799
|
+
public static newsletterReports<T>(
|
|
800
|
+
community_id: string,
|
|
801
|
+
newsletter_id: string,
|
|
802
|
+
params?: Record<string, any>
|
|
803
|
+
): AxiosPromise<Response<T>> {
|
|
804
|
+
return Requests.processRoute(
|
|
805
|
+
CommunitiesRoute.routes.newsletterReports,
|
|
806
|
+
undefined,
|
|
807
|
+
{ community_id, newsletter_id },
|
|
808
|
+
params
|
|
809
|
+
);
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/**
|
|
813
|
+
* Get campaign-level stats for a newsletter.
|
|
814
|
+
*
|
|
815
|
+
* @param community_id The ID of the community.
|
|
816
|
+
* @param newsletter_id The ID of the newsletter.
|
|
817
|
+
* @param params Optional query params (start_date, end_date, etc).
|
|
818
|
+
* @returns Promise with campaign stats
|
|
819
|
+
*/
|
|
820
|
+
public static newsletterCampaignReports<T>(
|
|
821
|
+
community_id: string,
|
|
822
|
+
newsletter_id: string,
|
|
823
|
+
params?: Record<string, any>
|
|
824
|
+
): AxiosPromise<Response<T>> {
|
|
825
|
+
return Requests.processRoute(
|
|
826
|
+
CommunitiesRoute.routes.newsletterCampaignReports,
|
|
827
|
+
undefined,
|
|
828
|
+
{ community_id, newsletter_id },
|
|
829
|
+
params
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
|
|
791
833
|
|
|
792
834
|
|
|
793
835
|
|
package/src/api/Titles.ts
CHANGED
|
@@ -210,6 +210,17 @@ class Titles {
|
|
|
210
210
|
return Requests.processRoute(TitlesRoute.routes.removeMedia, {}, { title_id: title_id, media_id: media_id }, params);
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
+
/**
|
|
214
|
+
* Update the ordering of media items (images, videos, etc.) for a title.
|
|
215
|
+
*
|
|
216
|
+
* @see https://api.glitch.fun/api/documentation#/Titles/updateMediaOrder
|
|
217
|
+
*
|
|
218
|
+
* @param title_id The ID of the title to update
|
|
219
|
+
* @param media_order An array of objects, each containing:
|
|
220
|
+
* - media_id: string (the UUID of the media)
|
|
221
|
+
* - order: number (the new order/index)
|
|
222
|
+
* @returns Promise containing the server response
|
|
223
|
+
*/
|
|
213
224
|
public static updateMediaOrder<T>(title_id: string, media_order: { media_id: string, order: number }[]): AxiosPromise<Response<T>> {
|
|
214
225
|
return Requests.processRoute(
|
|
215
226
|
TitlesRoute.routes.updateMediaOrder,
|
|
@@ -218,6 +229,39 @@ class Titles {
|
|
|
218
229
|
);
|
|
219
230
|
}
|
|
220
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Upload a CSV/Excel file containing wishlist data for a title.
|
|
234
|
+
*
|
|
235
|
+
* @param title_id The UUID of the title
|
|
236
|
+
* @param file The CSV or Excel file
|
|
237
|
+
* @param data Any additional form data, e.g. platform
|
|
238
|
+
* @returns AxiosPromise
|
|
239
|
+
*/
|
|
240
|
+
public static importWishlist<T>(
|
|
241
|
+
title_id: string,
|
|
242
|
+
file: File | Blob,
|
|
243
|
+
data?: Record<string, any>,
|
|
244
|
+
params?: Record<string, any>
|
|
245
|
+
): AxiosPromise<Response<T>> {
|
|
246
|
+
let url = TitlesRoute.routes.importWishlist.url.replace('{title_id}', title_id);
|
|
247
|
+
return Requests.uploadFile(url, 'file', file, data, params);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Retrieve the wishlist data for a specific title.
|
|
252
|
+
*
|
|
253
|
+
* @param title_id The UUID of the title
|
|
254
|
+
* @param params Optional query params, e.g. { platform: 'steam', start_date: '2025-01-01', end_date: '2025-01-31'}
|
|
255
|
+
* @returns AxiosPromise
|
|
256
|
+
*/
|
|
257
|
+
public static getWishlist<T>(
|
|
258
|
+
title_id: string,
|
|
259
|
+
params?: Record<string, any>
|
|
260
|
+
): AxiosPromise<Response<T>> {
|
|
261
|
+
let url = TitlesRoute.routes.getWishlist.url.replace('{title_id}', title_id);
|
|
262
|
+
return Requests.processRoute(TitlesRoute.routes.getWishlist, {}, { title_id }, params);
|
|
263
|
+
}
|
|
264
|
+
|
|
221
265
|
}
|
|
222
266
|
|
|
223
267
|
export default Titles;
|
|
@@ -45,6 +45,14 @@ class CommunitiesRoute {
|
|
|
45
45
|
deleteNewsletter: { url: '/communities/{community_id}/newsletters/{newsletter_id}', method: HTTP_METHODS.DELETE },
|
|
46
46
|
importNewsletterSubscribers: { url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/import', method: HTTP_METHODS.POST },
|
|
47
47
|
uploadNewsletterBannerImage: { url: '/communities/{community_id}/newsletters/{newsletter_id}/uploadBannerImage', method: HTTP_METHODS.POST },
|
|
48
|
+
newsletterReports: {
|
|
49
|
+
url: '/communities/{community_id}/newsletters/{newsletter_id}/reports',
|
|
50
|
+
method: HTTP_METHODS.GET
|
|
51
|
+
},
|
|
52
|
+
newsletterCampaignReports: {
|
|
53
|
+
url: '/communities/{community_id}/newsletters/{newsletter_id}/reports/campaign',
|
|
54
|
+
method: HTTP_METHODS.GET
|
|
55
|
+
},
|
|
48
56
|
|
|
49
57
|
// Campaigns
|
|
50
58
|
listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
|
|
@@ -18,7 +18,8 @@ class TitlesRoute {
|
|
|
18
18
|
addMedia: { url: '/titles/{title_id}/addMedia', method: HTTP_METHODS.POST },
|
|
19
19
|
removeMedia: { url: '/titles/{title_id}/removeMedia/{media_id}', method: HTTP_METHODS.DELETE },
|
|
20
20
|
updateMediaOrder: { url: '/titles/{title_id}/updateMediaOrder', method: HTTP_METHODS.POST },
|
|
21
|
-
|
|
21
|
+
importWishlist: { url: '/titles/{title_id}/wishlist/import', method: HTTP_METHODS.POST },
|
|
22
|
+
getWishlist: { url: '/titles/{title_id}/wishlist', method: HTTP_METHODS.GET },
|
|
22
23
|
};
|
|
23
24
|
|
|
24
25
|
}
|