glitch-javascript-sdk 3.2.17 → 3.2.19

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
@@ -8382,6 +8382,54 @@ declare class Crm {
8382
8382
  * Remove a contact from a lead.
8383
8383
  */
8384
8384
  static deleteContact<T>(contact_id: string): AxiosPromise<Response<T>>;
8385
+ /**
8386
+ * List CRM newsletter and mass-email campaigns.
8387
+ */
8388
+ static listCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
8389
+ /**
8390
+ * Create a CRM campaign draft with filters, exclusions, and optional variants.
8391
+ */
8392
+ static createCampaign<T>(data: object): AxiosPromise<Response<T>>;
8393
+ /**
8394
+ * View a CRM campaign. Pass include_recipients in params for a small recipient sample.
8395
+ */
8396
+ static viewCampaign<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
8397
+ /**
8398
+ * Update an editable CRM campaign draft or paused campaign.
8399
+ */
8400
+ static updateCampaign<T>(campaign_id: string, data: object): AxiosPromise<Response<T>>;
8401
+ /**
8402
+ * Delete an unsent CRM campaign draft.
8403
+ */
8404
+ static deleteCampaign<T>(campaign_id: string): AxiosPromise<Response<T>>;
8405
+ /**
8406
+ * Preview campaign audience filters and exclusions without creating recipients.
8407
+ */
8408
+ static previewCampaignAudience<T>(data: object): AxiosPromise<Response<T>>;
8409
+ /**
8410
+ * Read CRM campaign queue depth and Azure/system email rate-limit windows.
8411
+ */
8412
+ static getCampaignDeliveryStatus<T>(): AxiosPromise<Response<T>>;
8413
+ /**
8414
+ * Materialize and queue a CRM campaign, optionally with a limit or dispatch=false.
8415
+ */
8416
+ static sendCampaign<T>(campaign_id: string, data?: object): AxiosPromise<Response<T>>;
8417
+ /**
8418
+ * Refresh and read CRM campaign engagement, reply, and conversion stats.
8419
+ */
8420
+ static getCampaignStats<T>(campaign_id: string): AxiosPromise<Response<T>>;
8421
+ /**
8422
+ * List campaign recipient audit rows with optional status or variant filters.
8423
+ */
8424
+ static listCampaignRecipients<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>>;
8425
+ /**
8426
+ * Validate external prospect rows and preview field mapping/dedupe outcomes.
8427
+ */
8428
+ static previewCampaignProspectImport<T>(prospects: object[], options?: Record<string, any>): AxiosPromise<Response<T>>;
8429
+ /**
8430
+ * Import external prospects into CRM leads and contacts for future campaigns.
8431
+ */
8432
+ static importCampaignProspects<T>(prospects: object[], options?: Record<string, any>): AxiosPromise<Response<T>>;
8385
8433
  }
8386
8434
 
8387
8435
  type MultiplayerLobbyType = 'public' | 'invisible' | 'friends_only' | 'private';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "3.2.17",
3
+ "version": "3.2.19",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/api/Crm.ts CHANGED
@@ -151,6 +151,90 @@ class Crm {
151
151
  return Requests.processRoute(CrmRoute.routes.deleteContact, {}, { contact_id });
152
152
  }
153
153
 
154
+ /**
155
+ * List CRM newsletter and mass-email campaigns.
156
+ */
157
+ public static listCampaigns<T>(params?: Record<string, any>): AxiosPromise<Response<T>> {
158
+ return Requests.processRoute(CrmRoute.routes.listCampaigns, undefined, undefined, params);
159
+ }
160
+
161
+ /**
162
+ * Create a CRM campaign draft with filters, exclusions, and optional variants.
163
+ */
164
+ public static createCampaign<T>(data: object): AxiosPromise<Response<T>> {
165
+ return Requests.processRoute(CrmRoute.routes.createCampaign, data);
166
+ }
167
+
168
+ /**
169
+ * View a CRM campaign. Pass include_recipients in params for a small recipient sample.
170
+ */
171
+ public static viewCampaign<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
172
+ return Requests.processRoute(CrmRoute.routes.viewCampaign, {}, { campaign_id }, params);
173
+ }
174
+
175
+ /**
176
+ * Update an editable CRM campaign draft or paused campaign.
177
+ */
178
+ public static updateCampaign<T>(campaign_id: string, data: object): AxiosPromise<Response<T>> {
179
+ return Requests.processRoute(CrmRoute.routes.updateCampaign, data, { campaign_id });
180
+ }
181
+
182
+ /**
183
+ * Delete an unsent CRM campaign draft.
184
+ */
185
+ public static deleteCampaign<T>(campaign_id: string): AxiosPromise<Response<T>> {
186
+ return Requests.processRoute(CrmRoute.routes.deleteCampaign, {}, { campaign_id });
187
+ }
188
+
189
+ /**
190
+ * Preview campaign audience filters and exclusions without creating recipients.
191
+ */
192
+ public static previewCampaignAudience<T>(data: object): AxiosPromise<Response<T>> {
193
+ return Requests.processRoute(CrmRoute.routes.previewCampaignAudience, data);
194
+ }
195
+
196
+ /**
197
+ * Read CRM campaign queue depth and Azure/system email rate-limit windows.
198
+ */
199
+ public static getCampaignDeliveryStatus<T>(): AxiosPromise<Response<T>> {
200
+ return Requests.processRoute(CrmRoute.routes.getCampaignDeliveryStatus);
201
+ }
202
+
203
+ /**
204
+ * Materialize and queue a CRM campaign, optionally with a limit or dispatch=false.
205
+ */
206
+ public static sendCampaign<T>(campaign_id: string, data: object = {}): AxiosPromise<Response<T>> {
207
+ return Requests.processRoute(CrmRoute.routes.sendCampaign, data, { campaign_id });
208
+ }
209
+
210
+ /**
211
+ * Refresh and read CRM campaign engagement, reply, and conversion stats.
212
+ */
213
+ public static getCampaignStats<T>(campaign_id: string): AxiosPromise<Response<T>> {
214
+ return Requests.processRoute(CrmRoute.routes.getCampaignStats, {}, { campaign_id });
215
+ }
216
+
217
+ /**
218
+ * List campaign recipient audit rows with optional status or variant filters.
219
+ */
220
+ public static listCampaignRecipients<T>(campaign_id: string, params?: Record<string, any>): AxiosPromise<Response<T>> {
221
+ return Requests.processRoute(CrmRoute.routes.listCampaignRecipients, {}, { campaign_id }, params);
222
+ }
223
+
224
+ /**
225
+ * Validate external prospect rows and preview field mapping/dedupe outcomes.
226
+ */
227
+ public static previewCampaignProspectImport<T>(prospects: object[], options: Record<string, any> = {}): AxiosPromise<Response<T>> {
228
+ return Requests.processRoute(CrmRoute.routes.previewCampaignProspectImport, { prospects, ...options });
229
+ }
230
+
231
+ /**
232
+ * Import external prospects into CRM leads and contacts for future campaigns.
233
+ */
234
+ public static importCampaignProspects<T>(prospects: object[], options: Record<string, any> = {}): AxiosPromise<Response<T>> {
235
+ return Requests.processRoute(CrmRoute.routes.importCampaignProspects, { prospects, ...options });
236
+ }
237
+
154
238
  }
155
239
 
156
- export default Crm;
240
+ export default Crm;
@@ -24,6 +24,20 @@ class CrmRoute {
24
24
  updateContact: { url: '/admin/crm/contacts/{contact_id}', method: HTTP_METHODS.PUT },
25
25
  deleteContact: { url: '/admin/crm/contacts/{contact_id}', method: HTTP_METHODS.DELETE },
26
26
 
27
+ // Newsletter and Campaign Management
28
+ listCampaigns: { url: '/admin/crm/campaigns', method: HTTP_METHODS.GET },
29
+ createCampaign: { url: '/admin/crm/campaigns', method: HTTP_METHODS.POST },
30
+ viewCampaign: { url: '/admin/crm/campaigns/{campaign_id}', method: HTTP_METHODS.GET },
31
+ updateCampaign: { url: '/admin/crm/campaigns/{campaign_id}', method: HTTP_METHODS.PUT },
32
+ deleteCampaign: { url: '/admin/crm/campaigns/{campaign_id}', method: HTTP_METHODS.DELETE },
33
+ previewCampaignAudience: { url: '/admin/crm/campaigns/preview', method: HTTP_METHODS.POST },
34
+ getCampaignDeliveryStatus: { url: '/admin/crm/campaigns/delivery-status', method: HTTP_METHODS.GET },
35
+ sendCampaign: { url: '/admin/crm/campaigns/{campaign_id}/send', method: HTTP_METHODS.POST },
36
+ getCampaignStats: { url: '/admin/crm/campaigns/{campaign_id}/stats', method: HTTP_METHODS.GET },
37
+ listCampaignRecipients: { url: '/admin/crm/campaigns/{campaign_id}/recipients', method: HTTP_METHODS.GET },
38
+ previewCampaignProspectImport: { url: '/admin/crm/campaigns/import-prospects/preview', method: HTTP_METHODS.POST },
39
+ importCampaignProspects: { url: '/admin/crm/campaigns/import-prospects', method: HTTP_METHODS.POST },
40
+
27
41
  // Automation Triggers
28
42
  triggerSourcing: { url: '/admin/crm/automation/source', method: HTTP_METHODS.POST },
29
43
  triggerSync: { url: '/admin/crm/automation/sync', method: HTTP_METHODS.POST },
@@ -35,4 +49,4 @@ class CrmRoute {
35
49
  };
36
50
  }
37
51
 
38
- export default CrmRoute;
52
+ export default CrmRoute;