glitch-javascript-sdk 1.5.7 → 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 +30 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +18 -0
- package/dist/esm/index.js +30 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +18 -0
- package/package.json +1 -1
- package/src/api/Communities.ts +42 -0
- package/src/routes/CommunitiesRoute.ts +8 -0
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 {
|
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
|
|
|
@@ -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 },
|