glitch-javascript-sdk 2.7.3 → 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
@@ -7464,6 +7464,14 @@ declare class Crm {
7464
7464
  * Get the analytics on what users indcated they were interested in.
7465
7465
  */
7466
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>>;
7467
7475
  }
7468
7476
 
7469
7477
  interface Route {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitch-javascript-sdk",
3
- "version": "2.7.3",
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
@@ -136,6 +136,21 @@ class Crm {
136
136
  public static getInterestStats<T>(): AxiosPromise<Response<T>> {
137
137
  return Requests.processRoute(CrmRoute.routes.getInterestStats);
138
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
+
139
154
  }
140
155
 
141
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 },