glitch-javascript-sdk 2.7.1 → 2.7.2

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.
@@ -652,10 +652,14 @@ declare class Communities {
652
652
  * @param community_id The ID of the community.
653
653
  * @param params Should include { start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
654
654
  */
655
- static getCustomStatement<T>(community_id: string, params: {
656
- start_date: string;
657
- end_date: string;
658
- }): AxiosPromise<Response<T>>;
655
+ /**
656
+ * Generate a custom date-range statement for reimbursement.
657
+ *
658
+ * @param community_id The ID of the community.
659
+ * @param startDate 'YYYY-MM-DD'
660
+ * @param endDate 'YYYY-MM-DD'
661
+ */
662
+ static getCustomStatement<T>(community_id: string, startDate: string, endDate: string): AxiosPromise<Response<T>>;
659
663
  /**
660
664
  * List all Stripe invoices for the community.
661
665
  */
@@ -0,0 +1,77 @@
1
+ import Response from "../util/Response";
2
+ import { AxiosPromise } from "axios";
3
+ declare class Crm {
4
+ /**
5
+ * List and search CRM leads.
6
+ */
7
+ static listLeads<T>(params?: Record<string, any>): AxiosPromise<Response<T>>;
8
+ /**
9
+ * Manually create a new lead.
10
+ */
11
+ static createLead<T>(data: object): AxiosPromise<Response<T>>;
12
+ /**
13
+ * View a single lead with contacts and activity timeline.
14
+ */
15
+ static viewLead<T>(lead_id: string): AxiosPromise<Response<T>>;
16
+ /**
17
+ * Update lead information.
18
+ */
19
+ static updateLead<T>(lead_id: string, data: object): AxiosPromise<Response<T>>;
20
+ /**
21
+ * Delete a lead (Soft Delete).
22
+ */
23
+ static deleteLead<T>(lead_id: string): AxiosPromise<Response<T>>;
24
+ /**
25
+ * Assign a Super Admin as the owner of a lead.
26
+ */
27
+ static assignOwner<T>(lead_id: string, user_id: string): AxiosPromise<Response<T>>;
28
+ /**
29
+ * Manually trigger Apollo enrichment and website scraping for a lead.
30
+ */
31
+ static enrichLead<T>(lead_id: string): AxiosPromise<Response<T>>;
32
+ /**
33
+ * Approve a specific contact to start the Apollo email sequence.
34
+ */
35
+ static approveContact<T>(contact_id: string): AxiosPromise<Response<T>>;
36
+ /**
37
+ * Manually update the pipeline status of a lead.
38
+ */
39
+ static updateStatus<T>(lead_id: string, status: string, note?: string): AxiosPromise<Response<T>>;
40
+ /**
41
+ * Add a manual note to the lead's activity timeline.
42
+ */
43
+ static addNote<T>(lead_id: string, content: string): AxiosPromise<Response<T>>;
44
+ /**
45
+ * Manually add a contact person to a lead.
46
+ */
47
+ static addContact<T>(lead_id: string, data: object): AxiosPromise<Response<T>>;
48
+ /**
49
+ * Mark a lead as lost and record the reason.
50
+ */
51
+ static markAsLost<T>(lead_id: string, reason: string): AxiosPromise<Response<T>>;
52
+ /**
53
+ * Record that a staff member has manually replied to a prospect.
54
+ */
55
+ static recordStaffReply<T>(lead_id: string): AxiosPromise<Response<T>>;
56
+ /**
57
+ * Approve a batch of contacts for outreach.
58
+ */
59
+ static bulkApprove<T>(contact_ids: string[]): AxiosPromise<Response<T>>;
60
+ /**
61
+ * Manually trigger the bi-weekly sourcing automation.
62
+ */
63
+ static triggerSourcing<T>(): AxiosPromise<Response<T>>;
64
+ /**
65
+ * Manually trigger the Apollo status and conversion sync.
66
+ */
67
+ static triggerSync<T>(): AxiosPromise<Response<T>>;
68
+ /**
69
+ * Get funnel conversion percentages.
70
+ */
71
+ static getFunnelStats<T>(): AxiosPromise<Response<T>>;
72
+ /**
73
+ * Get win rates and response time analytics.
74
+ */
75
+ static getPerformanceStats<T>(): AxiosPromise<Response<T>>;
76
+ }
77
+ export default Crm;
@@ -41,6 +41,7 @@ import TwitchReporting from "./TwitchReporting";
41
41
  import Raffles from "./Raffles";
42
42
  import DiscordMarketplace from "./DiscordMarketplace";
43
43
  import Education from "./Education";
44
+ import Crm from "./Crm";
44
45
  export { Ads };
45
46
  export { AccessKeys };
46
47
  export { Auth };
@@ -84,3 +85,4 @@ export { TwitchReporting };
84
85
  export { Raffles };
85
86
  export { DiscordMarketplace };
86
87
  export { Education };
88
+ export { Crm };
@@ -41,6 +41,7 @@ import { TwitchReporting } from './api';
41
41
  import { Raffles } from './api';
42
42
  import { DiscordMarketplace } from './api';
43
43
  import { Education } from './api';
44
+ import { Crm } from './api';
44
45
  import Requests from "./util/Requests";
45
46
  import Parser from "./util/Parser";
46
47
  import Session from "./util/Session";
@@ -103,6 +104,7 @@ declare class Glitch {
103
104
  Raffles: typeof Raffles;
104
105
  DiscordMarketplace: typeof DiscordMarketplace;
105
106
  Education: typeof Education;
107
+ Crm: typeof Crm;
106
108
  };
107
109
  static util: {
108
110
  Requests: typeof Requests;
package/dist/esm/index.js CHANGED
@@ -8680,7 +8680,19 @@ var Communities = /** @class */ (function () {
8680
8680
  * @param community_id The ID of the community.
8681
8681
  * @param params Should include { start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
8682
8682
  */
8683
- Communities.getCustomStatement = function (community_id, params) {
8683
+ /**
8684
+ * Generate a custom date-range statement for reimbursement.
8685
+ *
8686
+ * @param community_id The ID of the community.
8687
+ * @param startDate 'YYYY-MM-DD'
8688
+ * @param endDate 'YYYY-MM-DD'
8689
+ */
8690
+ Communities.getCustomStatement = function (community_id, startDate, endDate) {
8691
+ // Wrap the strings into a named object so Requests.get can serialize them correctly
8692
+ var params = {
8693
+ start_date: startDate,
8694
+ end_date: endDate
8695
+ };
8684
8696
  return Requests.processRoute(CommunitiesRoute.routes.getCustomStatement, undefined, { community_id: community_id }, params);
8685
8697
  };
8686
8698
  /**
@@ -17101,6 +17113,150 @@ var Education = /** @class */ (function () {
17101
17113
  return Education;
17102
17114
  }());
17103
17115
 
17116
+ var CrmRoute = /** @class */ (function () {
17117
+ function CrmRoute() {
17118
+ }
17119
+ CrmRoute.routes = {
17120
+ // Lead Management
17121
+ listLeads: { url: '/admin/crm/leads', method: HTTP_METHODS.GET },
17122
+ createLead: { url: '/admin/crm/leads', method: HTTP_METHODS.POST },
17123
+ viewLead: { url: '/admin/crm/leads/{lead_id}', method: HTTP_METHODS.GET },
17124
+ updateLead: { url: '/admin/crm/leads/{lead_id}', method: HTTP_METHODS.PUT },
17125
+ deleteLead: { url: '/admin/crm/leads/{lead_id}', method: HTTP_METHODS.DELETE },
17126
+ // Pipeline Actions
17127
+ assignOwner: { url: '/admin/crm/leads/{lead_id}/assign', method: HTTP_METHODS.POST },
17128
+ enrichLead: { url: '/admin/crm/leads/{lead_id}/enrich', method: HTTP_METHODS.POST },
17129
+ approveContact: { url: '/admin/crm/contacts/{contact_id}/approve', method: HTTP_METHODS.POST },
17130
+ updateStatus: { url: '/admin/crm/leads/{lead_id}/status', method: HTTP_METHODS.POST },
17131
+ addNote: { url: '/admin/crm/leads/{lead_id}/notes', method: HTTP_METHODS.POST },
17132
+ addContact: { url: '/admin/crm/leads/{lead_id}/contacts', method: HTTP_METHODS.POST },
17133
+ markAsLost: { url: '/admin/crm/leads/{lead_id}/lost', method: HTTP_METHODS.POST },
17134
+ recordStaffReply: { url: '/admin/crm/leads/{lead_id}/replied', method: HTTP_METHODS.POST },
17135
+ bulkApprove: { url: '/admin/crm/contacts/bulk-approve', method: HTTP_METHODS.POST },
17136
+ // Automation Triggers
17137
+ triggerSourcing: { url: '/admin/crm/automation/source', method: HTTP_METHODS.POST },
17138
+ triggerSync: { url: '/admin/crm/automation/sync', method: HTTP_METHODS.POST },
17139
+ // Analytics
17140
+ funnelStats: { url: '/admin/crm/analytics/funnel', method: HTTP_METHODS.GET },
17141
+ performanceStats: { url: '/admin/crm/analytics/performance', method: HTTP_METHODS.GET },
17142
+ };
17143
+ return CrmRoute;
17144
+ }());
17145
+
17146
+ var Crm = /** @class */ (function () {
17147
+ function Crm() {
17148
+ }
17149
+ /**
17150
+ * List and search CRM leads.
17151
+ */
17152
+ Crm.listLeads = function (params) {
17153
+ return Requests.processRoute(CrmRoute.routes.listLeads, undefined, undefined, params);
17154
+ };
17155
+ /**
17156
+ * Manually create a new lead.
17157
+ */
17158
+ Crm.createLead = function (data) {
17159
+ return Requests.processRoute(CrmRoute.routes.createLead, data);
17160
+ };
17161
+ /**
17162
+ * View a single lead with contacts and activity timeline.
17163
+ */
17164
+ Crm.viewLead = function (lead_id) {
17165
+ return Requests.processRoute(CrmRoute.routes.viewLead, {}, { lead_id: lead_id });
17166
+ };
17167
+ /**
17168
+ * Update lead information.
17169
+ */
17170
+ Crm.updateLead = function (lead_id, data) {
17171
+ return Requests.processRoute(CrmRoute.routes.updateLead, data, { lead_id: lead_id });
17172
+ };
17173
+ /**
17174
+ * Delete a lead (Soft Delete).
17175
+ */
17176
+ Crm.deleteLead = function (lead_id) {
17177
+ return Requests.processRoute(CrmRoute.routes.deleteLead, {}, { lead_id: lead_id });
17178
+ };
17179
+ /**
17180
+ * Assign a Super Admin as the owner of a lead.
17181
+ */
17182
+ Crm.assignOwner = function (lead_id, user_id) {
17183
+ return Requests.processRoute(CrmRoute.routes.assignOwner, { user_id: user_id }, { lead_id: lead_id });
17184
+ };
17185
+ /**
17186
+ * Manually trigger Apollo enrichment and website scraping for a lead.
17187
+ */
17188
+ Crm.enrichLead = function (lead_id) {
17189
+ return Requests.processRoute(CrmRoute.routes.enrichLead, {}, { lead_id: lead_id });
17190
+ };
17191
+ /**
17192
+ * Approve a specific contact to start the Apollo email sequence.
17193
+ */
17194
+ Crm.approveContact = function (contact_id) {
17195
+ return Requests.processRoute(CrmRoute.routes.approveContact, {}, { contact_id: contact_id });
17196
+ };
17197
+ /**
17198
+ * Manually update the pipeline status of a lead.
17199
+ */
17200
+ Crm.updateStatus = function (lead_id, status, note) {
17201
+ return Requests.processRoute(CrmRoute.routes.updateStatus, { status: status, note: note }, { lead_id: lead_id });
17202
+ };
17203
+ /**
17204
+ * Add a manual note to the lead's activity timeline.
17205
+ */
17206
+ Crm.addNote = function (lead_id, content) {
17207
+ return Requests.processRoute(CrmRoute.routes.addNote, { content: content }, { lead_id: lead_id });
17208
+ };
17209
+ /**
17210
+ * Manually add a contact person to a lead.
17211
+ */
17212
+ Crm.addContact = function (lead_id, data) {
17213
+ return Requests.processRoute(CrmRoute.routes.addContact, data, { lead_id: lead_id });
17214
+ };
17215
+ /**
17216
+ * Mark a lead as lost and record the reason.
17217
+ */
17218
+ Crm.markAsLost = function (lead_id, reason) {
17219
+ return Requests.processRoute(CrmRoute.routes.markAsLost, { reason: reason }, { lead_id: lead_id });
17220
+ };
17221
+ /**
17222
+ * Record that a staff member has manually replied to a prospect.
17223
+ */
17224
+ Crm.recordStaffReply = function (lead_id) {
17225
+ return Requests.processRoute(CrmRoute.routes.recordStaffReply, {}, { lead_id: lead_id });
17226
+ };
17227
+ /**
17228
+ * Approve a batch of contacts for outreach.
17229
+ */
17230
+ Crm.bulkApprove = function (contact_ids) {
17231
+ return Requests.processRoute(CrmRoute.routes.bulkApprove, { contact_ids: contact_ids });
17232
+ };
17233
+ /**
17234
+ * Manually trigger the bi-weekly sourcing automation.
17235
+ */
17236
+ Crm.triggerSourcing = function () {
17237
+ return Requests.processRoute(CrmRoute.routes.triggerSourcing, {});
17238
+ };
17239
+ /**
17240
+ * Manually trigger the Apollo status and conversion sync.
17241
+ */
17242
+ Crm.triggerSync = function () {
17243
+ return Requests.processRoute(CrmRoute.routes.triggerSync, {});
17244
+ };
17245
+ /**
17246
+ * Get funnel conversion percentages.
17247
+ */
17248
+ Crm.getFunnelStats = function () {
17249
+ return Requests.processRoute(CrmRoute.routes.funnelStats);
17250
+ };
17251
+ /**
17252
+ * Get win rates and response time analytics.
17253
+ */
17254
+ Crm.getPerformanceStats = function () {
17255
+ return Requests.processRoute(CrmRoute.routes.performanceStats);
17256
+ };
17257
+ return Crm;
17258
+ }());
17259
+
17104
17260
  var Parser = /** @class */ (function () {
17105
17261
  function Parser() {
17106
17262
  }
@@ -17640,6 +17796,7 @@ var Glitch = /** @class */ (function () {
17640
17796
  Raffles: Raffles,
17641
17797
  DiscordMarketplace: DiscordMarketplace,
17642
17798
  Education: Education,
17799
+ Crm: Crm,
17643
17800
  };
17644
17801
  Glitch.util = {
17645
17802
  Requests: Requests,