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.
package/dist/cjs/index.js CHANGED
@@ -21864,7 +21864,19 @@ var Communities = /** @class */ (function () {
21864
21864
  * @param community_id The ID of the community.
21865
21865
  * @param params Should include { start_date: 'YYYY-MM-DD', end_date: 'YYYY-MM-DD' }
21866
21866
  */
21867
- Communities.getCustomStatement = function (community_id, params) {
21867
+ /**
21868
+ * Generate a custom date-range statement for reimbursement.
21869
+ *
21870
+ * @param community_id The ID of the community.
21871
+ * @param startDate 'YYYY-MM-DD'
21872
+ * @param endDate 'YYYY-MM-DD'
21873
+ */
21874
+ Communities.getCustomStatement = function (community_id, startDate, endDate) {
21875
+ // Wrap the strings into a named object so Requests.get can serialize them correctly
21876
+ var params = {
21877
+ start_date: startDate,
21878
+ end_date: endDate
21879
+ };
21868
21880
  return Requests.processRoute(CommunitiesRoute.routes.getCustomStatement, undefined, { community_id: community_id }, params);
21869
21881
  };
21870
21882
  /**
@@ -30285,6 +30297,150 @@ var Education = /** @class */ (function () {
30285
30297
  return Education;
30286
30298
  }());
30287
30299
 
30300
+ var CrmRoute = /** @class */ (function () {
30301
+ function CrmRoute() {
30302
+ }
30303
+ CrmRoute.routes = {
30304
+ // Lead Management
30305
+ listLeads: { url: '/admin/crm/leads', method: HTTP_METHODS.GET },
30306
+ createLead: { url: '/admin/crm/leads', method: HTTP_METHODS.POST },
30307
+ viewLead: { url: '/admin/crm/leads/{lead_id}', method: HTTP_METHODS.GET },
30308
+ updateLead: { url: '/admin/crm/leads/{lead_id}', method: HTTP_METHODS.PUT },
30309
+ deleteLead: { url: '/admin/crm/leads/{lead_id}', method: HTTP_METHODS.DELETE },
30310
+ // Pipeline Actions
30311
+ assignOwner: { url: '/admin/crm/leads/{lead_id}/assign', method: HTTP_METHODS.POST },
30312
+ enrichLead: { url: '/admin/crm/leads/{lead_id}/enrich', method: HTTP_METHODS.POST },
30313
+ approveContact: { url: '/admin/crm/contacts/{contact_id}/approve', method: HTTP_METHODS.POST },
30314
+ updateStatus: { url: '/admin/crm/leads/{lead_id}/status', method: HTTP_METHODS.POST },
30315
+ addNote: { url: '/admin/crm/leads/{lead_id}/notes', method: HTTP_METHODS.POST },
30316
+ addContact: { url: '/admin/crm/leads/{lead_id}/contacts', method: HTTP_METHODS.POST },
30317
+ markAsLost: { url: '/admin/crm/leads/{lead_id}/lost', method: HTTP_METHODS.POST },
30318
+ recordStaffReply: { url: '/admin/crm/leads/{lead_id}/replied', method: HTTP_METHODS.POST },
30319
+ bulkApprove: { url: '/admin/crm/contacts/bulk-approve', method: HTTP_METHODS.POST },
30320
+ // Automation Triggers
30321
+ triggerSourcing: { url: '/admin/crm/automation/source', method: HTTP_METHODS.POST },
30322
+ triggerSync: { url: '/admin/crm/automation/sync', method: HTTP_METHODS.POST },
30323
+ // Analytics
30324
+ funnelStats: { url: '/admin/crm/analytics/funnel', method: HTTP_METHODS.GET },
30325
+ performanceStats: { url: '/admin/crm/analytics/performance', method: HTTP_METHODS.GET },
30326
+ };
30327
+ return CrmRoute;
30328
+ }());
30329
+
30330
+ var Crm = /** @class */ (function () {
30331
+ function Crm() {
30332
+ }
30333
+ /**
30334
+ * List and search CRM leads.
30335
+ */
30336
+ Crm.listLeads = function (params) {
30337
+ return Requests.processRoute(CrmRoute.routes.listLeads, undefined, undefined, params);
30338
+ };
30339
+ /**
30340
+ * Manually create a new lead.
30341
+ */
30342
+ Crm.createLead = function (data) {
30343
+ return Requests.processRoute(CrmRoute.routes.createLead, data);
30344
+ };
30345
+ /**
30346
+ * View a single lead with contacts and activity timeline.
30347
+ */
30348
+ Crm.viewLead = function (lead_id) {
30349
+ return Requests.processRoute(CrmRoute.routes.viewLead, {}, { lead_id: lead_id });
30350
+ };
30351
+ /**
30352
+ * Update lead information.
30353
+ */
30354
+ Crm.updateLead = function (lead_id, data) {
30355
+ return Requests.processRoute(CrmRoute.routes.updateLead, data, { lead_id: lead_id });
30356
+ };
30357
+ /**
30358
+ * Delete a lead (Soft Delete).
30359
+ */
30360
+ Crm.deleteLead = function (lead_id) {
30361
+ return Requests.processRoute(CrmRoute.routes.deleteLead, {}, { lead_id: lead_id });
30362
+ };
30363
+ /**
30364
+ * Assign a Super Admin as the owner of a lead.
30365
+ */
30366
+ Crm.assignOwner = function (lead_id, user_id) {
30367
+ return Requests.processRoute(CrmRoute.routes.assignOwner, { user_id: user_id }, { lead_id: lead_id });
30368
+ };
30369
+ /**
30370
+ * Manually trigger Apollo enrichment and website scraping for a lead.
30371
+ */
30372
+ Crm.enrichLead = function (lead_id) {
30373
+ return Requests.processRoute(CrmRoute.routes.enrichLead, {}, { lead_id: lead_id });
30374
+ };
30375
+ /**
30376
+ * Approve a specific contact to start the Apollo email sequence.
30377
+ */
30378
+ Crm.approveContact = function (contact_id) {
30379
+ return Requests.processRoute(CrmRoute.routes.approveContact, {}, { contact_id: contact_id });
30380
+ };
30381
+ /**
30382
+ * Manually update the pipeline status of a lead.
30383
+ */
30384
+ Crm.updateStatus = function (lead_id, status, note) {
30385
+ return Requests.processRoute(CrmRoute.routes.updateStatus, { status: status, note: note }, { lead_id: lead_id });
30386
+ };
30387
+ /**
30388
+ * Add a manual note to the lead's activity timeline.
30389
+ */
30390
+ Crm.addNote = function (lead_id, content) {
30391
+ return Requests.processRoute(CrmRoute.routes.addNote, { content: content }, { lead_id: lead_id });
30392
+ };
30393
+ /**
30394
+ * Manually add a contact person to a lead.
30395
+ */
30396
+ Crm.addContact = function (lead_id, data) {
30397
+ return Requests.processRoute(CrmRoute.routes.addContact, data, { lead_id: lead_id });
30398
+ };
30399
+ /**
30400
+ * Mark a lead as lost and record the reason.
30401
+ */
30402
+ Crm.markAsLost = function (lead_id, reason) {
30403
+ return Requests.processRoute(CrmRoute.routes.markAsLost, { reason: reason }, { lead_id: lead_id });
30404
+ };
30405
+ /**
30406
+ * Record that a staff member has manually replied to a prospect.
30407
+ */
30408
+ Crm.recordStaffReply = function (lead_id) {
30409
+ return Requests.processRoute(CrmRoute.routes.recordStaffReply, {}, { lead_id: lead_id });
30410
+ };
30411
+ /**
30412
+ * Approve a batch of contacts for outreach.
30413
+ */
30414
+ Crm.bulkApprove = function (contact_ids) {
30415
+ return Requests.processRoute(CrmRoute.routes.bulkApprove, { contact_ids: contact_ids });
30416
+ };
30417
+ /**
30418
+ * Manually trigger the bi-weekly sourcing automation.
30419
+ */
30420
+ Crm.triggerSourcing = function () {
30421
+ return Requests.processRoute(CrmRoute.routes.triggerSourcing, {});
30422
+ };
30423
+ /**
30424
+ * Manually trigger the Apollo status and conversion sync.
30425
+ */
30426
+ Crm.triggerSync = function () {
30427
+ return Requests.processRoute(CrmRoute.routes.triggerSync, {});
30428
+ };
30429
+ /**
30430
+ * Get funnel conversion percentages.
30431
+ */
30432
+ Crm.getFunnelStats = function () {
30433
+ return Requests.processRoute(CrmRoute.routes.funnelStats);
30434
+ };
30435
+ /**
30436
+ * Get win rates and response time analytics.
30437
+ */
30438
+ Crm.getPerformanceStats = function () {
30439
+ return Requests.processRoute(CrmRoute.routes.performanceStats);
30440
+ };
30441
+ return Crm;
30442
+ }());
30443
+
30288
30444
  var Parser = /** @class */ (function () {
30289
30445
  function Parser() {
30290
30446
  }
@@ -30824,6 +30980,7 @@ var Glitch = /** @class */ (function () {
30824
30980
  Raffles: Raffles,
30825
30981
  DiscordMarketplace: DiscordMarketplace,
30826
30982
  Education: Education,
30983
+ Crm: Crm,
30827
30984
  };
30828
30985
  Glitch.util = {
30829
30986
  Requests: Requests,