glitch-javascript-sdk 1.6.4 → 1.6.5

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/index.d.ts CHANGED
@@ -1223,6 +1223,19 @@ declare class Communities {
1223
1223
  * @param params Optional date-range filter (start_date, end_date, etc.)
1224
1224
  */
1225
1225
  static newsletterSubscriberTrend<T>(community_id: string, newsletter_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
1226
+ /**
1227
+ * Export subscribers for a specific newsletter.
1228
+ * The file is generated asynchronously on the server and
1229
+ * the user is emailed a link to download the file.
1230
+ *
1231
+ * @param community_id The ID of the community.
1232
+ * @param newsletter_id The ID of the newsletter.
1233
+ * @param data Export options (format: 'csv' or 'xlsx').
1234
+ * @returns Promise
1235
+ */
1236
+ static exportNewsletterSubscribers<T>(community_id: string, newsletter_id: string, data: {
1237
+ format: 'csv' | 'xlsx';
1238
+ }, params?: Record<string, any>): AxiosPromise<Response<T>>;
1226
1239
  }
1227
1240
 
1228
1241
  declare class Users {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "1.6.4",
3
+ "version": "1.6.5",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -850,7 +850,29 @@ class Communities {
850
850
  );
851
851
  }
852
852
 
853
-
853
+ /**
854
+ * Export subscribers for a specific newsletter.
855
+ * The file is generated asynchronously on the server and
856
+ * the user is emailed a link to download the file.
857
+ *
858
+ * @param community_id The ID of the community.
859
+ * @param newsletter_id The ID of the newsletter.
860
+ * @param data Export options (format: 'csv' or 'xlsx').
861
+ * @returns Promise
862
+ */
863
+ public static exportNewsletterSubscribers<T>(
864
+ community_id: string,
865
+ newsletter_id: string,
866
+ data: { format: 'csv' | 'xlsx' },
867
+ params?: Record<string, any>
868
+ ): AxiosPromise<Response<T>> {
869
+ return Requests.processRoute(
870
+ CommunitiesRoute.routes.exportNewsletterSubscribers,
871
+ data,
872
+ { community_id, newsletter_id },
873
+ params
874
+ );
875
+ }
854
876
 
855
877
 
856
878
  }
@@ -59,6 +59,11 @@ class CommunitiesRoute {
59
59
  method: HTTP_METHODS.GET
60
60
  },
61
61
 
62
+ exportNewsletterSubscribers: {
63
+ url: '/communities/{community_id}/newsletters/{newsletter_id}/subscribers/export',
64
+ method: HTTP_METHODS.POST
65
+ },
66
+
62
67
  // Campaigns
63
68
  listCampaigns: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.GET },
64
69
  createCampaign: { url: '/communities/{community_id}/newsletters/{newsletter_id}/campaigns', method: HTTP_METHODS.POST },