lumnisai 0.1.7 → 0.1.9
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.cjs +499 -47
- package/dist/index.d.cts +887 -170
- package/dist/index.d.mts +887 -170
- package/dist/index.d.ts +887 -170
- package/dist/index.mjs +481 -48
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
import crypto$1 from 'node:crypto';
|
|
3
|
+
|
|
1
4
|
const DEFAULT_BASE_URL = "https://api.lumnis.ai";
|
|
2
5
|
const DEFAULT_POLL_INTERVAL_MS = 2e3;
|
|
3
6
|
const LONG_POLL_TIMEOUT_S = 10;
|
|
@@ -203,15 +206,33 @@ class IntegrationsResource {
|
|
|
203
206
|
* Check the status of a specific connection
|
|
204
207
|
*/
|
|
205
208
|
async getConnectionStatus(params) {
|
|
206
|
-
const { userId, appName, provider } = params;
|
|
209
|
+
const { userId, appName, provider, includeEnabled } = params;
|
|
207
210
|
const queryParams = new URLSearchParams();
|
|
208
211
|
if (provider)
|
|
209
212
|
queryParams.append("provider", provider);
|
|
213
|
+
if (includeEnabled)
|
|
214
|
+
queryParams.append("include_enabled", "true");
|
|
210
215
|
const query = queryParams.toString() ? `?${queryParams.toString()}` : "";
|
|
211
216
|
return this.http.get(
|
|
212
217
|
`/integrations/connections/${encodeURIComponent(userId)}/${appName.toUpperCase()}${query}`
|
|
213
218
|
);
|
|
214
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Check connection status for multiple apps in a single request
|
|
222
|
+
* Optimized for onboarding flows - checks multiple connections in parallel
|
|
223
|
+
*/
|
|
224
|
+
async getConnectionsBatch(params) {
|
|
225
|
+
const requestData = {
|
|
226
|
+
userId: params.userId,
|
|
227
|
+
appNames: params.appNames.map((name) => name.toUpperCase()),
|
|
228
|
+
provider: params.provider || "composio",
|
|
229
|
+
includeEnabledStatus: params.includeEnabledStatus ?? true
|
|
230
|
+
};
|
|
231
|
+
return this.http.post(
|
|
232
|
+
"/integrations/connections/batch",
|
|
233
|
+
requestData
|
|
234
|
+
);
|
|
235
|
+
}
|
|
215
236
|
/**
|
|
216
237
|
* Get all connections for a user
|
|
217
238
|
*/
|
|
@@ -387,50 +408,6 @@ class MCPServersResource {
|
|
|
387
408
|
}
|
|
388
409
|
}
|
|
389
410
|
|
|
390
|
-
class ModelPreferencesResource {
|
|
391
|
-
constructor(http) {
|
|
392
|
-
this.http = http;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Get all model preferences for the tenant
|
|
396
|
-
*/
|
|
397
|
-
async get(includeDefaults = true) {
|
|
398
|
-
const params = new URLSearchParams();
|
|
399
|
-
params.append("include_defaults", includeDefaults.toString());
|
|
400
|
-
return this.http.get(`/model-preferences?${params.toString()}`);
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Update multiple model preferences in a single request
|
|
404
|
-
*/
|
|
405
|
-
async updateBulk(data) {
|
|
406
|
-
return this.http.put("/model-preferences", data);
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Update a specific model type preference
|
|
410
|
-
*/
|
|
411
|
-
async update(modelType, data) {
|
|
412
|
-
return this.http.patch(`/model-preferences/${modelType}`, data);
|
|
413
|
-
}
|
|
414
|
-
/**
|
|
415
|
-
* Delete a model preference to revert to system default
|
|
416
|
-
*/
|
|
417
|
-
async delete(modelType) {
|
|
418
|
-
await this.http.delete(`/model-preferences/${modelType}`);
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Check which models are available based on API key configuration
|
|
422
|
-
*/
|
|
423
|
-
async checkAvailability(models) {
|
|
424
|
-
return this.http.post("/model-preferences/check-availability", models);
|
|
425
|
-
}
|
|
426
|
-
/**
|
|
427
|
-
* List all model preferences (alias for get)
|
|
428
|
-
*/
|
|
429
|
-
async list(params) {
|
|
430
|
-
return this.get(params?.includeDefaults);
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
411
|
class LumnisError extends Error {
|
|
435
412
|
code;
|
|
436
413
|
statusCode;
|
|
@@ -504,6 +481,319 @@ class SourcesNotAvailableError extends ValidationError {
|
|
|
504
481
|
this.availableSources = availableSources;
|
|
505
482
|
}
|
|
506
483
|
}
|
|
484
|
+
class MessagingAPIError extends LumnisError {
|
|
485
|
+
constructor(message, options = {}) {
|
|
486
|
+
super(message, options);
|
|
487
|
+
this.name = "MessagingAPIError";
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
class MessagingNotFoundError extends MessagingAPIError {
|
|
491
|
+
constructor(message, options = {}) {
|
|
492
|
+
super(message, { ...options, statusCode: 404 });
|
|
493
|
+
this.name = "MessagingNotFoundError";
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
class MessagingValidationError extends MessagingAPIError {
|
|
497
|
+
constructor(message, options = {}) {
|
|
498
|
+
super(message, { ...options, statusCode: 400 });
|
|
499
|
+
this.name = "MessagingValidationError";
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
class MessagingSendError extends MessagingAPIError {
|
|
503
|
+
constructor(message, options = {}) {
|
|
504
|
+
super(message, { ...options, statusCode: 400 });
|
|
505
|
+
this.name = "MessagingSendError";
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
class MessagingConnectionError extends MessagingAPIError {
|
|
509
|
+
constructor(message, options = {}) {
|
|
510
|
+
super(message, { ...options, statusCode: 400 });
|
|
511
|
+
this.name = "MessagingConnectionError";
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
class MessagingResource {
|
|
516
|
+
constructor(http) {
|
|
517
|
+
this.http = http;
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Sync conversations from connected providers for specific prospects.
|
|
521
|
+
* Prospects list is REQUIRED.
|
|
522
|
+
*/
|
|
523
|
+
async syncConversations(userId, request) {
|
|
524
|
+
if (!request.prospects || request.prospects.length === 0) {
|
|
525
|
+
throw new MessagingValidationError("prospects array is required and must not be empty", { code: "VALIDATION_ERROR" });
|
|
526
|
+
}
|
|
527
|
+
for (const prospect of request.prospects) {
|
|
528
|
+
const hasIdentifier = prospect.email || prospect.linkedinUrl || prospect.providerId;
|
|
529
|
+
if (!hasIdentifier) {
|
|
530
|
+
throw new MessagingValidationError("Each prospect must have at least one identifier (email, linkedinUrl, or providerId)", { code: "VALIDATION_ERROR" });
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
const queryParams = new URLSearchParams();
|
|
534
|
+
queryParams.append("user_id", userId);
|
|
535
|
+
return this.http.post(
|
|
536
|
+
`/messaging/sync?${queryParams.toString()}`,
|
|
537
|
+
request
|
|
538
|
+
);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Sync conversation for a single prospect on-demand.
|
|
542
|
+
* Use when viewing a prospect's detail page.
|
|
543
|
+
*/
|
|
544
|
+
async syncProspect(userId, request) {
|
|
545
|
+
const queryParams = new URLSearchParams();
|
|
546
|
+
queryParams.append("user_id", userId);
|
|
547
|
+
return this.http.post(
|
|
548
|
+
`/messaging/sync/prospect?${queryParams.toString()}`,
|
|
549
|
+
request
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Get sync job status
|
|
554
|
+
*/
|
|
555
|
+
async getSyncStatus(jobId) {
|
|
556
|
+
return this.http.get(`/messaging/sync/${encodeURIComponent(jobId)}`);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* List conversations with filtering
|
|
560
|
+
*/
|
|
561
|
+
async listConversations(userId, params) {
|
|
562
|
+
const queryParams = new URLSearchParams();
|
|
563
|
+
queryParams.append("user_id", userId);
|
|
564
|
+
if (params?.status)
|
|
565
|
+
queryParams.append("status", params.status);
|
|
566
|
+
if (params?.channel)
|
|
567
|
+
queryParams.append("channel", params.channel);
|
|
568
|
+
if (params?.projectId)
|
|
569
|
+
queryParams.append("project_id", params.projectId);
|
|
570
|
+
if (params?.networkDistance)
|
|
571
|
+
queryParams.append("network_distance", params.networkDistance);
|
|
572
|
+
if (params?.limit !== void 0)
|
|
573
|
+
queryParams.append("limit", String(params.limit));
|
|
574
|
+
if (params?.offset !== void 0)
|
|
575
|
+
queryParams.append("offset", String(params.offset));
|
|
576
|
+
return this.http.get(
|
|
577
|
+
`/messaging/conversations?${queryParams.toString()}`
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Get all conversations for a project
|
|
582
|
+
*/
|
|
583
|
+
async listConversationsByProject(projectId, userId, params) {
|
|
584
|
+
const queryParams = new URLSearchParams();
|
|
585
|
+
queryParams.append("user_id", userId);
|
|
586
|
+
if (params?.limit !== void 0)
|
|
587
|
+
queryParams.append("limit", String(params.limit));
|
|
588
|
+
if (params?.offset !== void 0)
|
|
589
|
+
queryParams.append("offset", String(params.offset));
|
|
590
|
+
return this.http.get(
|
|
591
|
+
`/messaging/conversations/by-project/${encodeURIComponent(projectId)}?${queryParams.toString()}`
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Get conversation with messages
|
|
596
|
+
*/
|
|
597
|
+
async getConversation(conversationId, userId, params) {
|
|
598
|
+
const queryParams = new URLSearchParams();
|
|
599
|
+
queryParams.append("user_id", userId);
|
|
600
|
+
if (params?.fetchLive !== void 0)
|
|
601
|
+
queryParams.append("fetch_live", String(params.fetchLive));
|
|
602
|
+
return this.http.get(
|
|
603
|
+
`/messaging/conversations/${encodeURIComponent(conversationId)}?${queryParams.toString()}`
|
|
604
|
+
);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Send a message (creates new conversation or adds to existing)
|
|
608
|
+
*/
|
|
609
|
+
async sendMessage(userId, request) {
|
|
610
|
+
const queryParams = new URLSearchParams();
|
|
611
|
+
queryParams.append("user_id", userId);
|
|
612
|
+
return this.http.post(
|
|
613
|
+
`/messaging/send?${queryParams.toString()}`,
|
|
614
|
+
request
|
|
615
|
+
);
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Reply to an existing conversation
|
|
619
|
+
*/
|
|
620
|
+
async replyToConversation(conversationId, userId, request) {
|
|
621
|
+
const queryParams = new URLSearchParams();
|
|
622
|
+
queryParams.append("user_id", userId);
|
|
623
|
+
return this.http.post(
|
|
624
|
+
`/messaging/conversations/${encodeURIComponent(conversationId)}/reply?${queryParams.toString()}`,
|
|
625
|
+
request
|
|
626
|
+
);
|
|
627
|
+
}
|
|
628
|
+
/**
|
|
629
|
+
* Get all email threads with a specific person
|
|
630
|
+
*/
|
|
631
|
+
async getEmailThreads(emailAddress, userId, params) {
|
|
632
|
+
const queryParams = new URLSearchParams();
|
|
633
|
+
queryParams.append("user_id", userId);
|
|
634
|
+
if (params?.limit !== void 0)
|
|
635
|
+
queryParams.append("limit", String(params.limit));
|
|
636
|
+
return this.http.get(
|
|
637
|
+
`/messaging/email-threads/${encodeURIComponent(emailAddress)}?${queryParams.toString()}`
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Check if user is connected to a prospect on LinkedIn
|
|
642
|
+
*/
|
|
643
|
+
async checkLinkedInConnection(userId, request) {
|
|
644
|
+
const queryParams = new URLSearchParams();
|
|
645
|
+
queryParams.append("user_id", userId);
|
|
646
|
+
return this.http.post(
|
|
647
|
+
`/messaging/linkedin/check-connection?${queryParams.toString()}`,
|
|
648
|
+
request
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Batch check connection status for multiple prospects
|
|
653
|
+
*/
|
|
654
|
+
async batchCheckLinkedInConnections(userId, request) {
|
|
655
|
+
const queryParams = new URLSearchParams();
|
|
656
|
+
queryParams.append("user_id", userId);
|
|
657
|
+
return this.http.post(
|
|
658
|
+
`/messaging/linkedin/check-connections/batch?${queryParams.toString()}`,
|
|
659
|
+
request
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Smart LinkedIn outreach with automatic method selection
|
|
664
|
+
*/
|
|
665
|
+
async sendLinkedInOutreach(userId, request) {
|
|
666
|
+
const queryParams = new URLSearchParams();
|
|
667
|
+
queryParams.append("user_id", userId);
|
|
668
|
+
return this.http.post(
|
|
669
|
+
`/messaging/linkedin/send?${queryParams.toString()}`,
|
|
670
|
+
request
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Get InMail credit information.
|
|
675
|
+
* By default returns cached data. Set forceRefresh=true to fetch real-time data from Unipile API.
|
|
676
|
+
*/
|
|
677
|
+
async getLinkedInCredits(userId, options) {
|
|
678
|
+
const queryParams = new URLSearchParams();
|
|
679
|
+
queryParams.append("user_id", userId);
|
|
680
|
+
if (options?.forceRefresh) {
|
|
681
|
+
queryParams.append("force_refresh", "true");
|
|
682
|
+
}
|
|
683
|
+
return this.http.get(
|
|
684
|
+
`/messaging/linkedin/credits?${queryParams.toString()}`
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Force refresh InMail credits from Unipile API.
|
|
689
|
+
* Fetches real-time credit balance from provider and updates cache.
|
|
690
|
+
*/
|
|
691
|
+
async refreshLinkedInCredits(userId) {
|
|
692
|
+
const queryParams = new URLSearchParams();
|
|
693
|
+
queryParams.append("user_id", userId);
|
|
694
|
+
return this.http.post(
|
|
695
|
+
`/messaging/linkedin/refresh-credits?${queryParams.toString()}`
|
|
696
|
+
);
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
699
|
+
* Update LinkedIn subscription type and credits
|
|
700
|
+
*/
|
|
701
|
+
async updateLinkedInSubscription(userId, request) {
|
|
702
|
+
const queryParams = new URLSearchParams();
|
|
703
|
+
queryParams.append("user_id", userId);
|
|
704
|
+
return this.http.put(
|
|
705
|
+
`/messaging/linkedin/subscription?${queryParams.toString()}`,
|
|
706
|
+
request
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Create a single draft message
|
|
711
|
+
*/
|
|
712
|
+
async createDraft(userId, request) {
|
|
713
|
+
const queryParams = new URLSearchParams();
|
|
714
|
+
queryParams.append("user_id", userId);
|
|
715
|
+
return this.http.post(
|
|
716
|
+
`/messaging/drafts?${queryParams.toString()}`,
|
|
717
|
+
request
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Create drafts for multiple prospects with AI generation
|
|
722
|
+
*/
|
|
723
|
+
async createBatchDrafts(userId, request) {
|
|
724
|
+
const queryParams = new URLSearchParams();
|
|
725
|
+
queryParams.append("user_id", userId);
|
|
726
|
+
return this.http.post(
|
|
727
|
+
`/messaging/drafts/batch?${queryParams.toString()}`,
|
|
728
|
+
request
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Approve and send a single draft
|
|
733
|
+
*/
|
|
734
|
+
async sendDraft(draftId, userId) {
|
|
735
|
+
const queryParams = new URLSearchParams();
|
|
736
|
+
queryParams.append("user_id", userId);
|
|
737
|
+
return this.http.post(
|
|
738
|
+
`/messaging/drafts/${encodeURIComponent(draftId)}/send?${queryParams.toString()}`
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Send multiple drafts with rate limiting
|
|
743
|
+
*/
|
|
744
|
+
async sendBatchDrafts(userId, request) {
|
|
745
|
+
const queryParams = new URLSearchParams();
|
|
746
|
+
queryParams.append("user_id", userId);
|
|
747
|
+
return this.http.post(
|
|
748
|
+
`/messaging/drafts/batch/send?${queryParams.toString()}`,
|
|
749
|
+
request
|
|
750
|
+
);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
class ModelPreferencesResource {
|
|
755
|
+
constructor(http) {
|
|
756
|
+
this.http = http;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Get all model preferences for the tenant
|
|
760
|
+
*/
|
|
761
|
+
async get(includeDefaults = true) {
|
|
762
|
+
const params = new URLSearchParams();
|
|
763
|
+
params.append("include_defaults", includeDefaults.toString());
|
|
764
|
+
return this.http.get(`/model-preferences?${params.toString()}`);
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
* Update multiple model preferences in a single request
|
|
768
|
+
*/
|
|
769
|
+
async updateBulk(data) {
|
|
770
|
+
return this.http.put("/model-preferences", data);
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* Update a specific model type preference
|
|
774
|
+
*/
|
|
775
|
+
async update(modelType, data) {
|
|
776
|
+
return this.http.patch(`/model-preferences/${modelType}`, data);
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Delete a model preference to revert to system default
|
|
780
|
+
*/
|
|
781
|
+
async delete(modelType) {
|
|
782
|
+
await this.http.delete(`/model-preferences/${modelType}`);
|
|
783
|
+
}
|
|
784
|
+
/**
|
|
785
|
+
* Check which models are available based on API key configuration
|
|
786
|
+
*/
|
|
787
|
+
async checkAvailability(models) {
|
|
788
|
+
return this.http.post("/model-preferences/check-availability", models);
|
|
789
|
+
}
|
|
790
|
+
/**
|
|
791
|
+
* List all model preferences (alias for get)
|
|
792
|
+
*/
|
|
793
|
+
async list(params) {
|
|
794
|
+
return this.get(params?.includeDefaults);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
507
797
|
|
|
508
798
|
var PeopleDataSource = /* @__PURE__ */ ((PeopleDataSource2) => {
|
|
509
799
|
PeopleDataSource2["PDL"] = "PDL";
|
|
@@ -705,6 +995,35 @@ class ResponsesResource {
|
|
|
705
995
|
queryParams.progress_id = options.progressId;
|
|
706
996
|
return this.http.get(`/responses/${responseId}/feedback`, { params: queryParams });
|
|
707
997
|
}
|
|
998
|
+
/**
|
|
999
|
+
* Perform a quick people search using the specialized quick_people_search agent
|
|
1000
|
+
* @param query - Natural language search query (e.g., "Find engineers at Google in SF")
|
|
1001
|
+
* @param options - Optional search parameters
|
|
1002
|
+
* @param options.limit - Maximum number of results (1-100, default: 20)
|
|
1003
|
+
* @param options.dataSources - Specific data sources to use: ["PDL", "CORESIGNAL", "CRUST_DATA"]
|
|
1004
|
+
* @returns Response with structured_response containing:
|
|
1005
|
+
* - candidates: List of person results
|
|
1006
|
+
* - totalFound: Total unique candidates found
|
|
1007
|
+
* - appliedFilters: Extracted search filters
|
|
1008
|
+
* - executionTimeMs: Search duration
|
|
1009
|
+
* - dataSourcesUsed: Which sources were queried
|
|
1010
|
+
*/
|
|
1011
|
+
async quickPeopleSearch(query, options) {
|
|
1012
|
+
const request = {
|
|
1013
|
+
messages: [{ role: "user", content: query }],
|
|
1014
|
+
specializedAgent: "quick_people_search"
|
|
1015
|
+
};
|
|
1016
|
+
if (options) {
|
|
1017
|
+
const params = {};
|
|
1018
|
+
if (options.limit !== void 0)
|
|
1019
|
+
params.limit = options.limit;
|
|
1020
|
+
if (options.dataSources)
|
|
1021
|
+
params.dataSources = options.dataSources;
|
|
1022
|
+
if (Object.keys(params).length > 0)
|
|
1023
|
+
request.specializedAgentParams = params;
|
|
1024
|
+
}
|
|
1025
|
+
return this.create(request);
|
|
1026
|
+
}
|
|
708
1027
|
}
|
|
709
1028
|
|
|
710
1029
|
class SkillsResource {
|
|
@@ -939,12 +1258,20 @@ class UsersResource {
|
|
|
939
1258
|
}
|
|
940
1259
|
}
|
|
941
1260
|
|
|
1261
|
+
const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
1262
|
+
function isUUID(s) {
|
|
1263
|
+
return UUID_PATTERN.test(s);
|
|
1264
|
+
}
|
|
942
1265
|
function toCamel(s) {
|
|
1266
|
+
if (isUUID(s))
|
|
1267
|
+
return s;
|
|
943
1268
|
return s.replace(/([-_][a-z])/gi, ($1) => {
|
|
944
1269
|
return $1.toUpperCase().replace("-", "").replace("_", "");
|
|
945
1270
|
});
|
|
946
1271
|
}
|
|
947
1272
|
function toSnake(s) {
|
|
1273
|
+
if (isUUID(s))
|
|
1274
|
+
return s;
|
|
948
1275
|
return s.replace(/[A-Z]/g, (letter, index) => {
|
|
949
1276
|
return index === 0 ? letter.toLowerCase() : `_${letter.toLowerCase()}`;
|
|
950
1277
|
});
|
|
@@ -1117,6 +1444,7 @@ class LumnisClient {
|
|
|
1117
1444
|
mcpServers;
|
|
1118
1445
|
skills;
|
|
1119
1446
|
people;
|
|
1447
|
+
messaging;
|
|
1120
1448
|
_scopedUserId;
|
|
1121
1449
|
_defaultScope;
|
|
1122
1450
|
constructor(options = {}) {
|
|
@@ -1148,6 +1476,7 @@ class LumnisClient {
|
|
|
1148
1476
|
this.mcpServers = new MCPServersResource(this.http);
|
|
1149
1477
|
this.skills = new SkillsResource(this.http);
|
|
1150
1478
|
this.people = new PeopleResource(this.http);
|
|
1479
|
+
this.messaging = new MessagingResource(this.http);
|
|
1151
1480
|
}
|
|
1152
1481
|
forUser(userId) {
|
|
1153
1482
|
return new LumnisClient({
|
|
@@ -1327,8 +1656,28 @@ class LumnisClient {
|
|
|
1327
1656
|
async initiateConnection(params) {
|
|
1328
1657
|
return this.integrations.initiateConnection(params);
|
|
1329
1658
|
}
|
|
1330
|
-
async getConnectionStatus(userId, appName,
|
|
1331
|
-
|
|
1659
|
+
async getConnectionStatus(userId, appName, providerOrOptions) {
|
|
1660
|
+
if (typeof providerOrOptions === "string") {
|
|
1661
|
+
return this.integrations.getConnectionStatus({
|
|
1662
|
+
userId,
|
|
1663
|
+
appName,
|
|
1664
|
+
provider: providerOrOptions
|
|
1665
|
+
});
|
|
1666
|
+
}
|
|
1667
|
+
return this.integrations.getConnectionStatus({
|
|
1668
|
+
userId,
|
|
1669
|
+
appName,
|
|
1670
|
+
provider: providerOrOptions?.provider,
|
|
1671
|
+
includeEnabled: providerOrOptions?.includeEnabled
|
|
1672
|
+
});
|
|
1673
|
+
}
|
|
1674
|
+
async getConnectionsBatch(params) {
|
|
1675
|
+
return this.integrations.getConnectionsBatch({
|
|
1676
|
+
userId: params.userId,
|
|
1677
|
+
appNames: params.appNames,
|
|
1678
|
+
provider: params.provider,
|
|
1679
|
+
includeEnabledStatus: params.includeEnabledStatus
|
|
1680
|
+
});
|
|
1332
1681
|
}
|
|
1333
1682
|
async listConnections(userId, params) {
|
|
1334
1683
|
return this.integrations.listConnections(userId, params);
|
|
@@ -1433,6 +1782,76 @@ var ProviderType = /* @__PURE__ */ ((ProviderType2) => {
|
|
|
1433
1782
|
return ProviderType2;
|
|
1434
1783
|
})(ProviderType || {});
|
|
1435
1784
|
|
|
1785
|
+
var ChannelType = /* @__PURE__ */ ((ChannelType2) => {
|
|
1786
|
+
ChannelType2["GMAIL"] = "gmail";
|
|
1787
|
+
ChannelType2["OUTLOOK"] = "outlook";
|
|
1788
|
+
ChannelType2["LINKEDIN"] = "linkedin";
|
|
1789
|
+
return ChannelType2;
|
|
1790
|
+
})(ChannelType || {});
|
|
1791
|
+
var OutreachMethod = /* @__PURE__ */ ((OutreachMethod2) => {
|
|
1792
|
+
OutreachMethod2["CONNECTION_REQUEST"] = "connection_request";
|
|
1793
|
+
OutreachMethod2["DIRECT_MESSAGE"] = "direct_message";
|
|
1794
|
+
OutreachMethod2["INMAIL"] = "inmail";
|
|
1795
|
+
OutreachMethod2["INMAIL_ESCALATION"] = "inmail_escalation";
|
|
1796
|
+
OutreachMethod2["EMAIL"] = "email";
|
|
1797
|
+
return OutreachMethod2;
|
|
1798
|
+
})(OutreachMethod || {});
|
|
1799
|
+
var ConversationStatus = /* @__PURE__ */ ((ConversationStatus2) => {
|
|
1800
|
+
ConversationStatus2["ACTIVE"] = "active";
|
|
1801
|
+
ConversationStatus2["NEEDS_RESPONSE"] = "needs_response";
|
|
1802
|
+
ConversationStatus2["WAITING"] = "waiting";
|
|
1803
|
+
ConversationStatus2["BOOKED"] = "booked";
|
|
1804
|
+
ConversationStatus2["CLOSED"] = "closed";
|
|
1805
|
+
return ConversationStatus2;
|
|
1806
|
+
})(ConversationStatus || {});
|
|
1807
|
+
var MessageType = /* @__PURE__ */ ((MessageType2) => {
|
|
1808
|
+
MessageType2["MESSAGE"] = "message";
|
|
1809
|
+
MessageType2["CONNECTION_REQUEST"] = "connection_request";
|
|
1810
|
+
MessageType2["CONNECTION_ACCEPTED"] = "connection_accepted";
|
|
1811
|
+
MessageType2["INMAIL"] = "inmail";
|
|
1812
|
+
return MessageType2;
|
|
1813
|
+
})(MessageType || {});
|
|
1814
|
+
var DraftStatus = /* @__PURE__ */ ((DraftStatus2) => {
|
|
1815
|
+
DraftStatus2["PENDING_REVIEW"] = "pending_review";
|
|
1816
|
+
DraftStatus2["APPROVED"] = "approved";
|
|
1817
|
+
DraftStatus2["SCHEDULED"] = "scheduled";
|
|
1818
|
+
DraftStatus2["SENDING"] = "sending";
|
|
1819
|
+
DraftStatus2["SENT"] = "sent";
|
|
1820
|
+
DraftStatus2["FAILED"] = "failed";
|
|
1821
|
+
DraftStatus2["DISCARDED"] = "discarded";
|
|
1822
|
+
return DraftStatus2;
|
|
1823
|
+
})(DraftStatus || {});
|
|
1824
|
+
var SyncJobStatus = /* @__PURE__ */ ((SyncJobStatus2) => {
|
|
1825
|
+
SyncJobStatus2["QUEUED"] = "queued";
|
|
1826
|
+
SyncJobStatus2["IN_PROGRESS"] = "in_progress";
|
|
1827
|
+
SyncJobStatus2["COMPLETED"] = "completed";
|
|
1828
|
+
SyncJobStatus2["FAILED"] = "failed";
|
|
1829
|
+
return SyncJobStatus2;
|
|
1830
|
+
})(SyncJobStatus || {});
|
|
1831
|
+
var QueueItemStatus = /* @__PURE__ */ ((QueueItemStatus2) => {
|
|
1832
|
+
QueueItemStatus2["QUEUED"] = "queued";
|
|
1833
|
+
QueueItemStatus2["PROCESSING"] = "processing";
|
|
1834
|
+
QueueItemStatus2["COMPLETED"] = "completed";
|
|
1835
|
+
QueueItemStatus2["FAILED"] = "failed";
|
|
1836
|
+
QueueItemStatus2["CANCELLED"] = "cancelled";
|
|
1837
|
+
return QueueItemStatus2;
|
|
1838
|
+
})(QueueItemStatus || {});
|
|
1839
|
+
var LinkedInSubscriptionType = /* @__PURE__ */ ((LinkedInSubscriptionType2) => {
|
|
1840
|
+
LinkedInSubscriptionType2["BASIC"] = "basic";
|
|
1841
|
+
LinkedInSubscriptionType2["PREMIUM"] = "premium";
|
|
1842
|
+
LinkedInSubscriptionType2["SALES_NAVIGATOR"] = "sales_navigator";
|
|
1843
|
+
LinkedInSubscriptionType2["RECRUITER_LITE"] = "recruiter_lite";
|
|
1844
|
+
LinkedInSubscriptionType2["RECRUITER_CORPORATE"] = "recruiter_corporate";
|
|
1845
|
+
return LinkedInSubscriptionType2;
|
|
1846
|
+
})(LinkedInSubscriptionType || {});
|
|
1847
|
+
var NetworkDistance = /* @__PURE__ */ ((NetworkDistance2) => {
|
|
1848
|
+
NetworkDistance2["FIRST_DEGREE"] = "FIRST_DEGREE";
|
|
1849
|
+
NetworkDistance2["SECOND_DEGREE"] = "SECOND_DEGREE";
|
|
1850
|
+
NetworkDistance2["THIRD_DEGREE"] = "THIRD_DEGREE";
|
|
1851
|
+
NetworkDistance2["OUT_OF_NETWORK"] = "OUT_OF_NETWORK";
|
|
1852
|
+
return NetworkDistance2;
|
|
1853
|
+
})(NetworkDistance || {});
|
|
1854
|
+
|
|
1436
1855
|
function displayProgress(update, indent = " ") {
|
|
1437
1856
|
if (update.state === "tool_update") {
|
|
1438
1857
|
if (update.toolCalls && update.toolCalls.length > 0) {
|
|
@@ -1528,4 +1947,18 @@ class ProgressTracker {
|
|
|
1528
1947
|
}
|
|
1529
1948
|
}
|
|
1530
1949
|
|
|
1531
|
-
|
|
1950
|
+
function verifyWebhookSignature(payload, signature, secret) {
|
|
1951
|
+
if (!signature || !secret) {
|
|
1952
|
+
return false;
|
|
1953
|
+
}
|
|
1954
|
+
const expectedSignature = crypto$1.createHmac("sha256", secret).update(payload).digest("hex");
|
|
1955
|
+
if (signature.length !== expectedSignature.length) {
|
|
1956
|
+
return false;
|
|
1957
|
+
}
|
|
1958
|
+
return crypto$1.timingSafeEqual(
|
|
1959
|
+
Buffer.from(signature),
|
|
1960
|
+
Buffer.from(expectedSignature)
|
|
1961
|
+
);
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
export { AuthenticationError, ChannelType, ConversationStatus, DraftStatus, InternalServerError, LinkedInSubscriptionType, LocalFileNotSupportedError, LumnisClient, LumnisError, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingSendError, MessagingValidationError, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, PeopleDataSource, ProgressTracker, ProviderType, QueueItemStatus, RateLimitError, SourcesNotAvailableError, SyncJobStatus, ValidationError, LumnisClient as default, displayProgress, formatProgressEntry, verifyWebhookSignature };
|