glitch-javascript-sdk 2.6.3 → 2.6.4

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
@@ -5432,88 +5432,60 @@ declare class Newsletters {
5432
5432
  static joinDiscordMarketplaceWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5433
5433
  /**
5434
5434
  * List all newsletter campaigns (Admin only).
5435
- *
5436
- * @param params Query parameters for pagination and filtering.
5437
- * @returns Promise
5438
5435
  */
5439
5436
  static listCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5440
5437
  /**
5441
5438
  * Create a new newsletter campaign draft (Admin only).
5442
- *
5443
- * @param data { subject, content_html, content_json }
5444
- * @returns Promise
5445
5439
  */
5446
5440
  static createCampaign<T>(data: object): AxiosPromise<Response<T>>;
5447
5441
  /**
5448
5442
  * Retrieve a specific newsletter campaign (Admin only).
5449
- *
5450
- * @param id The UUID of the campaign.
5451
- * @returns Promise
5452
5443
  */
5453
5444
  static viewCampaign<T>(id: string): AxiosPromise<Response<T>>;
5454
5445
  /**
5455
5446
  * Update a newsletter campaign draft (Admin only).
5456
- *
5457
- * @param id The UUID of the campaign.
5458
- * @param data The updated campaign data.
5459
- * @returns Promise
5460
5447
  */
5461
5448
  static updateCampaign<T>(id: string, data: object): AxiosPromise<Response<T>>;
5462
5449
  /**
5463
- * Get analytics for a specific campaign (Admin only).
5464
- * Returns open rates, click rates, and human vs proxy metrics.
5465
- *
5466
- * @param id The UUID of the campaign.
5467
- * @returns Promise
5450
+ * Delete a newsletter campaign (Admin only).
5468
5451
  */
5469
- static getCampaignStats<T>(id: string): AxiosPromise<Response<T>>;
5452
+ static deleteCampaign<T>(id: string): AxiosPromise<Response<T>>;
5470
5453
  /**
5471
- * Trigger the delivery of a newsletter campaign to all active subscribers (Admin only).
5472
- *
5473
- * @param id The UUID of the campaign.
5474
- * @returns Promise
5454
+ * Get high-level analytics for a specific campaign (Admin only).
5475
5455
  */
5476
- static sendCampaign<T>(id: string): AxiosPromise<Response<T>>;
5456
+ static getCampaignStats<T>(id: string): AxiosPromise<Response<T>>;
5477
5457
  /**
5478
- * List all newsletter subscribers (Admin only).
5479
- *
5480
- * @param params Query parameters for pagination and filtering.
5481
- * @returns Promise
5458
+ * Get detailed delivery and open logs for a campaign (Admin only).
5482
5459
  */
5483
- static listSubscribers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5460
+ static getCampaignLogs<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5484
5461
  /**
5485
- * Delete a newsletter campaign (Admin only).
5462
+ * Trigger the delivery of a newsletter campaign to all active subscribers (Admin only).
5486
5463
  */
5487
- static deleteCampaign<T>(id: string): AxiosPromise<Response<T>>;
5464
+ static sendCampaign<T>(id: string): AxiosPromise<Response<T>>;
5488
5465
  /**
5489
5466
  * Send a test email of a campaign to a specific address (Admin only).
5490
5467
  */
5491
5468
  static sendTestEmail<T>(id: string, email: string): AxiosPromise<Response<T>>;
5492
5469
  /**
5493
- * Get detailed delivery and open logs for a campaign (Admin only).
5470
+ * List all newsletter subscribers (Admin only).
5494
5471
  */
5495
- static getDetailedLogs<T>(id: string, params?: object): AxiosPromise<Response<T>>;
5472
+ static listSubscribers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5496
5473
  /**
5497
- * Manually create a new subscriber (Admin only).
5474
+ * Manually create a new newsletter subscriber (Admin only).
5498
5475
  */
5499
5476
  static createSubscriber<T>(data: object): AxiosPromise<Response<T>>;
5500
5477
  /**
5501
- * Update a subscriber's details or status (Admin only).
5478
+ * Retrieve a specific subscriber's details (Admin only).
5479
+ */
5480
+ static viewSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5481
+ /**
5482
+ * Update a subscriber's information or status (Admin only).
5502
5483
  */
5503
5484
  static updateSubscriber<T>(id: string, data: object): AxiosPromise<Response<T>>;
5504
5485
  /**
5505
- * Delete a subscriber (Admin only).
5486
+ * Permanently delete a subscriber from the system (Admin only).
5506
5487
  */
5507
5488
  static deleteSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5508
- /**
5509
- * Retrieve a specific subscriber's details (Admin only).
5510
- *
5511
- * @see https://api.glitch.fun/api/documentation#/Newsletter%20Admin/showNewsletterSubscriber
5512
- *
5513
- * @param id The UUID of the subscriber.
5514
- * @returns Promise
5515
- */
5516
- static viewSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5517
5489
  }
5518
5490
 
5519
5491
  declare class PlayTests {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.6.3",
3
+ "version": "2.6.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -49,11 +49,10 @@ class Newsletters {
49
49
  return Requests.processRoute(NewslettersRoutes.routes.joinDiscordMarketplaceWaitlist, data, undefined, params);
50
50
  }
51
51
 
52
+ // --- ADMINISTRATIVE CAMPAIGN METHODS ---
53
+
52
54
  /**
53
55
  * List all newsletter campaigns (Admin only).
54
- *
55
- * @param params Query parameters for pagination and filtering.
56
- * @returns Promise
57
56
  */
58
57
  public static listCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
59
58
  return Requests.processRoute(NewslettersRoutes.routes.listCampaigns, undefined, undefined, params);
@@ -61,9 +60,6 @@ class Newsletters {
61
60
 
62
61
  /**
63
62
  * Create a new newsletter campaign draft (Admin only).
64
- *
65
- * @param data { subject, content_html, content_json }
66
- * @returns Promise
67
63
  */
68
64
  public static createCampaign<T>(data: object): AxiosPromise<Response<T>> {
69
65
  return Requests.processRoute(NewslettersRoutes.routes.createCampaign, data);
@@ -71,9 +67,6 @@ class Newsletters {
71
67
 
72
68
  /**
73
69
  * Retrieve a specific newsletter campaign (Admin only).
74
- *
75
- * @param id The UUID of the campaign.
76
- * @returns Promise
77
70
  */
78
71
  public static viewCampaign<T>(id: string): AxiosPromise<Response<T>> {
79
72
  return Requests.processRoute(NewslettersRoutes.routes.viewCampaign, undefined, { id });
@@ -81,51 +74,37 @@ class Newsletters {
81
74
 
82
75
  /**
83
76
  * Update a newsletter campaign draft (Admin only).
84
- *
85
- * @param id The UUID of the campaign.
86
- * @param data The updated campaign data.
87
- * @returns Promise
88
77
  */
89
78
  public static updateCampaign<T>(id: string, data: object): AxiosPromise<Response<T>> {
90
79
  return Requests.processRoute(NewslettersRoutes.routes.updateCampaign, data, { id });
91
80
  }
92
81
 
93
82
  /**
94
- * Get analytics for a specific campaign (Admin only).
95
- * Returns open rates, click rates, and human vs proxy metrics.
96
- *
97
- * @param id The UUID of the campaign.
98
- * @returns Promise
83
+ * Delete a newsletter campaign (Admin only).
99
84
  */
100
- public static getCampaignStats<T>(id: string): AxiosPromise<Response<T>> {
101
- return Requests.processRoute(NewslettersRoutes.routes.getStats, undefined, { id });
85
+ public static deleteCampaign<T>(id: string): AxiosPromise<Response<T>> {
86
+ return Requests.processRoute(NewslettersRoutes.routes.deleteCampaign, undefined, { id });
102
87
  }
103
88
 
104
89
  /**
105
- * Trigger the delivery of a newsletter campaign to all active subscribers (Admin only).
106
- *
107
- * @param id The UUID of the campaign.
108
- * @returns Promise
90
+ * Get high-level analytics for a specific campaign (Admin only).
109
91
  */
110
- public static sendCampaign<T>(id: string): AxiosPromise<Response<T>> {
111
- return Requests.processRoute(NewslettersRoutes.routes.sendCampaign, undefined, { id });
92
+ public static getCampaignStats<T>(id: string): AxiosPromise<Response<T>> {
93
+ return Requests.processRoute(NewslettersRoutes.routes.getCampaignStats, undefined, { id });
112
94
  }
113
95
 
114
96
  /**
115
- * List all newsletter subscribers (Admin only).
116
- *
117
- * @param params Query parameters for pagination and filtering.
118
- * @returns Promise
97
+ * Get detailed delivery and open logs for a campaign (Admin only).
119
98
  */
120
- public static listSubscribers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
121
- return Requests.processRoute(NewslettersRoutes.routes.listSubscribers, undefined, undefined, params);
99
+ public static getCampaignLogs<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
100
+ return Requests.processRoute(NewslettersRoutes.routes.getCampaignLogs, undefined, { id }, params);
122
101
  }
123
102
 
124
103
  /**
125
- * Delete a newsletter campaign (Admin only).
104
+ * Trigger the delivery of a newsletter campaign to all active subscribers (Admin only).
126
105
  */
127
- public static deleteCampaign<T>(id: string): AxiosPromise<Response<T>> {
128
- return Requests.processRoute(NewslettersRoutes.routes.deleteCampaign, undefined, { id });
106
+ public static sendCampaign<T>(id: string): AxiosPromise<Response<T>> {
107
+ return Requests.processRoute(NewslettersRoutes.routes.sendCampaign, undefined, { id });
129
108
  }
130
109
 
131
110
  /**
@@ -135,45 +114,42 @@ class Newsletters {
135
114
  return Requests.processRoute(NewslettersRoutes.routes.sendTest, { email }, { id });
136
115
  }
137
116
 
117
+
118
+ // --- ADMINISTRATIVE SUBSCRIBER METHODS ---
119
+
138
120
  /**
139
- * Get detailed delivery and open logs for a campaign (Admin only).
121
+ * List all newsletter subscribers (Admin only).
140
122
  */
141
- public static getDetailedLogs<T>(id: string, params?: object): AxiosPromise<Response<T>> {
142
- return Requests.processRoute(NewslettersRoutes.routes.getLogs, undefined, { id }, params);
123
+ public static listSubscribers<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
124
+ return Requests.processRoute(NewslettersRoutes.routes.listSubscribers, undefined, undefined, params);
143
125
  }
144
126
 
145
127
  /**
146
- * Manually create a new subscriber (Admin only).
128
+ * Manually create a new newsletter subscriber (Admin only).
147
129
  */
148
130
  public static createSubscriber<T>(data: object): AxiosPromise<Response<T>> {
149
131
  return Requests.processRoute(NewslettersRoutes.routes.createSubscriber, data);
150
132
  }
151
133
 
152
134
  /**
153
- * Update a subscriber's details or status (Admin only).
135
+ * Retrieve a specific subscriber's details (Admin only).
154
136
  */
155
- public static updateSubscriber<T>(id: string, data: object): AxiosPromise<Response<T>> {
156
- return Requests.processRoute(NewslettersRoutes.routes.updateSubscriber, data, { id });
137
+ public static viewSubscriber<T>(id: string): AxiosPromise<Response<T>> {
138
+ return Requests.processRoute(NewslettersRoutes.routes.viewSubscriber, undefined, { id });
157
139
  }
158
140
 
159
141
  /**
160
- * Delete a subscriber (Admin only).
142
+ * Update a subscriber's information or status (Admin only).
161
143
  */
162
- public static deleteSubscriber<T>(id: string): AxiosPromise<Response<T>> {
163
- return Requests.processRoute(NewslettersRoutes.routes.deleteSubscriber, undefined, { id });
144
+ public static updateSubscriber<T>(id: string, data: object): AxiosPromise<Response<T>> {
145
+ return Requests.processRoute(NewslettersRoutes.routes.updateSubscriber, data, { id });
164
146
  }
165
147
 
166
-
167
148
  /**
168
- * Retrieve a specific subscriber's details (Admin only).
169
- *
170
- * @see https://api.glitch.fun/api/documentation#/Newsletter%20Admin/showNewsletterSubscriber
171
- *
172
- * @param id The UUID of the subscriber.
173
- * @returns Promise
149
+ * Permanently delete a subscriber from the system (Admin only).
174
150
  */
175
- public static viewSubscriber<T>(id: string): AxiosPromise<Response<T>> {
176
- return Requests.processRoute(NewslettersRoutes.routes.viewSubscriber, undefined, { id });
151
+ public static deleteSubscriber<T>(id: string): AxiosPromise<Response<T>> {
152
+ return Requests.processRoute(NewslettersRoutes.routes.deleteSubscriber, undefined, { id });
177
153
  }
178
154
 
179
155
 
@@ -9,20 +9,25 @@ class NewslettersRoutes {
9
9
  joinRaffleWaitlist: { url: '/newsletters/joinRaffleWaitlist', method: HTTP_METHODS.POST },
10
10
  joinDiscordMarketplaceWaitlist: { url: '/newsletters/joinDiscordMarketplaceWaitlist', method: HTTP_METHODS.POST },
11
11
 
12
- // --- New Admin Routes ---
13
- listCampaigns: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.GET },
14
- createCampaign: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.POST },
15
- viewCampaign: { url: '/admin/newsletters/campaigns/{id}', method: HTTP_METHODS.GET },
16
- updateCampaign: { url: '/admin/newsletters/campaigns/{id}', method: HTTP_METHODS.PUT },
17
- getStats: { url: '/admin/newsletters/campaigns/{id}/stats', method: HTTP_METHODS.GET },
18
- sendCampaign: { url: '/admin/newsletters/campaigns/{id}/send', method: HTTP_METHODS.POST },
19
- listSubscribers: { url: '/admin/newsletters/subscribers', method: HTTP_METHODS.GET },
12
+ // --- Admin Campaign Management ---
13
+ listCampaigns: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.GET },
14
+ createCampaign: { url: '/admin/newsletters/campaigns', method: HTTP_METHODS.POST },
15
+ viewCampaign: { url: '/admin/newsletters/campaigns/{id}', method: HTTP_METHODS.GET },
16
+ updateCampaign: { url: '/admin/newsletters/campaigns/{id}', method: HTTP_METHODS.PUT },
17
+ deleteCampaign: { url: '/admin/newsletters/campaigns/{id}', method: HTTP_METHODS.DELETE },
18
+
19
+ // --- Admin Campaign Actions & Analytics ---
20
+ getCampaignStats: { url: '/admin/newsletters/campaigns/{id}/stats', method: HTTP_METHODS.GET },
21
+ getCampaignLogs: { url: '/admin/newsletters/campaigns/{id}/logs', method: HTTP_METHODS.GET },
22
+ sendCampaign: { url: '/admin/newsletters/campaigns/{id}/send', method: HTTP_METHODS.POST },
23
+ sendTest: { url: '/admin/newsletters/campaigns/{id}/test', method: HTTP_METHODS.POST },
20
24
 
21
- // --- Subscriber Management (Admin) ---
22
- createSubscriber: { url: '/admin/newsletters/subscribers', method: HTTP_METHODS.POST },
23
- viewSubscriber: { url: '/admin/newsletters/subscribers/{id}', method: HTTP_METHODS.GET },
24
- updateSubscriber: { url: '/admin/newsletters/subscribers/{id}', method: HTTP_METHODS.PUT },
25
- deleteSubscriber: { url: '/admin/newsletters/subscribers/{id}', method: HTTP_METHODS.DELETE },
25
+ // --- Admin Subscriber Management ---
26
+ listSubscribers: { url: '/admin/newsletters/subscribers', method: HTTP_METHODS.GET },
27
+ createSubscriber: { url: '/admin/newsletters/subscribers', method: HTTP_METHODS.POST },
28
+ viewSubscriber: { url: '/admin/newsletters/subscribers/{id}', method: HTTP_METHODS.GET },
29
+ updateSubscriber: { url: '/admin/newsletters/subscribers/{id}', method: HTTP_METHODS.PUT },
30
+ deleteSubscriber: { url: '/admin/newsletters/subscribers/{id}', method: HTTP_METHODS.DELETE },
26
31
  };
27
32
 
28
33
  }