glitch-javascript-sdk 2.7.2 → 2.7.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
@@ -7460,6 +7460,18 @@ declare class Crm {
7460
7460
  * Get win rates and response time analytics.
7461
7461
  */
7462
7462
  static getPerformanceStats<T>(): AxiosPromise<Response<T>>;
7463
+ /**
7464
+ * Get the analytics on what users indcated they were interested in.
7465
+ */
7466
+ static getInterestStats<T>(): AxiosPromise<Response<T>>;
7467
+ /**
7468
+ * Update an existing contact's information.
7469
+ */
7470
+ static updateContact<T>(contact_id: string, data: object): AxiosPromise<Response<T>>;
7471
+ /**
7472
+ * Remove a contact from a lead.
7473
+ */
7474
+ static deleteContact<T>(contact_id: string): AxiosPromise<Response<T>>;
7463
7475
  }
7464
7476
 
7465
7477
  interface Route {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "description": "Javascript SDK for Glitch",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
package/src/api/Crm.ts CHANGED
@@ -129,6 +129,28 @@ class Crm {
129
129
  public static getPerformanceStats<T>(): AxiosPromise<Response<T>> {
130
130
  return Requests.processRoute(CrmRoute.routes.performanceStats);
131
131
  }
132
+
133
+ /**
134
+ * Get the analytics on what users indcated they were interested in.
135
+ */
136
+ public static getInterestStats<T>(): AxiosPromise<Response<T>> {
137
+ return Requests.processRoute(CrmRoute.routes.getInterestStats);
138
+ }
139
+
140
+ /**
141
+ * Update an existing contact's information.
142
+ */
143
+ public static updateContact<T>(contact_id: string, data: object): AxiosPromise<Response<T>> {
144
+ return Requests.processRoute(CrmRoute.routes.updateContact, data, { contact_id });
145
+ }
146
+
147
+ /**
148
+ * Remove a contact from a lead.
149
+ */
150
+ public static deleteContact<T>(contact_id: string): AxiosPromise<Response<T>> {
151
+ return Requests.processRoute(CrmRoute.routes.deleteContact, {}, { contact_id });
152
+ }
153
+
132
154
  }
133
155
 
134
156
  export default Crm;
@@ -21,6 +21,9 @@ class CrmRoute {
21
21
  recordStaffReply: { url: '/admin/crm/leads/{lead_id}/replied', method: HTTP_METHODS.POST },
22
22
  bulkApprove: { url: '/admin/crm/contacts/bulk-approve', method: HTTP_METHODS.POST },
23
23
 
24
+ updateContact: { url: '/admin/crm/contacts/{contact_id}', method: HTTP_METHODS.PUT },
25
+ deleteContact: { url: '/admin/crm/contacts/{contact_id}', method: HTTP_METHODS.DELETE },
26
+
24
27
  // Automation Triggers
25
28
  triggerSourcing: { url: '/admin/crm/automation/source', method: HTTP_METHODS.POST },
26
29
  triggerSync: { url: '/admin/crm/automation/sync', method: HTTP_METHODS.POST },
@@ -28,6 +31,7 @@ class CrmRoute {
28
31
  // Analytics
29
32
  funnelStats: { url: '/admin/crm/analytics/funnel', method: HTTP_METHODS.GET },
30
33
  performanceStats: { url: '/admin/crm/analytics/performance', method: HTTP_METHODS.GET },
34
+ getInterestStats: { url: '/admin/crm/analytics/interests', method: HTTP_METHODS.GET },
31
35
  };
32
36
  }
33
37