lumnisai 0.1.15 → 0.1.17

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 CHANGED
@@ -9,6 +9,181 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  const crypto__default = /*#__PURE__*/_interopDefaultCompat(crypto$1);
11
11
 
12
+ const LINKEDIN_LIMITS = {
13
+ basic: {
14
+ connectionRequests: {
15
+ weeklyMax: 100,
16
+ dailySafe: 15
17
+ },
18
+ messages: {
19
+ weeklyMax: 100,
20
+ dailySafe: 15
21
+ },
22
+ inmail: {
23
+ monthlyCredits: 0,
24
+ maxAccumulation: 0,
25
+ rollover: false
26
+ },
27
+ profileViews: {
28
+ dailyMax: 500,
29
+ dailySafe: 250
30
+ }
31
+ },
32
+ premium_career: {
33
+ connectionRequests: {
34
+ weeklyMax: 150,
35
+ dailySafe: 20
36
+ },
37
+ messages: {
38
+ weeklyMax: 150,
39
+ dailySafe: 20
40
+ },
41
+ inmail: {
42
+ monthlyCredits: 5,
43
+ maxAccumulation: 15,
44
+ rollover: true
45
+ },
46
+ profileViews: {
47
+ dailyMax: 1e3,
48
+ // Premium (non-SN): 150-1000/day
49
+ dailySafe: 300
50
+ }
51
+ },
52
+ premium_business: {
53
+ connectionRequests: {
54
+ weeklyMax: 150,
55
+ // Same as Premium Career, SSI-dependent
56
+ dailySafe: 20
57
+ },
58
+ messages: {
59
+ weeklyMax: 150,
60
+ dailySafe: 20
61
+ },
62
+ inmail: {
63
+ monthlyCredits: 15,
64
+ maxAccumulation: 45,
65
+ rollover: true
66
+ },
67
+ profileViews: {
68
+ dailyMax: 1e3,
69
+ // Premium (non-SN): 150-1000/day
70
+ dailySafe: 300
71
+ }
72
+ },
73
+ sales_navigator: {
74
+ connectionRequests: {
75
+ weeklyMax: 200,
76
+ dailySafe: 25
77
+ },
78
+ messages: {
79
+ weeklyMax: 150,
80
+ dailySafe: 20
81
+ },
82
+ inmail: {
83
+ monthlyCredits: 50,
84
+ maxAccumulation: 150,
85
+ rollover: true
86
+ },
87
+ profileViews: {
88
+ dailyMax: 2e3,
89
+ dailySafe: 500
90
+ }
91
+ },
92
+ recruiter_lite: {
93
+ connectionRequests: {
94
+ weeklyMax: 200,
95
+ dailySafe: 25
96
+ },
97
+ messages: {
98
+ weeklyMax: 200,
99
+ dailySafe: 25
100
+ },
101
+ inmail: {
102
+ monthlyCredits: 30,
103
+ maxAccumulation: 120,
104
+ // LinkedIn official: 120 max per seat
105
+ rollover: true
106
+ },
107
+ profileViews: {
108
+ dailyMax: 2e3,
109
+ dailySafe: 500
110
+ }
111
+ },
112
+ recruiter_corporate: {
113
+ connectionRequests: {
114
+ weeklyMax: 250,
115
+ dailySafe: 30
116
+ },
117
+ messages: {
118
+ weeklyMax: 200,
119
+ dailySafe: 30
120
+ },
121
+ inmail: {
122
+ monthlyCredits: 150,
123
+ maxAccumulation: 600,
124
+ rollover: true
125
+ },
126
+ profileViews: {
127
+ dailyMax: 2e3,
128
+ dailySafe: 500
129
+ }
130
+ }
131
+ };
132
+ const ACTION_DELAYS = {
133
+ betweenConnectionRequests: 30,
134
+ betweenMessages: 15,
135
+ betweenProfileViews: 5,
136
+ afterError: 60
137
+ };
138
+ function getLimits(subscriptionType) {
139
+ const type = subscriptionType || "basic";
140
+ return LINKEDIN_LIMITS[type] || LINKEDIN_LIMITS.basic;
141
+ }
142
+ function getConnectionRequestLimit(subscriptionType, useSafeLimit = true) {
143
+ const limits = getLimits(subscriptionType);
144
+ return useSafeLimit ? limits.connectionRequests.dailySafe : limits.connectionRequests.weeklyMax;
145
+ }
146
+ function getMessageLimit(subscriptionType, useSafeLimit = true) {
147
+ const limits = getLimits(subscriptionType);
148
+ return useSafeLimit ? limits.messages.dailySafe : limits.messages.weeklyMax;
149
+ }
150
+ function getInmailAllowance(subscriptionType) {
151
+ const limits = getLimits(subscriptionType);
152
+ return limits.inmail;
153
+ }
154
+ function canSendInmail(subscriptionType) {
155
+ const limits = getLimits(subscriptionType);
156
+ return limits.inmail.monthlyCredits > 0;
157
+ }
158
+ function getBestSubscriptionForAction(subscriptionTypes, action) {
159
+ if (subscriptionTypes.length === 0)
160
+ return null;
161
+ if (subscriptionTypes.length === 1)
162
+ return subscriptionTypes[0];
163
+ if (action === "inmail") {
164
+ const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
165
+ for (const priorityType of priority) {
166
+ if (subscriptionTypes.includes(priorityType))
167
+ return priorityType;
168
+ }
169
+ }
170
+ if (action === "connection_requests") {
171
+ const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium_career", "basic"];
172
+ for (const priorityType of priority) {
173
+ if (subscriptionTypes.includes(priorityType))
174
+ return priorityType;
175
+ }
176
+ }
177
+ if (action === "messages") {
178
+ const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
179
+ for (const priorityType of priority) {
180
+ if (subscriptionTypes.includes(priorityType))
181
+ return priorityType;
182
+ }
183
+ }
184
+ return subscriptionTypes[0];
185
+ }
186
+
12
187
  const DEFAULT_BASE_URL = "https://api.lumnis.ai";
13
188
  const DEFAULT_POLL_INTERVAL_MS = 2e3;
14
189
  const LONG_POLL_TIMEOUT_S = 10;
@@ -714,6 +889,58 @@ class MessagingResource {
714
889
  request
715
890
  );
716
891
  }
892
+ /**
893
+ * Get comprehensive LinkedIn account information including subscriptions, InMail credits, and capabilities.
894
+ * By default returns cached data if fresh (< 1 hour old). Set forceRefresh=true to fetch real-time data from Unipile API.
895
+ *
896
+ * **Features:**
897
+ * - Multiple subscription detection (Sales Navigator + Recruiter simultaneously)
898
+ * - InMail credit tracking per subscription
899
+ * - Capability flags (canSendInmail, canUseSalesNavigatorApi, canUseRecruiterApi)
900
+ * - Smart caching with auto-refresh
901
+ *
902
+ * **Example:**
903
+ * ```typescript
904
+ * // Get account info (uses smart caching)
905
+ * const accountInfo = await client.messaging.getLinkedInAccountInfo('user@example.com');
906
+ *
907
+ * // Force refresh from Unipile API
908
+ * const freshInfo = await client.messaging.getLinkedInAccountInfo('user@example.com', {
909
+ * forceRefresh: true
910
+ * });
911
+ *
912
+ * // Check capabilities
913
+ * if (accountInfo.canSendInmail) {
914
+ * console.log(`User has ${accountInfo.inmailCreditsRemaining} InMail credits`);
915
+ * }
916
+ *
917
+ * // Check specific subscriptions
918
+ * const hasSalesNav = accountInfo.subscriptions.some(s => s.type === 'sales_navigator');
919
+ * const hasRecruiter = accountInfo.subscriptions.some(s =>
920
+ * s.type === 'recruiter_lite' || s.type === 'recruiter_corporate'
921
+ * );
922
+ *
923
+ * // Get credits per subscription
924
+ * for (const sub of accountInfo.subscriptions) {
925
+ * console.log(`${sub.type}: ${sub.inmailCreditsRemaining}/${sub.monthlyAllowance} credits`);
926
+ * }
927
+ * ```
928
+ *
929
+ * @param userId - User ID or email
930
+ * @param options - Optional parameters
931
+ * @param options.forceRefresh - Force refresh from Unipile API (default: false)
932
+ * @returns LinkedInAccountInfoResponse with account information
933
+ */
934
+ async getLinkedInAccountInfo(userId, options) {
935
+ const queryParams = new URLSearchParams();
936
+ queryParams.append("user_id", userId);
937
+ if (options?.forceRefresh) {
938
+ queryParams.append("force_refresh", "true");
939
+ }
940
+ return this.http.get(
941
+ `/messaging/linkedin/account-info?${queryParams.toString()}`
942
+ );
943
+ }
717
944
  /**
718
945
  * Get InMail credit information.
719
946
  * By default returns cached data. Set forceRefresh=true to fetch real-time data from Unipile API.
@@ -2487,11 +2714,13 @@ function verifyWebhookSignature(payload, signature, secret) {
2487
2714
  );
2488
2715
  }
2489
2716
 
2717
+ exports.ACTION_DELAYS = ACTION_DELAYS;
2490
2718
  exports.AuthenticationError = AuthenticationError;
2491
2719
  exports.ChannelType = ChannelType;
2492
2720
  exports.ConversationStatus = ConversationStatus;
2493
2721
  exports.DraftStatus = DraftStatus;
2494
2722
  exports.InternalServerError = InternalServerError;
2723
+ exports.LINKEDIN_LIMITS = LINKEDIN_LIMITS;
2495
2724
  exports.LinkedInSubscriptionType = LinkedInSubscriptionType;
2496
2725
  exports.LocalFileNotSupportedError = LocalFileNotSupportedError;
2497
2726
  exports.LumnisClient = LumnisClient;
@@ -2514,7 +2743,13 @@ exports.RateLimitError = RateLimitError;
2514
2743
  exports.SourcesNotAvailableError = SourcesNotAvailableError;
2515
2744
  exports.SyncJobStatus = SyncJobStatus;
2516
2745
  exports.ValidationError = ValidationError;
2746
+ exports.canSendInmail = canSendInmail;
2517
2747
  exports.default = LumnisClient;
2518
2748
  exports.displayProgress = displayProgress;
2519
2749
  exports.formatProgressEntry = formatProgressEntry;
2750
+ exports.getBestSubscriptionForAction = getBestSubscriptionForAction;
2751
+ exports.getConnectionRequestLimit = getConnectionRequestLimit;
2752
+ exports.getInmailAllowance = getInmailAllowance;
2753
+ exports.getLimits = getLimits;
2754
+ exports.getMessageLimit = getMessageLimit;
2520
2755
  exports.verifyWebhookSignature = verifyWebhookSignature;
package/dist/index.d.cts CHANGED
@@ -1,3 +1,71 @@
1
+ /**
2
+ * LinkedIn subscription types
3
+ */
4
+ type LinkedInSubscriptionType$1 = 'basic' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
5
+ /**
6
+ * LinkedIn limits by subscription type
7
+ */
8
+ interface LinkedInLimits {
9
+ connectionRequests: {
10
+ weeklyMax: number;
11
+ dailySafe: number;
12
+ };
13
+ messages: {
14
+ weeklyMax: number;
15
+ dailySafe: number;
16
+ };
17
+ inmail: {
18
+ monthlyCredits: number;
19
+ maxAccumulation: number;
20
+ rollover: boolean;
21
+ };
22
+ profileViews: {
23
+ dailyMax: number;
24
+ dailySafe: number;
25
+ };
26
+ }
27
+ /**
28
+ * LinkedIn rate limits by subscription type
29
+ */
30
+ declare const LINKEDIN_LIMITS: Record<LinkedInSubscriptionType$1, LinkedInLimits>;
31
+ /**
32
+ * Action delays for human-like behavior (in seconds)
33
+ */
34
+ declare const ACTION_DELAYS: {
35
+ readonly betweenConnectionRequests: 30;
36
+ readonly betweenMessages: 15;
37
+ readonly betweenProfileViews: 5;
38
+ readonly afterError: 60;
39
+ };
40
+ /**
41
+ * Get all limits for a subscription type
42
+ */
43
+ declare function getLimits(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): LinkedInLimits;
44
+ /**
45
+ * Get connection request limit for a subscription type
46
+ */
47
+ declare function getConnectionRequestLimit(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined, useSafeLimit?: boolean): number;
48
+ /**
49
+ * Get message limit for a subscription type
50
+ */
51
+ declare function getMessageLimit(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined, useSafeLimit?: boolean): number;
52
+ /**
53
+ * Get InMail allowance for a subscription type
54
+ */
55
+ declare function getInmailAllowance(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): {
56
+ monthlyCredits: number;
57
+ maxAccumulation: number;
58
+ rollover: boolean;
59
+ };
60
+ /**
61
+ * Check if subscription can send InMail
62
+ */
63
+ declare function canSendInmail(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): boolean;
64
+ /**
65
+ * Get best subscription for a specific action when user has multiple subscriptions
66
+ */
67
+ declare function getBestSubscriptionForAction(subscriptionTypes: (LinkedInSubscriptionType$1 | string)[], action: 'inmail' | 'connection_requests' | 'messages'): LinkedInSubscriptionType$1 | string | null;
68
+
1
69
  interface PaginationParams {
2
70
  page?: number;
3
71
  pageSize?: number;
@@ -516,10 +584,12 @@ interface ModelOverrides {
516
584
  }
517
585
  /**
518
586
  * Available specialized agents
587
+ * Using a union type that can be extended with any string to support future agents
519
588
  */
520
- type SpecializedAgentType = 'quick_people_search';
589
+ type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
521
590
  /**
522
591
  * Parameters for specialized agent execution
592
+ * This is a flexible interface that supports any agent-specific parameters
523
593
  */
524
594
  interface SpecializedAgentParams {
525
595
  /**
@@ -527,11 +597,21 @@ interface SpecializedAgentParams {
527
597
  * Agent-specific: For quick_people_search, limits the number of candidates returned
528
598
  */
529
599
  limit?: number;
600
+ /**
601
+ * Number of candidates requested (for deep_people_search)
602
+ * Range: 1-1000
603
+ */
604
+ requestedCandidates?: number;
530
605
  /**
531
606
  * Specific data sources to use (agent-specific)
532
- * For quick_people_search: ["PDL", "CORESIGNAL", "CRUST_DATA"]
607
+ * For people search agents: ["PDL", "CORESIGNAL", "CRUST_DATA"]
533
608
  */
534
609
  dataSources?: string[];
610
+ /**
611
+ * Additional parameters for any specialized agent
612
+ * This allows flexibility for future agents without SDK updates
613
+ */
614
+ [key: string]: any;
535
615
  }
536
616
  interface CreateResponseRequest {
537
617
  threadId?: UUID;
@@ -545,7 +625,8 @@ interface CreateResponseRequest {
545
625
  modelOverrides?: ModelOverrides;
546
626
  /**
547
627
  * Route to a specialized agent instead of the main Lumnis agent
548
- * Available agents: 'quick_people_search'
628
+ * Known agents: 'quick_people_search', 'deep_people_search'
629
+ * Accepts any string to support future agents without SDK updates
549
630
  */
550
631
  specializedAgent?: SpecializedAgentType;
551
632
  /**
@@ -1521,6 +1602,37 @@ interface LinkedInCreditsResponse {
1521
1602
  creditsUpdatedAt?: string | null;
1522
1603
  isRealTime?: boolean;
1523
1604
  }
1605
+ /**
1606
+ * LinkedIn subscription information
1607
+ */
1608
+ interface LinkedInSubscriptionInfo {
1609
+ type: string;
1610
+ feature: string;
1611
+ inmailCreditsRemaining?: number | null;
1612
+ inmailCreditsUpdatedAt?: string | null;
1613
+ monthlyAllowance: number;
1614
+ maxAccumulation: number;
1615
+ isActive: boolean;
1616
+ }
1617
+ /**
1618
+ * Comprehensive LinkedIn account information response
1619
+ */
1620
+ interface LinkedInAccountInfoResponse {
1621
+ connected: boolean;
1622
+ accountId?: string | null;
1623
+ connectedAt?: string | null;
1624
+ subscriptions: LinkedInSubscriptionInfo[];
1625
+ subscriptionType?: string | null;
1626
+ feature?: string | null;
1627
+ inmailCreditsRemaining?: number | null;
1628
+ inmailCreditsUpdatedAt?: string | null;
1629
+ monthlyInmailAllowance?: number | null;
1630
+ maxInmailAccumulation?: number | null;
1631
+ canSendInmail: boolean;
1632
+ canUseSalesNavigatorApi: boolean;
1633
+ canUseRecruiterApi: boolean;
1634
+ unipileStatus?: string | null;
1635
+ }
1524
1636
  /**
1525
1637
  * Conversation summary
1526
1638
  */
@@ -1899,6 +2011,51 @@ declare class MessagingResource {
1899
2011
  * Smart LinkedIn outreach with automatic method selection
1900
2012
  */
1901
2013
  sendLinkedInOutreach(userId: string, request: LinkedInSendRequest): Promise<SendResult>;
2014
+ /**
2015
+ * Get comprehensive LinkedIn account information including subscriptions, InMail credits, and capabilities.
2016
+ * By default returns cached data if fresh (< 1 hour old). Set forceRefresh=true to fetch real-time data from Unipile API.
2017
+ *
2018
+ * **Features:**
2019
+ * - Multiple subscription detection (Sales Navigator + Recruiter simultaneously)
2020
+ * - InMail credit tracking per subscription
2021
+ * - Capability flags (canSendInmail, canUseSalesNavigatorApi, canUseRecruiterApi)
2022
+ * - Smart caching with auto-refresh
2023
+ *
2024
+ * **Example:**
2025
+ * ```typescript
2026
+ * // Get account info (uses smart caching)
2027
+ * const accountInfo = await client.messaging.getLinkedInAccountInfo('user@example.com');
2028
+ *
2029
+ * // Force refresh from Unipile API
2030
+ * const freshInfo = await client.messaging.getLinkedInAccountInfo('user@example.com', {
2031
+ * forceRefresh: true
2032
+ * });
2033
+ *
2034
+ * // Check capabilities
2035
+ * if (accountInfo.canSendInmail) {
2036
+ * console.log(`User has ${accountInfo.inmailCreditsRemaining} InMail credits`);
2037
+ * }
2038
+ *
2039
+ * // Check specific subscriptions
2040
+ * const hasSalesNav = accountInfo.subscriptions.some(s => s.type === 'sales_navigator');
2041
+ * const hasRecruiter = accountInfo.subscriptions.some(s =>
2042
+ * s.type === 'recruiter_lite' || s.type === 'recruiter_corporate'
2043
+ * );
2044
+ *
2045
+ * // Get credits per subscription
2046
+ * for (const sub of accountInfo.subscriptions) {
2047
+ * console.log(`${sub.type}: ${sub.inmailCreditsRemaining}/${sub.monthlyAllowance} credits`);
2048
+ * }
2049
+ * ```
2050
+ *
2051
+ * @param userId - User ID or email
2052
+ * @param options - Optional parameters
2053
+ * @param options.forceRefresh - Force refresh from Unipile API (default: false)
2054
+ * @returns LinkedInAccountInfoResponse with account information
2055
+ */
2056
+ getLinkedInAccountInfo(userId: string, options?: {
2057
+ forceRefresh?: boolean;
2058
+ }): Promise<LinkedInAccountInfoResponse>;
1902
2059
  /**
1903
2060
  * Get InMail credit information.
1904
2061
  * By default returns cached data. Set forceRefresh=true to fetch real-time data from Unipile API.
@@ -2732,4 +2889,4 @@ declare class ProgressTracker {
2732
2889
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
2733
2890
 
2734
2891
  export = LumnisClient;
2735
- export { type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInSendRequest, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, displayProgress, formatProgressEntry, verifyWebhookSignature };
2892
+ export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, type LinkedInSubscriptionType$1 as LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, verifyWebhookSignature };
package/dist/index.d.mts CHANGED
@@ -1,3 +1,71 @@
1
+ /**
2
+ * LinkedIn subscription types
3
+ */
4
+ type LinkedInSubscriptionType$1 = 'basic' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
5
+ /**
6
+ * LinkedIn limits by subscription type
7
+ */
8
+ interface LinkedInLimits {
9
+ connectionRequests: {
10
+ weeklyMax: number;
11
+ dailySafe: number;
12
+ };
13
+ messages: {
14
+ weeklyMax: number;
15
+ dailySafe: number;
16
+ };
17
+ inmail: {
18
+ monthlyCredits: number;
19
+ maxAccumulation: number;
20
+ rollover: boolean;
21
+ };
22
+ profileViews: {
23
+ dailyMax: number;
24
+ dailySafe: number;
25
+ };
26
+ }
27
+ /**
28
+ * LinkedIn rate limits by subscription type
29
+ */
30
+ declare const LINKEDIN_LIMITS: Record<LinkedInSubscriptionType$1, LinkedInLimits>;
31
+ /**
32
+ * Action delays for human-like behavior (in seconds)
33
+ */
34
+ declare const ACTION_DELAYS: {
35
+ readonly betweenConnectionRequests: 30;
36
+ readonly betweenMessages: 15;
37
+ readonly betweenProfileViews: 5;
38
+ readonly afterError: 60;
39
+ };
40
+ /**
41
+ * Get all limits for a subscription type
42
+ */
43
+ declare function getLimits(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): LinkedInLimits;
44
+ /**
45
+ * Get connection request limit for a subscription type
46
+ */
47
+ declare function getConnectionRequestLimit(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined, useSafeLimit?: boolean): number;
48
+ /**
49
+ * Get message limit for a subscription type
50
+ */
51
+ declare function getMessageLimit(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined, useSafeLimit?: boolean): number;
52
+ /**
53
+ * Get InMail allowance for a subscription type
54
+ */
55
+ declare function getInmailAllowance(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): {
56
+ monthlyCredits: number;
57
+ maxAccumulation: number;
58
+ rollover: boolean;
59
+ };
60
+ /**
61
+ * Check if subscription can send InMail
62
+ */
63
+ declare function canSendInmail(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): boolean;
64
+ /**
65
+ * Get best subscription for a specific action when user has multiple subscriptions
66
+ */
67
+ declare function getBestSubscriptionForAction(subscriptionTypes: (LinkedInSubscriptionType$1 | string)[], action: 'inmail' | 'connection_requests' | 'messages'): LinkedInSubscriptionType$1 | string | null;
68
+
1
69
  interface PaginationParams {
2
70
  page?: number;
3
71
  pageSize?: number;
@@ -516,10 +584,12 @@ interface ModelOverrides {
516
584
  }
517
585
  /**
518
586
  * Available specialized agents
587
+ * Using a union type that can be extended with any string to support future agents
519
588
  */
520
- type SpecializedAgentType = 'quick_people_search';
589
+ type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
521
590
  /**
522
591
  * Parameters for specialized agent execution
592
+ * This is a flexible interface that supports any agent-specific parameters
523
593
  */
524
594
  interface SpecializedAgentParams {
525
595
  /**
@@ -527,11 +597,21 @@ interface SpecializedAgentParams {
527
597
  * Agent-specific: For quick_people_search, limits the number of candidates returned
528
598
  */
529
599
  limit?: number;
600
+ /**
601
+ * Number of candidates requested (for deep_people_search)
602
+ * Range: 1-1000
603
+ */
604
+ requestedCandidates?: number;
530
605
  /**
531
606
  * Specific data sources to use (agent-specific)
532
- * For quick_people_search: ["PDL", "CORESIGNAL", "CRUST_DATA"]
607
+ * For people search agents: ["PDL", "CORESIGNAL", "CRUST_DATA"]
533
608
  */
534
609
  dataSources?: string[];
610
+ /**
611
+ * Additional parameters for any specialized agent
612
+ * This allows flexibility for future agents without SDK updates
613
+ */
614
+ [key: string]: any;
535
615
  }
536
616
  interface CreateResponseRequest {
537
617
  threadId?: UUID;
@@ -545,7 +625,8 @@ interface CreateResponseRequest {
545
625
  modelOverrides?: ModelOverrides;
546
626
  /**
547
627
  * Route to a specialized agent instead of the main Lumnis agent
548
- * Available agents: 'quick_people_search'
628
+ * Known agents: 'quick_people_search', 'deep_people_search'
629
+ * Accepts any string to support future agents without SDK updates
549
630
  */
550
631
  specializedAgent?: SpecializedAgentType;
551
632
  /**
@@ -1521,6 +1602,37 @@ interface LinkedInCreditsResponse {
1521
1602
  creditsUpdatedAt?: string | null;
1522
1603
  isRealTime?: boolean;
1523
1604
  }
1605
+ /**
1606
+ * LinkedIn subscription information
1607
+ */
1608
+ interface LinkedInSubscriptionInfo {
1609
+ type: string;
1610
+ feature: string;
1611
+ inmailCreditsRemaining?: number | null;
1612
+ inmailCreditsUpdatedAt?: string | null;
1613
+ monthlyAllowance: number;
1614
+ maxAccumulation: number;
1615
+ isActive: boolean;
1616
+ }
1617
+ /**
1618
+ * Comprehensive LinkedIn account information response
1619
+ */
1620
+ interface LinkedInAccountInfoResponse {
1621
+ connected: boolean;
1622
+ accountId?: string | null;
1623
+ connectedAt?: string | null;
1624
+ subscriptions: LinkedInSubscriptionInfo[];
1625
+ subscriptionType?: string | null;
1626
+ feature?: string | null;
1627
+ inmailCreditsRemaining?: number | null;
1628
+ inmailCreditsUpdatedAt?: string | null;
1629
+ monthlyInmailAllowance?: number | null;
1630
+ maxInmailAccumulation?: number | null;
1631
+ canSendInmail: boolean;
1632
+ canUseSalesNavigatorApi: boolean;
1633
+ canUseRecruiterApi: boolean;
1634
+ unipileStatus?: string | null;
1635
+ }
1524
1636
  /**
1525
1637
  * Conversation summary
1526
1638
  */
@@ -1899,6 +2011,51 @@ declare class MessagingResource {
1899
2011
  * Smart LinkedIn outreach with automatic method selection
1900
2012
  */
1901
2013
  sendLinkedInOutreach(userId: string, request: LinkedInSendRequest): Promise<SendResult>;
2014
+ /**
2015
+ * Get comprehensive LinkedIn account information including subscriptions, InMail credits, and capabilities.
2016
+ * By default returns cached data if fresh (< 1 hour old). Set forceRefresh=true to fetch real-time data from Unipile API.
2017
+ *
2018
+ * **Features:**
2019
+ * - Multiple subscription detection (Sales Navigator + Recruiter simultaneously)
2020
+ * - InMail credit tracking per subscription
2021
+ * - Capability flags (canSendInmail, canUseSalesNavigatorApi, canUseRecruiterApi)
2022
+ * - Smart caching with auto-refresh
2023
+ *
2024
+ * **Example:**
2025
+ * ```typescript
2026
+ * // Get account info (uses smart caching)
2027
+ * const accountInfo = await client.messaging.getLinkedInAccountInfo('user@example.com');
2028
+ *
2029
+ * // Force refresh from Unipile API
2030
+ * const freshInfo = await client.messaging.getLinkedInAccountInfo('user@example.com', {
2031
+ * forceRefresh: true
2032
+ * });
2033
+ *
2034
+ * // Check capabilities
2035
+ * if (accountInfo.canSendInmail) {
2036
+ * console.log(`User has ${accountInfo.inmailCreditsRemaining} InMail credits`);
2037
+ * }
2038
+ *
2039
+ * // Check specific subscriptions
2040
+ * const hasSalesNav = accountInfo.subscriptions.some(s => s.type === 'sales_navigator');
2041
+ * const hasRecruiter = accountInfo.subscriptions.some(s =>
2042
+ * s.type === 'recruiter_lite' || s.type === 'recruiter_corporate'
2043
+ * );
2044
+ *
2045
+ * // Get credits per subscription
2046
+ * for (const sub of accountInfo.subscriptions) {
2047
+ * console.log(`${sub.type}: ${sub.inmailCreditsRemaining}/${sub.monthlyAllowance} credits`);
2048
+ * }
2049
+ * ```
2050
+ *
2051
+ * @param userId - User ID or email
2052
+ * @param options - Optional parameters
2053
+ * @param options.forceRefresh - Force refresh from Unipile API (default: false)
2054
+ * @returns LinkedInAccountInfoResponse with account information
2055
+ */
2056
+ getLinkedInAccountInfo(userId: string, options?: {
2057
+ forceRefresh?: boolean;
2058
+ }): Promise<LinkedInAccountInfoResponse>;
1902
2059
  /**
1903
2060
  * Get InMail credit information.
1904
2061
  * By default returns cached data. Set forceRefresh=true to fetch real-time data from Unipile API.
@@ -2731,4 +2888,4 @@ declare class ProgressTracker {
2731
2888
  */
2732
2889
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
2733
2890
 
2734
- export { type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInSendRequest, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, LumnisClient as default, displayProgress, formatProgressEntry, verifyWebhookSignature };
2891
+ export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, type LinkedInSubscriptionType$1 as LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, LumnisClient as default, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,71 @@
1
+ /**
2
+ * LinkedIn subscription types
3
+ */
4
+ type LinkedInSubscriptionType$1 = 'basic' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
5
+ /**
6
+ * LinkedIn limits by subscription type
7
+ */
8
+ interface LinkedInLimits {
9
+ connectionRequests: {
10
+ weeklyMax: number;
11
+ dailySafe: number;
12
+ };
13
+ messages: {
14
+ weeklyMax: number;
15
+ dailySafe: number;
16
+ };
17
+ inmail: {
18
+ monthlyCredits: number;
19
+ maxAccumulation: number;
20
+ rollover: boolean;
21
+ };
22
+ profileViews: {
23
+ dailyMax: number;
24
+ dailySafe: number;
25
+ };
26
+ }
27
+ /**
28
+ * LinkedIn rate limits by subscription type
29
+ */
30
+ declare const LINKEDIN_LIMITS: Record<LinkedInSubscriptionType$1, LinkedInLimits>;
31
+ /**
32
+ * Action delays for human-like behavior (in seconds)
33
+ */
34
+ declare const ACTION_DELAYS: {
35
+ readonly betweenConnectionRequests: 30;
36
+ readonly betweenMessages: 15;
37
+ readonly betweenProfileViews: 5;
38
+ readonly afterError: 60;
39
+ };
40
+ /**
41
+ * Get all limits for a subscription type
42
+ */
43
+ declare function getLimits(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): LinkedInLimits;
44
+ /**
45
+ * Get connection request limit for a subscription type
46
+ */
47
+ declare function getConnectionRequestLimit(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined, useSafeLimit?: boolean): number;
48
+ /**
49
+ * Get message limit for a subscription type
50
+ */
51
+ declare function getMessageLimit(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined, useSafeLimit?: boolean): number;
52
+ /**
53
+ * Get InMail allowance for a subscription type
54
+ */
55
+ declare function getInmailAllowance(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): {
56
+ monthlyCredits: number;
57
+ maxAccumulation: number;
58
+ rollover: boolean;
59
+ };
60
+ /**
61
+ * Check if subscription can send InMail
62
+ */
63
+ declare function canSendInmail(subscriptionType: LinkedInSubscriptionType$1 | string | null | undefined): boolean;
64
+ /**
65
+ * Get best subscription for a specific action when user has multiple subscriptions
66
+ */
67
+ declare function getBestSubscriptionForAction(subscriptionTypes: (LinkedInSubscriptionType$1 | string)[], action: 'inmail' | 'connection_requests' | 'messages'): LinkedInSubscriptionType$1 | string | null;
68
+
1
69
  interface PaginationParams {
2
70
  page?: number;
3
71
  pageSize?: number;
@@ -516,10 +584,12 @@ interface ModelOverrides {
516
584
  }
517
585
  /**
518
586
  * Available specialized agents
587
+ * Using a union type that can be extended with any string to support future agents
519
588
  */
520
- type SpecializedAgentType = 'quick_people_search';
589
+ type SpecializedAgentType = 'quick_people_search' | 'deep_people_search' | (string & {});
521
590
  /**
522
591
  * Parameters for specialized agent execution
592
+ * This is a flexible interface that supports any agent-specific parameters
523
593
  */
524
594
  interface SpecializedAgentParams {
525
595
  /**
@@ -527,11 +597,21 @@ interface SpecializedAgentParams {
527
597
  * Agent-specific: For quick_people_search, limits the number of candidates returned
528
598
  */
529
599
  limit?: number;
600
+ /**
601
+ * Number of candidates requested (for deep_people_search)
602
+ * Range: 1-1000
603
+ */
604
+ requestedCandidates?: number;
530
605
  /**
531
606
  * Specific data sources to use (agent-specific)
532
- * For quick_people_search: ["PDL", "CORESIGNAL", "CRUST_DATA"]
607
+ * For people search agents: ["PDL", "CORESIGNAL", "CRUST_DATA"]
533
608
  */
534
609
  dataSources?: string[];
610
+ /**
611
+ * Additional parameters for any specialized agent
612
+ * This allows flexibility for future agents without SDK updates
613
+ */
614
+ [key: string]: any;
535
615
  }
536
616
  interface CreateResponseRequest {
537
617
  threadId?: UUID;
@@ -545,7 +625,8 @@ interface CreateResponseRequest {
545
625
  modelOverrides?: ModelOverrides;
546
626
  /**
547
627
  * Route to a specialized agent instead of the main Lumnis agent
548
- * Available agents: 'quick_people_search'
628
+ * Known agents: 'quick_people_search', 'deep_people_search'
629
+ * Accepts any string to support future agents without SDK updates
549
630
  */
550
631
  specializedAgent?: SpecializedAgentType;
551
632
  /**
@@ -1521,6 +1602,37 @@ interface LinkedInCreditsResponse {
1521
1602
  creditsUpdatedAt?: string | null;
1522
1603
  isRealTime?: boolean;
1523
1604
  }
1605
+ /**
1606
+ * LinkedIn subscription information
1607
+ */
1608
+ interface LinkedInSubscriptionInfo {
1609
+ type: string;
1610
+ feature: string;
1611
+ inmailCreditsRemaining?: number | null;
1612
+ inmailCreditsUpdatedAt?: string | null;
1613
+ monthlyAllowance: number;
1614
+ maxAccumulation: number;
1615
+ isActive: boolean;
1616
+ }
1617
+ /**
1618
+ * Comprehensive LinkedIn account information response
1619
+ */
1620
+ interface LinkedInAccountInfoResponse {
1621
+ connected: boolean;
1622
+ accountId?: string | null;
1623
+ connectedAt?: string | null;
1624
+ subscriptions: LinkedInSubscriptionInfo[];
1625
+ subscriptionType?: string | null;
1626
+ feature?: string | null;
1627
+ inmailCreditsRemaining?: number | null;
1628
+ inmailCreditsUpdatedAt?: string | null;
1629
+ monthlyInmailAllowance?: number | null;
1630
+ maxInmailAccumulation?: number | null;
1631
+ canSendInmail: boolean;
1632
+ canUseSalesNavigatorApi: boolean;
1633
+ canUseRecruiterApi: boolean;
1634
+ unipileStatus?: string | null;
1635
+ }
1524
1636
  /**
1525
1637
  * Conversation summary
1526
1638
  */
@@ -1899,6 +2011,51 @@ declare class MessagingResource {
1899
2011
  * Smart LinkedIn outreach with automatic method selection
1900
2012
  */
1901
2013
  sendLinkedInOutreach(userId: string, request: LinkedInSendRequest): Promise<SendResult>;
2014
+ /**
2015
+ * Get comprehensive LinkedIn account information including subscriptions, InMail credits, and capabilities.
2016
+ * By default returns cached data if fresh (< 1 hour old). Set forceRefresh=true to fetch real-time data from Unipile API.
2017
+ *
2018
+ * **Features:**
2019
+ * - Multiple subscription detection (Sales Navigator + Recruiter simultaneously)
2020
+ * - InMail credit tracking per subscription
2021
+ * - Capability flags (canSendInmail, canUseSalesNavigatorApi, canUseRecruiterApi)
2022
+ * - Smart caching with auto-refresh
2023
+ *
2024
+ * **Example:**
2025
+ * ```typescript
2026
+ * // Get account info (uses smart caching)
2027
+ * const accountInfo = await client.messaging.getLinkedInAccountInfo('user@example.com');
2028
+ *
2029
+ * // Force refresh from Unipile API
2030
+ * const freshInfo = await client.messaging.getLinkedInAccountInfo('user@example.com', {
2031
+ * forceRefresh: true
2032
+ * });
2033
+ *
2034
+ * // Check capabilities
2035
+ * if (accountInfo.canSendInmail) {
2036
+ * console.log(`User has ${accountInfo.inmailCreditsRemaining} InMail credits`);
2037
+ * }
2038
+ *
2039
+ * // Check specific subscriptions
2040
+ * const hasSalesNav = accountInfo.subscriptions.some(s => s.type === 'sales_navigator');
2041
+ * const hasRecruiter = accountInfo.subscriptions.some(s =>
2042
+ * s.type === 'recruiter_lite' || s.type === 'recruiter_corporate'
2043
+ * );
2044
+ *
2045
+ * // Get credits per subscription
2046
+ * for (const sub of accountInfo.subscriptions) {
2047
+ * console.log(`${sub.type}: ${sub.inmailCreditsRemaining}/${sub.monthlyAllowance} credits`);
2048
+ * }
2049
+ * ```
2050
+ *
2051
+ * @param userId - User ID or email
2052
+ * @param options - Optional parameters
2053
+ * @param options.forceRefresh - Force refresh from Unipile API (default: false)
2054
+ * @returns LinkedInAccountInfoResponse with account information
2055
+ */
2056
+ getLinkedInAccountInfo(userId: string, options?: {
2057
+ forceRefresh?: boolean;
2058
+ }): Promise<LinkedInAccountInfoResponse>;
1902
2059
  /**
1903
2060
  * Get InMail credit information.
1904
2061
  * By default returns cached data. Set forceRefresh=true to fetch real-time data from Unipile API.
@@ -2732,4 +2889,4 @@ declare class ProgressTracker {
2732
2889
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
2733
2890
 
2734
2891
  export = LumnisClient;
2735
- export { type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInSendRequest, LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, displayProgress, formatProgressEntry, verifyWebhookSignature };
2892
+ export { ACTION_DELAYS, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BatchCheckConnectionRequest, type BatchCheckPriorContactRequest, type BatchCheckPriorContactResponse, type BatchConnectionRequest, type BatchConnectionResponse, type BatchConnectionStatus, type BatchConnectionStatusResponse, type BatchDraftCompleteData, type BatchDraftCreatedData, type BatchDraftErrorData, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchProspectIdentifier, type BatchSendRequest, type BatchSendResponse, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, DraftStatus, type DuplicateHandling, type Email, type EmailThreadSummary, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FeedbackListResponse, type FeedbackObject, type FeedbackType, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type FilterLogic, type FilterValue, type GetConnectionStatusParams, type GetToolsRequest, type GetToolsResponse, type GetUserConnectionsParams, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LinkedInAccountInfoResponse, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, type LinkedInSubscriptionType$1 as LinkedInSubscriptionType, type ListProvidersResponse, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type MessageReceivedData, type MessageResponse, type MessageSentData, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingResource, MessagingSendError, MessagingValidationError, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, type PaginationInfo, type PaginationParams, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProspectConnectionCheck, type ProspectInfo, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SkillAnalyticsRequest, type SkillEffectivenessMetrics, type SkillGuidelineBase, type SkillGuidelineCreate, type SkillGuidelineListResponse, type SkillGuidelineResponse, type SkillGuidelineUpdate, type SkillRetrievalMetadata, type SkillUsageBase, type SkillUsageCreate, type SkillUsageListResponse, type SkillUsageResponse, type SkillUsageUpdate, SkillsResource, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StoreApiKeyRequest, type SyncJobResponse, SyncJobStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateLinkedInSubscriptionRequest, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, verifyWebhookSignature };
package/dist/index.mjs CHANGED
@@ -1,6 +1,181 @@
1
1
  import { Buffer } from 'node:buffer';
2
2
  import crypto$1 from 'node:crypto';
3
3
 
4
+ const LINKEDIN_LIMITS = {
5
+ basic: {
6
+ connectionRequests: {
7
+ weeklyMax: 100,
8
+ dailySafe: 15
9
+ },
10
+ messages: {
11
+ weeklyMax: 100,
12
+ dailySafe: 15
13
+ },
14
+ inmail: {
15
+ monthlyCredits: 0,
16
+ maxAccumulation: 0,
17
+ rollover: false
18
+ },
19
+ profileViews: {
20
+ dailyMax: 500,
21
+ dailySafe: 250
22
+ }
23
+ },
24
+ premium_career: {
25
+ connectionRequests: {
26
+ weeklyMax: 150,
27
+ dailySafe: 20
28
+ },
29
+ messages: {
30
+ weeklyMax: 150,
31
+ dailySafe: 20
32
+ },
33
+ inmail: {
34
+ monthlyCredits: 5,
35
+ maxAccumulation: 15,
36
+ rollover: true
37
+ },
38
+ profileViews: {
39
+ dailyMax: 1e3,
40
+ // Premium (non-SN): 150-1000/day
41
+ dailySafe: 300
42
+ }
43
+ },
44
+ premium_business: {
45
+ connectionRequests: {
46
+ weeklyMax: 150,
47
+ // Same as Premium Career, SSI-dependent
48
+ dailySafe: 20
49
+ },
50
+ messages: {
51
+ weeklyMax: 150,
52
+ dailySafe: 20
53
+ },
54
+ inmail: {
55
+ monthlyCredits: 15,
56
+ maxAccumulation: 45,
57
+ rollover: true
58
+ },
59
+ profileViews: {
60
+ dailyMax: 1e3,
61
+ // Premium (non-SN): 150-1000/day
62
+ dailySafe: 300
63
+ }
64
+ },
65
+ sales_navigator: {
66
+ connectionRequests: {
67
+ weeklyMax: 200,
68
+ dailySafe: 25
69
+ },
70
+ messages: {
71
+ weeklyMax: 150,
72
+ dailySafe: 20
73
+ },
74
+ inmail: {
75
+ monthlyCredits: 50,
76
+ maxAccumulation: 150,
77
+ rollover: true
78
+ },
79
+ profileViews: {
80
+ dailyMax: 2e3,
81
+ dailySafe: 500
82
+ }
83
+ },
84
+ recruiter_lite: {
85
+ connectionRequests: {
86
+ weeklyMax: 200,
87
+ dailySafe: 25
88
+ },
89
+ messages: {
90
+ weeklyMax: 200,
91
+ dailySafe: 25
92
+ },
93
+ inmail: {
94
+ monthlyCredits: 30,
95
+ maxAccumulation: 120,
96
+ // LinkedIn official: 120 max per seat
97
+ rollover: true
98
+ },
99
+ profileViews: {
100
+ dailyMax: 2e3,
101
+ dailySafe: 500
102
+ }
103
+ },
104
+ recruiter_corporate: {
105
+ connectionRequests: {
106
+ weeklyMax: 250,
107
+ dailySafe: 30
108
+ },
109
+ messages: {
110
+ weeklyMax: 200,
111
+ dailySafe: 30
112
+ },
113
+ inmail: {
114
+ monthlyCredits: 150,
115
+ maxAccumulation: 600,
116
+ rollover: true
117
+ },
118
+ profileViews: {
119
+ dailyMax: 2e3,
120
+ dailySafe: 500
121
+ }
122
+ }
123
+ };
124
+ const ACTION_DELAYS = {
125
+ betweenConnectionRequests: 30,
126
+ betweenMessages: 15,
127
+ betweenProfileViews: 5,
128
+ afterError: 60
129
+ };
130
+ function getLimits(subscriptionType) {
131
+ const type = subscriptionType || "basic";
132
+ return LINKEDIN_LIMITS[type] || LINKEDIN_LIMITS.basic;
133
+ }
134
+ function getConnectionRequestLimit(subscriptionType, useSafeLimit = true) {
135
+ const limits = getLimits(subscriptionType);
136
+ return useSafeLimit ? limits.connectionRequests.dailySafe : limits.connectionRequests.weeklyMax;
137
+ }
138
+ function getMessageLimit(subscriptionType, useSafeLimit = true) {
139
+ const limits = getLimits(subscriptionType);
140
+ return useSafeLimit ? limits.messages.dailySafe : limits.messages.weeklyMax;
141
+ }
142
+ function getInmailAllowance(subscriptionType) {
143
+ const limits = getLimits(subscriptionType);
144
+ return limits.inmail;
145
+ }
146
+ function canSendInmail(subscriptionType) {
147
+ const limits = getLimits(subscriptionType);
148
+ return limits.inmail.monthlyCredits > 0;
149
+ }
150
+ function getBestSubscriptionForAction(subscriptionTypes, action) {
151
+ if (subscriptionTypes.length === 0)
152
+ return null;
153
+ if (subscriptionTypes.length === 1)
154
+ return subscriptionTypes[0];
155
+ if (action === "inmail") {
156
+ const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
157
+ for (const priorityType of priority) {
158
+ if (subscriptionTypes.includes(priorityType))
159
+ return priorityType;
160
+ }
161
+ }
162
+ if (action === "connection_requests") {
163
+ const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium_career", "basic"];
164
+ for (const priorityType of priority) {
165
+ if (subscriptionTypes.includes(priorityType))
166
+ return priorityType;
167
+ }
168
+ }
169
+ if (action === "messages") {
170
+ const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
171
+ for (const priorityType of priority) {
172
+ if (subscriptionTypes.includes(priorityType))
173
+ return priorityType;
174
+ }
175
+ }
176
+ return subscriptionTypes[0];
177
+ }
178
+
4
179
  const DEFAULT_BASE_URL = "https://api.lumnis.ai";
5
180
  const DEFAULT_POLL_INTERVAL_MS = 2e3;
6
181
  const LONG_POLL_TIMEOUT_S = 10;
@@ -706,6 +881,58 @@ class MessagingResource {
706
881
  request
707
882
  );
708
883
  }
884
+ /**
885
+ * Get comprehensive LinkedIn account information including subscriptions, InMail credits, and capabilities.
886
+ * By default returns cached data if fresh (< 1 hour old). Set forceRefresh=true to fetch real-time data from Unipile API.
887
+ *
888
+ * **Features:**
889
+ * - Multiple subscription detection (Sales Navigator + Recruiter simultaneously)
890
+ * - InMail credit tracking per subscription
891
+ * - Capability flags (canSendInmail, canUseSalesNavigatorApi, canUseRecruiterApi)
892
+ * - Smart caching with auto-refresh
893
+ *
894
+ * **Example:**
895
+ * ```typescript
896
+ * // Get account info (uses smart caching)
897
+ * const accountInfo = await client.messaging.getLinkedInAccountInfo('user@example.com');
898
+ *
899
+ * // Force refresh from Unipile API
900
+ * const freshInfo = await client.messaging.getLinkedInAccountInfo('user@example.com', {
901
+ * forceRefresh: true
902
+ * });
903
+ *
904
+ * // Check capabilities
905
+ * if (accountInfo.canSendInmail) {
906
+ * console.log(`User has ${accountInfo.inmailCreditsRemaining} InMail credits`);
907
+ * }
908
+ *
909
+ * // Check specific subscriptions
910
+ * const hasSalesNav = accountInfo.subscriptions.some(s => s.type === 'sales_navigator');
911
+ * const hasRecruiter = accountInfo.subscriptions.some(s =>
912
+ * s.type === 'recruiter_lite' || s.type === 'recruiter_corporate'
913
+ * );
914
+ *
915
+ * // Get credits per subscription
916
+ * for (const sub of accountInfo.subscriptions) {
917
+ * console.log(`${sub.type}: ${sub.inmailCreditsRemaining}/${sub.monthlyAllowance} credits`);
918
+ * }
919
+ * ```
920
+ *
921
+ * @param userId - User ID or email
922
+ * @param options - Optional parameters
923
+ * @param options.forceRefresh - Force refresh from Unipile API (default: false)
924
+ * @returns LinkedInAccountInfoResponse with account information
925
+ */
926
+ async getLinkedInAccountInfo(userId, options) {
927
+ const queryParams = new URLSearchParams();
928
+ queryParams.append("user_id", userId);
929
+ if (options?.forceRefresh) {
930
+ queryParams.append("force_refresh", "true");
931
+ }
932
+ return this.http.get(
933
+ `/messaging/linkedin/account-info?${queryParams.toString()}`
934
+ );
935
+ }
709
936
  /**
710
937
  * Get InMail credit information.
711
938
  * By default returns cached data. Set forceRefresh=true to fetch real-time data from Unipile API.
@@ -2479,4 +2706,4 @@ function verifyWebhookSignature(payload, signature, secret) {
2479
2706
  );
2480
2707
  }
2481
2708
 
2482
- 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 };
2709
+ export { ACTION_DELAYS, AuthenticationError, ChannelType, ConversationStatus, DraftStatus, InternalServerError, LINKEDIN_LIMITS, LinkedInSubscriptionType, LocalFileNotSupportedError, LumnisClient, LumnisError, MessageType, MessagingAPIError, MessagingConnectionError, MessagingNotFoundError, MessagingSendError, MessagingValidationError, NetworkDistance, NoDataSourcesError, NotFoundError, OutreachMethod, PeopleDataSource, ProgressTracker, ProviderType, QueueItemStatus, RateLimitError, SourcesNotAvailableError, SyncJobStatus, ValidationError, canSendInmail, LumnisClient as default, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lumnisai",
3
3
  "type": "module",
4
- "version": "0.1.15",
4
+ "version": "0.1.17",
5
5
  "description": "Official Node.js SDK for the Lumnis AI API",
6
6
  "author": "Lumnis AI",
7
7
  "license": "MIT",