glitch-javascript-sdk 2.6.3 → 2.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
@@ -4950,6 +4950,21 @@ declare class Campaigns {
4950
4950
  stages?: string[];
4951
4951
  status?: string;
4952
4952
  }): AxiosPromise<Response<T>>;
4953
+ /**
4954
+ * Find and save Fansly creators for a specific campaign.
4955
+ *
4956
+ * @see CampaignCreatorSourcingController@findAndSaveFanslyCreators
4957
+ *
4958
+ * @param campaign_id The UUID of the campaign.
4959
+ * @param data Parameters for sourcing.
4960
+ * @param data.query The search term (e.g., 'gaming', 'cosplay'). Defaults to 'gaming'.
4961
+ * @param data.pages Number of pages to crawl (25 results per page). Defaults to 10.
4962
+ * @returns promise
4963
+ */
4964
+ static sourcingFindAndSaveFanslyCreators<T>(campaign_id: string, data: {
4965
+ query?: string;
4966
+ pages?: number;
4967
+ }): AxiosPromise<Response<T>>;
4953
4968
  }
4954
4969
 
4955
4970
  declare class Subscriptions {
@@ -5432,88 +5447,60 @@ declare class Newsletters {
5432
5447
  static joinDiscordMarketplaceWaitlist<T>(data: object, params?: Record<string, any>): AxiosPromise<Response<T>>;
5433
5448
  /**
5434
5449
  * List all newsletter campaigns (Admin only).
5435
- *
5436
- * @param params Query parameters for pagination and filtering.
5437
- * @returns Promise
5438
5450
  */
5439
5451
  static listCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5440
5452
  /**
5441
5453
  * Create a new newsletter campaign draft (Admin only).
5442
- *
5443
- * @param data { subject, content_html, content_json }
5444
- * @returns Promise
5445
5454
  */
5446
5455
  static createCampaign<T>(data: object): AxiosPromise<Response<T>>;
5447
5456
  /**
5448
5457
  * Retrieve a specific newsletter campaign (Admin only).
5449
- *
5450
- * @param id The UUID of the campaign.
5451
- * @returns Promise
5452
5458
  */
5453
5459
  static viewCampaign<T>(id: string): AxiosPromise<Response<T>>;
5454
5460
  /**
5455
5461
  * 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
5462
  */
5461
5463
  static updateCampaign<T>(id: string, data: object): AxiosPromise<Response<T>>;
5462
5464
  /**
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
5465
+ * Delete a newsletter campaign (Admin only).
5468
5466
  */
5469
- static getCampaignStats<T>(id: string): AxiosPromise<Response<T>>;
5467
+ static deleteCampaign<T>(id: string): AxiosPromise<Response<T>>;
5470
5468
  /**
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
5469
+ * Get high-level analytics for a specific campaign (Admin only).
5475
5470
  */
5476
- static sendCampaign<T>(id: string): AxiosPromise<Response<T>>;
5471
+ static getCampaignStats<T>(id: string): AxiosPromise<Response<T>>;
5477
5472
  /**
5478
- * List all newsletter subscribers (Admin only).
5479
- *
5480
- * @param params Query parameters for pagination and filtering.
5481
- * @returns Promise
5473
+ * Get detailed delivery and open logs for a campaign (Admin only).
5482
5474
  */
5483
- static listSubscribers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5475
+ static getCampaignLogs<T>(id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
5484
5476
  /**
5485
- * Delete a newsletter campaign (Admin only).
5477
+ * Trigger the delivery of a newsletter campaign to all active subscribers (Admin only).
5486
5478
  */
5487
- static deleteCampaign<T>(id: string): AxiosPromise<Response<T>>;
5479
+ static sendCampaign<T>(id: string): AxiosPromise<Response<T>>;
5488
5480
  /**
5489
5481
  * Send a test email of a campaign to a specific address (Admin only).
5490
5482
  */
5491
5483
  static sendTestEmail<T>(id: string, email: string): AxiosPromise<Response<T>>;
5492
5484
  /**
5493
- * Get detailed delivery and open logs for a campaign (Admin only).
5485
+ * List all newsletter subscribers (Admin only).
5494
5486
  */
5495
- static getDetailedLogs<T>(id: string, params?: object): AxiosPromise<Response<T>>;
5487
+ static listSubscribers<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
5496
5488
  /**
5497
- * Manually create a new subscriber (Admin only).
5489
+ * Manually create a new newsletter subscriber (Admin only).
5498
5490
  */
5499
5491
  static createSubscriber<T>(data: object): AxiosPromise<Response<T>>;
5500
5492
  /**
5501
- * Update a subscriber's details or status (Admin only).
5493
+ * Retrieve a specific subscriber's details (Admin only).
5502
5494
  */
5503
- static updateSubscriber<T>(id: string, data: object): AxiosPromise<Response<T>>;
5495
+ static viewSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5504
5496
  /**
5505
- * Delete a subscriber (Admin only).
5497
+ * Update a subscriber's information or status (Admin only).
5506
5498
  */
5507
- static deleteSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5499
+ static updateSubscriber<T>(id: string, data: object): AxiosPromise<Response<T>>;
5508
5500
  /**
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
5501
+ * Permanently delete a subscriber from the system (Admin only).
5515
5502
  */
5516
- static viewSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5503
+ static deleteSubscriber<T>(id: string): AxiosPromise<Response<T>>;
5517
5504
  }
5518
5505
 
5519
5506
  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.5",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1045,6 +1045,21 @@ class Campaigns {
1045
1045
  return Requests.processRoute(CampaignsRoute.routes.exportInfluencerInvites, data, { campaign_id: campaign_id });
1046
1046
  }
1047
1047
 
1048
+ /**
1049
+ * Find and save Fansly creators for a specific campaign.
1050
+ *
1051
+ * @see CampaignCreatorSourcingController@findAndSaveFanslyCreators
1052
+ *
1053
+ * @param campaign_id The UUID of the campaign.
1054
+ * @param data Parameters for sourcing.
1055
+ * @param data.query The search term (e.g., 'gaming', 'cosplay'). Defaults to 'gaming'.
1056
+ * @param data.pages Number of pages to crawl (25 results per page). Defaults to 10.
1057
+ * @returns promise
1058
+ */
1059
+ public static sourcingFindAndSaveFanslyCreators<T>(campaign_id: string, data: { query?: string, pages?: number }): AxiosPromise<Response<T>> {
1060
+ return Requests.processRoute(CampaignsRoute.routes.sourcingFindAndSaveFanslyCreators, data, { campaign_id });
1061
+ }
1062
+
1048
1063
  }
1049
1064
 
1050
1065
  export default Campaigns;
@@ -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
 
@@ -98,6 +98,10 @@ class CampaignsRoute {
98
98
  url: '/campaigns/{campaign_id}/influencers/invites/export',
99
99
  method: HTTP_METHODS.POST
100
100
  },
101
+ sourcingFindAndSaveFanslyCreators: {
102
+ url: '/campaigns/{campaign_id}/sourcing/find-save-fansly-creators',
103
+ method: HTTP_METHODS.POST
104
+ },
101
105
 
102
106
 
103
107
  };
@@ -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
  }