glitch-javascript-sdk 2.7.1 → 2.7.3
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/cjs/index.js +165 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/api/Communities.d.ts +8 -4
- package/dist/esm/api/Crm.d.ts +81 -0
- package/dist/esm/api/index.d.ts +2 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +165 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/routes/CrmRoute.d.ts +7 -0
- package/dist/index.d.ts +88 -4
- package/package.json +1 -1
- package/src/api/Communities.ts +21 -2
- package/src/api/Crm.ts +141 -0
- package/src/api/index.ts +3 -1
- package/src/index.ts +2 -0
- package/src/routes/CrmRoute.ts +35 -0
|
@@ -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
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
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,81 @@
|
|
|
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
|
+
* Get the analytics on what users indcated they were interested in.
|
|
78
|
+
*/
|
|
79
|
+
static getInterestStats<T>(): AxiosPromise<Response<T>>;
|
|
80
|
+
}
|
|
81
|
+
export default Crm;
|
package/dist/esm/api/index.d.ts
CHANGED
|
@@ -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 };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,157 @@ 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
|
+
getInterestStats: { url: '/admin/crm/analytics/interests', method: HTTP_METHODS.GET },
|
|
17143
|
+
};
|
|
17144
|
+
return CrmRoute;
|
|
17145
|
+
}());
|
|
17146
|
+
|
|
17147
|
+
var Crm = /** @class */ (function () {
|
|
17148
|
+
function Crm() {
|
|
17149
|
+
}
|
|
17150
|
+
/**
|
|
17151
|
+
* List and search CRM leads.
|
|
17152
|
+
*/
|
|
17153
|
+
Crm.listLeads = function (params) {
|
|
17154
|
+
return Requests.processRoute(CrmRoute.routes.listLeads, undefined, undefined, params);
|
|
17155
|
+
};
|
|
17156
|
+
/**
|
|
17157
|
+
* Manually create a new lead.
|
|
17158
|
+
*/
|
|
17159
|
+
Crm.createLead = function (data) {
|
|
17160
|
+
return Requests.processRoute(CrmRoute.routes.createLead, data);
|
|
17161
|
+
};
|
|
17162
|
+
/**
|
|
17163
|
+
* View a single lead with contacts and activity timeline.
|
|
17164
|
+
*/
|
|
17165
|
+
Crm.viewLead = function (lead_id) {
|
|
17166
|
+
return Requests.processRoute(CrmRoute.routes.viewLead, {}, { lead_id: lead_id });
|
|
17167
|
+
};
|
|
17168
|
+
/**
|
|
17169
|
+
* Update lead information.
|
|
17170
|
+
*/
|
|
17171
|
+
Crm.updateLead = function (lead_id, data) {
|
|
17172
|
+
return Requests.processRoute(CrmRoute.routes.updateLead, data, { lead_id: lead_id });
|
|
17173
|
+
};
|
|
17174
|
+
/**
|
|
17175
|
+
* Delete a lead (Soft Delete).
|
|
17176
|
+
*/
|
|
17177
|
+
Crm.deleteLead = function (lead_id) {
|
|
17178
|
+
return Requests.processRoute(CrmRoute.routes.deleteLead, {}, { lead_id: lead_id });
|
|
17179
|
+
};
|
|
17180
|
+
/**
|
|
17181
|
+
* Assign a Super Admin as the owner of a lead.
|
|
17182
|
+
*/
|
|
17183
|
+
Crm.assignOwner = function (lead_id, user_id) {
|
|
17184
|
+
return Requests.processRoute(CrmRoute.routes.assignOwner, { user_id: user_id }, { lead_id: lead_id });
|
|
17185
|
+
};
|
|
17186
|
+
/**
|
|
17187
|
+
* Manually trigger Apollo enrichment and website scraping for a lead.
|
|
17188
|
+
*/
|
|
17189
|
+
Crm.enrichLead = function (lead_id) {
|
|
17190
|
+
return Requests.processRoute(CrmRoute.routes.enrichLead, {}, { lead_id: lead_id });
|
|
17191
|
+
};
|
|
17192
|
+
/**
|
|
17193
|
+
* Approve a specific contact to start the Apollo email sequence.
|
|
17194
|
+
*/
|
|
17195
|
+
Crm.approveContact = function (contact_id) {
|
|
17196
|
+
return Requests.processRoute(CrmRoute.routes.approveContact, {}, { contact_id: contact_id });
|
|
17197
|
+
};
|
|
17198
|
+
/**
|
|
17199
|
+
* Manually update the pipeline status of a lead.
|
|
17200
|
+
*/
|
|
17201
|
+
Crm.updateStatus = function (lead_id, status, note) {
|
|
17202
|
+
return Requests.processRoute(CrmRoute.routes.updateStatus, { status: status, note: note }, { lead_id: lead_id });
|
|
17203
|
+
};
|
|
17204
|
+
/**
|
|
17205
|
+
* Add a manual note to the lead's activity timeline.
|
|
17206
|
+
*/
|
|
17207
|
+
Crm.addNote = function (lead_id, content) {
|
|
17208
|
+
return Requests.processRoute(CrmRoute.routes.addNote, { content: content }, { lead_id: lead_id });
|
|
17209
|
+
};
|
|
17210
|
+
/**
|
|
17211
|
+
* Manually add a contact person to a lead.
|
|
17212
|
+
*/
|
|
17213
|
+
Crm.addContact = function (lead_id, data) {
|
|
17214
|
+
return Requests.processRoute(CrmRoute.routes.addContact, data, { lead_id: lead_id });
|
|
17215
|
+
};
|
|
17216
|
+
/**
|
|
17217
|
+
* Mark a lead as lost and record the reason.
|
|
17218
|
+
*/
|
|
17219
|
+
Crm.markAsLost = function (lead_id, reason) {
|
|
17220
|
+
return Requests.processRoute(CrmRoute.routes.markAsLost, { reason: reason }, { lead_id: lead_id });
|
|
17221
|
+
};
|
|
17222
|
+
/**
|
|
17223
|
+
* Record that a staff member has manually replied to a prospect.
|
|
17224
|
+
*/
|
|
17225
|
+
Crm.recordStaffReply = function (lead_id) {
|
|
17226
|
+
return Requests.processRoute(CrmRoute.routes.recordStaffReply, {}, { lead_id: lead_id });
|
|
17227
|
+
};
|
|
17228
|
+
/**
|
|
17229
|
+
* Approve a batch of contacts for outreach.
|
|
17230
|
+
*/
|
|
17231
|
+
Crm.bulkApprove = function (contact_ids) {
|
|
17232
|
+
return Requests.processRoute(CrmRoute.routes.bulkApprove, { contact_ids: contact_ids });
|
|
17233
|
+
};
|
|
17234
|
+
/**
|
|
17235
|
+
* Manually trigger the bi-weekly sourcing automation.
|
|
17236
|
+
*/
|
|
17237
|
+
Crm.triggerSourcing = function () {
|
|
17238
|
+
return Requests.processRoute(CrmRoute.routes.triggerSourcing, {});
|
|
17239
|
+
};
|
|
17240
|
+
/**
|
|
17241
|
+
* Manually trigger the Apollo status and conversion sync.
|
|
17242
|
+
*/
|
|
17243
|
+
Crm.triggerSync = function () {
|
|
17244
|
+
return Requests.processRoute(CrmRoute.routes.triggerSync, {});
|
|
17245
|
+
};
|
|
17246
|
+
/**
|
|
17247
|
+
* Get funnel conversion percentages.
|
|
17248
|
+
*/
|
|
17249
|
+
Crm.getFunnelStats = function () {
|
|
17250
|
+
return Requests.processRoute(CrmRoute.routes.funnelStats);
|
|
17251
|
+
};
|
|
17252
|
+
/**
|
|
17253
|
+
* Get win rates and response time analytics.
|
|
17254
|
+
*/
|
|
17255
|
+
Crm.getPerformanceStats = function () {
|
|
17256
|
+
return Requests.processRoute(CrmRoute.routes.performanceStats);
|
|
17257
|
+
};
|
|
17258
|
+
/**
|
|
17259
|
+
* Get the analytics on what users indcated they were interested in.
|
|
17260
|
+
*/
|
|
17261
|
+
Crm.getInterestStats = function () {
|
|
17262
|
+
return Requests.processRoute(CrmRoute.routes.getInterestStats);
|
|
17263
|
+
};
|
|
17264
|
+
return Crm;
|
|
17265
|
+
}());
|
|
17266
|
+
|
|
17104
17267
|
var Parser = /** @class */ (function () {
|
|
17105
17268
|
function Parser() {
|
|
17106
17269
|
}
|
|
@@ -17640,6 +17803,7 @@ var Glitch = /** @class */ (function () {
|
|
|
17640
17803
|
Raffles: Raffles,
|
|
17641
17804
|
DiscordMarketplace: DiscordMarketplace,
|
|
17642
17805
|
Education: Education,
|
|
17806
|
+
Crm: Crm,
|
|
17643
17807
|
};
|
|
17644
17808
|
Glitch.util = {
|
|
17645
17809
|
Requests: Requests,
|