lumnisai 0.1.19 → 0.1.20

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
@@ -11,7 +11,9 @@ const LINKEDIN_LIMITS = {
11
11
  basic: {
12
12
  connectionRequests: {
13
13
  weeklyMax: 100,
14
- dailySafe: 15
14
+ dailySafe: 15,
15
+ personalizedMonthly: 10
16
+ // Very limited personalized requests
15
17
  },
16
18
  messages: {
17
19
  weeklyMax: 100,
@@ -25,13 +27,41 @@ const LINKEDIN_LIMITS = {
25
27
  profileViews: {
26
28
  dailyMax: 500,
27
29
  dailySafe: 250
28
- }
30
+ },
31
+ openProfileMessagesMonthly: null
29
32
  },
30
- premium_career: {
33
+ premium: {
31
34
  connectionRequests: {
35
+ weeklyMax: 150,
36
+ // Same as basic, SSI-dependent
37
+ dailySafe: 20,
38
+ personalizedMonthly: null
39
+ // Unlimited
40
+ },
41
+ messages: {
32
42
  weeklyMax: 150,
33
43
  dailySafe: 20
34
44
  },
45
+ inmail: {
46
+ monthlyCredits: 5,
47
+ maxAccumulation: 15,
48
+ rollover: true
49
+ },
50
+ profileViews: {
51
+ dailyMax: 1e3,
52
+ // Premium (non-SN): 150-1000/day
53
+ dailySafe: 500
54
+ },
55
+ openProfileMessagesMonthly: null
56
+ },
57
+ premium_career: {
58
+ connectionRequests: {
59
+ weeklyMax: 150,
60
+ // Same as basic, SSI-dependent
61
+ dailySafe: 20,
62
+ personalizedMonthly: null
63
+ // Unlimited
64
+ },
35
65
  messages: {
36
66
  weeklyMax: 150,
37
67
  dailySafe: 20
@@ -44,14 +74,16 @@ const LINKEDIN_LIMITS = {
44
74
  profileViews: {
45
75
  dailyMax: 1e3,
46
76
  // Premium (non-SN): 150-1000/day
47
- dailySafe: 300
48
- }
77
+ dailySafe: 500
78
+ },
79
+ openProfileMessagesMonthly: null
49
80
  },
50
81
  premium_business: {
51
82
  connectionRequests: {
52
83
  weeklyMax: 150,
53
84
  // Same as Premium Career, SSI-dependent
54
- dailySafe: 20
85
+ dailySafe: 20,
86
+ personalizedMonthly: null
55
87
  },
56
88
  messages: {
57
89
  weeklyMax: 150,
@@ -65,13 +97,15 @@ const LINKEDIN_LIMITS = {
65
97
  profileViews: {
66
98
  dailyMax: 1e3,
67
99
  // Premium (non-SN): 150-1000/day
68
- dailySafe: 300
69
- }
100
+ dailySafe: 500
101
+ },
102
+ openProfileMessagesMonthly: null
70
103
  },
71
104
  sales_navigator: {
72
105
  connectionRequests: {
73
106
  weeklyMax: 200,
74
- dailySafe: 25
107
+ dailySafe: 25,
108
+ personalizedMonthly: null
75
109
  },
76
110
  messages: {
77
111
  weeklyMax: 150,
@@ -84,13 +118,15 @@ const LINKEDIN_LIMITS = {
84
118
  },
85
119
  profileViews: {
86
120
  dailyMax: 2e3,
87
- dailySafe: 500
88
- }
121
+ dailySafe: 1e3
122
+ },
123
+ openProfileMessagesMonthly: null
89
124
  },
90
125
  recruiter_lite: {
91
126
  connectionRequests: {
92
127
  weeklyMax: 200,
93
- dailySafe: 25
128
+ dailySafe: 25,
129
+ personalizedMonthly: null
94
130
  },
95
131
  messages: {
96
132
  weeklyMax: 200,
@@ -104,13 +140,15 @@ const LINKEDIN_LIMITS = {
104
140
  },
105
141
  profileViews: {
106
142
  dailyMax: 2e3,
107
- dailySafe: 500
108
- }
143
+ dailySafe: 1e3
144
+ },
145
+ openProfileMessagesMonthly: 1e3
109
146
  },
110
147
  recruiter_corporate: {
111
148
  connectionRequests: {
112
149
  weeklyMax: 250,
113
- dailySafe: 30
150
+ dailySafe: 30,
151
+ personalizedMonthly: null
114
152
  },
115
153
  messages: {
116
154
  weeklyMax: 200,
@@ -123,10 +161,63 @@ const LINKEDIN_LIMITS = {
123
161
  },
124
162
  profileViews: {
125
163
  dailyMax: 2e3,
126
- dailySafe: 500
127
- }
164
+ dailySafe: 1e3
165
+ },
166
+ openProfileMessagesMonthly: 1e3
167
+ }
168
+ };
169
+ const UNIPILE_SAFE_LIMITS = {
170
+ // Connection requests per day (Unipile recommends 80-100 for paid)
171
+ connectionRequestsDaily: {
172
+ basic: 15,
173
+ premium: 20,
174
+ premium_career: 20,
175
+ premium_business: 20,
176
+ sales_navigator: 25,
177
+ recruiter_lite: 25,
178
+ recruiter_corporate: 30
179
+ },
180
+ // Messages per day (steady pace recommended)
181
+ messagesDaily: {
182
+ basic: 15,
183
+ premium: 20,
184
+ premium_career: 20,
185
+ premium_business: 20,
186
+ sales_navigator: 20,
187
+ recruiter_lite: 25,
188
+ recruiter_corporate: 30
189
+ },
190
+ // Profile views per day (stay under 50% of max)
191
+ profileViewsDaily: {
192
+ basic: 250,
193
+ premium: 300,
194
+ // 50% of 1000 max, conservative
195
+ premium_career: 300,
196
+ premium_business: 300,
197
+ sales_navigator: 500,
198
+ // 50% of 2000 max
199
+ recruiter_lite: 500,
200
+ recruiter_corporate: 500
128
201
  }
129
202
  };
203
+ const RATE_LIMIT_COOLDOWNS = {
204
+ connectionRequestRejected: 3600,
205
+ // 1 hour after rejection
206
+ messageRateLimited: 1800,
207
+ // 30 min after rate limit
208
+ dailyLimitReached: 86400,
209
+ // 24 hours
210
+ weeklyLimitReached: 604800
211
+ // 7 days
212
+ };
213
+ const UNIPILE_RATE_LIMIT_ERRORS = {
214
+ 422: "cannot_resend_yet",
215
+ // Connection request limit
216
+ 429: "rate_limited",
217
+ // Too many requests
218
+ 500: "server_error_possibly_rate_limited"
219
+ // Sometimes indicates limits
220
+ };
130
221
  const ACTION_DELAYS = {
131
222
  betweenConnectionRequests: 30,
132
223
  betweenMessages: 15,
@@ -153,27 +244,23 @@ function canSendInmail(subscriptionType) {
153
244
  const limits = getLimits(subscriptionType);
154
245
  return limits.inmail.monthlyCredits > 0;
155
246
  }
247
+ function hasOpenProfileMessages(subscriptionType) {
248
+ const limits = getLimits(subscriptionType);
249
+ return limits.openProfileMessagesMonthly !== null;
250
+ }
156
251
  function getBestSubscriptionForAction(subscriptionTypes, action) {
157
252
  if (subscriptionTypes.length === 0)
158
253
  return null;
159
254
  if (subscriptionTypes.length === 1)
160
255
  return subscriptionTypes[0];
161
256
  if (action === "inmail") {
162
- const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
257
+ const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium", "premium_career"];
163
258
  for (const priorityType of priority) {
164
259
  if (subscriptionTypes.includes(priorityType))
165
260
  return priorityType;
166
261
  }
167
- }
168
- if (action === "connection_requests") {
169
- const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium_career", "basic"];
170
- for (const priorityType of priority) {
171
- if (subscriptionTypes.includes(priorityType))
172
- return priorityType;
173
- }
174
- }
175
- if (action === "messages") {
176
- const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
262
+ } else {
263
+ const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium", "premium_career", "basic"];
177
264
  for (const priorityType of priority) {
178
265
  if (subscriptionTypes.includes(priorityType))
179
266
  return priorityType;
@@ -2751,9 +2838,12 @@ exports.PeopleDataSource = PeopleDataSource;
2751
2838
  exports.ProgressTracker = ProgressTracker;
2752
2839
  exports.ProviderType = ProviderType;
2753
2840
  exports.QueueItemStatus = QueueItemStatus;
2841
+ exports.RATE_LIMIT_COOLDOWNS = RATE_LIMIT_COOLDOWNS;
2754
2842
  exports.RateLimitError = RateLimitError;
2755
2843
  exports.SourcesNotAvailableError = SourcesNotAvailableError;
2756
2844
  exports.SyncJobStatus = SyncJobStatus;
2845
+ exports.UNIPILE_RATE_LIMIT_ERRORS = UNIPILE_RATE_LIMIT_ERRORS;
2846
+ exports.UNIPILE_SAFE_LIMITS = UNIPILE_SAFE_LIMITS;
2757
2847
  exports.ValidationError = ValidationError;
2758
2848
  exports.canSendInmail = canSendInmail;
2759
2849
  exports.displayProgress = displayProgress;
@@ -2763,4 +2853,5 @@ exports.getConnectionRequestLimit = getConnectionRequestLimit;
2763
2853
  exports.getInmailAllowance = getInmailAllowance;
2764
2854
  exports.getLimits = getLimits;
2765
2855
  exports.getMessageLimit = getMessageLimit;
2856
+ exports.hasOpenProfileMessages = hasOpenProfileMessages;
2766
2857
  exports.verifyWebhookSignature = verifyWebhookSignature;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * LinkedIn subscription types
3
3
  */
4
- type LinkedInLimitSubscriptionType = 'basic' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
4
+ type LinkedInLimitSubscriptionType = 'basic' | 'premium' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
5
5
  /**
6
6
  * LinkedIn limits by subscription type
7
7
  */
@@ -9,6 +9,7 @@ interface LinkedInLimits {
9
9
  connectionRequests: {
10
10
  weeklyMax: number;
11
11
  dailySafe: number;
12
+ personalizedMonthly: number | null;
12
13
  };
13
14
  messages: {
14
15
  weeklyMax: number;
@@ -23,11 +24,58 @@ interface LinkedInLimits {
23
24
  dailyMax: number;
24
25
  dailySafe: number;
25
26
  };
27
+ openProfileMessagesMonthly: number | null;
26
28
  }
27
29
  /**
28
30
  * LinkedIn rate limits by subscription type
29
31
  */
30
32
  declare const LINKEDIN_LIMITS: Record<LinkedInLimitSubscriptionType, LinkedInLimits>;
33
+ /**
34
+ * Safe limits when using automation (more conservative than LinkedIn's limits)
35
+ * These are Unipile-recommended limits for automation
36
+ */
37
+ declare const UNIPILE_SAFE_LIMITS: {
38
+ readonly connectionRequestsDaily: {
39
+ readonly basic: 15;
40
+ readonly premium: 20;
41
+ readonly premium_career: 20;
42
+ readonly premium_business: 20;
43
+ readonly sales_navigator: 25;
44
+ readonly recruiter_lite: 25;
45
+ readonly recruiter_corporate: 30;
46
+ };
47
+ readonly messagesDaily: {
48
+ readonly basic: 15;
49
+ readonly premium: 20;
50
+ readonly premium_career: 20;
51
+ readonly premium_business: 20;
52
+ readonly sales_navigator: 20;
53
+ readonly recruiter_lite: 25;
54
+ readonly recruiter_corporate: 30;
55
+ };
56
+ readonly profileViewsDaily: {
57
+ readonly basic: 250;
58
+ readonly premium: 300;
59
+ readonly premium_career: 300;
60
+ readonly premium_business: 300;
61
+ readonly sales_navigator: 500;
62
+ readonly recruiter_lite: 500;
63
+ readonly recruiter_corporate: 500;
64
+ };
65
+ };
66
+ /**
67
+ * Cooldown periods (in seconds) after hitting limits
68
+ */
69
+ declare const RATE_LIMIT_COOLDOWNS: {
70
+ readonly connectionRequestRejected: 3600;
71
+ readonly messageRateLimited: 1800;
72
+ readonly dailyLimitReached: 86400;
73
+ readonly weeklyLimitReached: 604800;
74
+ };
75
+ /**
76
+ * HTTP error codes from Unipile indicating rate limits
77
+ */
78
+ declare const UNIPILE_RATE_LIMIT_ERRORS: Record<number, string>;
31
79
  /**
32
80
  * Action delays for human-like behavior (in seconds)
33
81
  */
@@ -61,8 +109,16 @@ declare function getInmailAllowance(subscriptionType: LinkedInLimitSubscriptionT
61
109
  * Check if subscription can send InMail
62
110
  */
63
111
  declare function canSendInmail(subscriptionType: LinkedInLimitSubscriptionType | string | null | undefined): boolean;
112
+ /**
113
+ * Check if subscription has Open Profile messaging (Recruiter only)
114
+ */
115
+ declare function hasOpenProfileMessages(subscriptionType: LinkedInLimitSubscriptionType | string | null | undefined): boolean;
64
116
  /**
65
117
  * Get best subscription for a specific action when user has multiple subscriptions
118
+ *
119
+ * Priority order matches backend:
120
+ * - InMail: recruiter_corporate > sales_navigator > recruiter_lite > premium_business > premium_career
121
+ * - Other actions: recruiter_corporate > sales_navigator > recruiter_lite > premium_business > premium_career > basic
66
122
  */
67
123
  declare function getBestSubscriptionForAction(subscriptionTypes: (LinkedInLimitSubscriptionType | string)[], action: 'inmail' | 'connection_requests' | 'messages'): LinkedInLimitSubscriptionType | string | null;
68
124
 
@@ -1390,10 +1446,14 @@ interface ProspectSyncIdentifier {
1390
1446
  providerId?: string | null;
1391
1447
  }
1392
1448
  /**
1393
- * Request to sync conversations (prospects REQUIRED)
1449
+ * Request to sync conversations for specific prospects.
1450
+ *
1451
+ * Prospects list is required - syncs only conversations for the specified prospects.
1452
+ * This ensures efficient, targeted syncing without pulling unrelated inbox data.
1394
1453
  */
1395
1454
  interface SyncRequest {
1396
1455
  channels?: string[] | null;
1456
+ /** List of prospects to sync (required). Must include at least one prospect with an identifier. */
1397
1457
  prospects: ProspectSyncIdentifier[];
1398
1458
  }
1399
1459
  /**
@@ -1504,7 +1564,8 @@ interface ProspectInfo {
1504
1564
  interface BatchDraftRequest {
1505
1565
  prospects: ProspectInfo[];
1506
1566
  projectId: string;
1507
- channel?: string;
1567
+ /** Default channel if not specified per prospect */
1568
+ channel: string;
1508
1569
  subjectTemplate?: string | null;
1509
1570
  contentTemplate?: string | null;
1510
1571
  useAiGeneration?: boolean;
@@ -1604,15 +1665,19 @@ interface LinkedInCreditsResponse {
1604
1665
  subscriptionType?: string | null;
1605
1666
  creditsRemaining?: number | null;
1606
1667
  creditsUpdatedAt?: string | null;
1607
- isRealTime?: boolean;
1668
+ isRealTime: boolean;
1608
1669
  canSendInmail: boolean;
1609
1670
  }
1610
1671
  /**
1611
1672
  * Individual LinkedIn subscription with its own InMail credit pool.
1612
- * A LinkedIn account can have multiple subscriptions simultaneously.
1673
+ *
1674
+ * A LinkedIn account can have multiple subscriptions (e.g., Sales Navigator + Recruiter).
1675
+ * Each subscription has its own InMail credits.
1613
1676
  */
1614
1677
  interface LinkedInSubscriptionInfo {
1678
+ /** Subscription type: 'basic' | 'premium' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate' */
1615
1679
  type: string;
1680
+ /** Raw Unipile feature: 'classic' | 'sales_navigator' | 'recruiter' */
1616
1681
  feature: string;
1617
1682
  inmailCreditsRemaining?: number | null;
1618
1683
  inmailCreditsUpdatedAt?: string | null;
@@ -1621,7 +1686,14 @@ interface LinkedInSubscriptionInfo {
1621
1686
  isActive: boolean;
1622
1687
  }
1623
1688
  /**
1624
- * Comprehensive LinkedIn account information response
1689
+ * Full LinkedIn account information with multiple subscription support.
1690
+ *
1691
+ * A LinkedIn account can have multiple subscriptions simultaneously:
1692
+ * - Sales Navigator (for sales professionals)
1693
+ * - Recruiter (for hiring)
1694
+ * - Premium Career (personal use)
1695
+ *
1696
+ * Each subscription has its own InMail credit pool.
1625
1697
  */
1626
1698
  interface LinkedInAccountInfoResponse {
1627
1699
  connected: boolean;
@@ -1637,6 +1709,11 @@ interface LinkedInAccountInfoResponse {
1637
1709
  canSendInmail: boolean;
1638
1710
  canUseSalesNavigatorApi: boolean;
1639
1711
  canUseRecruiterApi: boolean;
1712
+ inmailSentToday?: number | null;
1713
+ directMessagesSentToday?: number | null;
1714
+ connectionRequestsSentToday?: number | null;
1715
+ gmailSentToday?: number | null;
1716
+ outlookSentToday?: number | null;
1640
1717
  unipileStatus?: string | null;
1641
1718
  }
1642
1719
  /**
@@ -2908,4 +2985,4 @@ declare class ProgressTracker {
2908
2985
  */
2909
2986
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
2910
2987
 
2911
- 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 LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, 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 };
2988
+ 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 LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, 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, RATE_LIMIT_COOLDOWNS, 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, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, 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, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * LinkedIn subscription types
3
3
  */
4
- type LinkedInLimitSubscriptionType = 'basic' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
4
+ type LinkedInLimitSubscriptionType = 'basic' | 'premium' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
5
5
  /**
6
6
  * LinkedIn limits by subscription type
7
7
  */
@@ -9,6 +9,7 @@ interface LinkedInLimits {
9
9
  connectionRequests: {
10
10
  weeklyMax: number;
11
11
  dailySafe: number;
12
+ personalizedMonthly: number | null;
12
13
  };
13
14
  messages: {
14
15
  weeklyMax: number;
@@ -23,11 +24,58 @@ interface LinkedInLimits {
23
24
  dailyMax: number;
24
25
  dailySafe: number;
25
26
  };
27
+ openProfileMessagesMonthly: number | null;
26
28
  }
27
29
  /**
28
30
  * LinkedIn rate limits by subscription type
29
31
  */
30
32
  declare const LINKEDIN_LIMITS: Record<LinkedInLimitSubscriptionType, LinkedInLimits>;
33
+ /**
34
+ * Safe limits when using automation (more conservative than LinkedIn's limits)
35
+ * These are Unipile-recommended limits for automation
36
+ */
37
+ declare const UNIPILE_SAFE_LIMITS: {
38
+ readonly connectionRequestsDaily: {
39
+ readonly basic: 15;
40
+ readonly premium: 20;
41
+ readonly premium_career: 20;
42
+ readonly premium_business: 20;
43
+ readonly sales_navigator: 25;
44
+ readonly recruiter_lite: 25;
45
+ readonly recruiter_corporate: 30;
46
+ };
47
+ readonly messagesDaily: {
48
+ readonly basic: 15;
49
+ readonly premium: 20;
50
+ readonly premium_career: 20;
51
+ readonly premium_business: 20;
52
+ readonly sales_navigator: 20;
53
+ readonly recruiter_lite: 25;
54
+ readonly recruiter_corporate: 30;
55
+ };
56
+ readonly profileViewsDaily: {
57
+ readonly basic: 250;
58
+ readonly premium: 300;
59
+ readonly premium_career: 300;
60
+ readonly premium_business: 300;
61
+ readonly sales_navigator: 500;
62
+ readonly recruiter_lite: 500;
63
+ readonly recruiter_corporate: 500;
64
+ };
65
+ };
66
+ /**
67
+ * Cooldown periods (in seconds) after hitting limits
68
+ */
69
+ declare const RATE_LIMIT_COOLDOWNS: {
70
+ readonly connectionRequestRejected: 3600;
71
+ readonly messageRateLimited: 1800;
72
+ readonly dailyLimitReached: 86400;
73
+ readonly weeklyLimitReached: 604800;
74
+ };
75
+ /**
76
+ * HTTP error codes from Unipile indicating rate limits
77
+ */
78
+ declare const UNIPILE_RATE_LIMIT_ERRORS: Record<number, string>;
31
79
  /**
32
80
  * Action delays for human-like behavior (in seconds)
33
81
  */
@@ -61,8 +109,16 @@ declare function getInmailAllowance(subscriptionType: LinkedInLimitSubscriptionT
61
109
  * Check if subscription can send InMail
62
110
  */
63
111
  declare function canSendInmail(subscriptionType: LinkedInLimitSubscriptionType | string | null | undefined): boolean;
112
+ /**
113
+ * Check if subscription has Open Profile messaging (Recruiter only)
114
+ */
115
+ declare function hasOpenProfileMessages(subscriptionType: LinkedInLimitSubscriptionType | string | null | undefined): boolean;
64
116
  /**
65
117
  * Get best subscription for a specific action when user has multiple subscriptions
118
+ *
119
+ * Priority order matches backend:
120
+ * - InMail: recruiter_corporate > sales_navigator > recruiter_lite > premium_business > premium_career
121
+ * - Other actions: recruiter_corporate > sales_navigator > recruiter_lite > premium_business > premium_career > basic
66
122
  */
67
123
  declare function getBestSubscriptionForAction(subscriptionTypes: (LinkedInLimitSubscriptionType | string)[], action: 'inmail' | 'connection_requests' | 'messages'): LinkedInLimitSubscriptionType | string | null;
68
124
 
@@ -1390,10 +1446,14 @@ interface ProspectSyncIdentifier {
1390
1446
  providerId?: string | null;
1391
1447
  }
1392
1448
  /**
1393
- * Request to sync conversations (prospects REQUIRED)
1449
+ * Request to sync conversations for specific prospects.
1450
+ *
1451
+ * Prospects list is required - syncs only conversations for the specified prospects.
1452
+ * This ensures efficient, targeted syncing without pulling unrelated inbox data.
1394
1453
  */
1395
1454
  interface SyncRequest {
1396
1455
  channels?: string[] | null;
1456
+ /** List of prospects to sync (required). Must include at least one prospect with an identifier. */
1397
1457
  prospects: ProspectSyncIdentifier[];
1398
1458
  }
1399
1459
  /**
@@ -1504,7 +1564,8 @@ interface ProspectInfo {
1504
1564
  interface BatchDraftRequest {
1505
1565
  prospects: ProspectInfo[];
1506
1566
  projectId: string;
1507
- channel?: string;
1567
+ /** Default channel if not specified per prospect */
1568
+ channel: string;
1508
1569
  subjectTemplate?: string | null;
1509
1570
  contentTemplate?: string | null;
1510
1571
  useAiGeneration?: boolean;
@@ -1604,15 +1665,19 @@ interface LinkedInCreditsResponse {
1604
1665
  subscriptionType?: string | null;
1605
1666
  creditsRemaining?: number | null;
1606
1667
  creditsUpdatedAt?: string | null;
1607
- isRealTime?: boolean;
1668
+ isRealTime: boolean;
1608
1669
  canSendInmail: boolean;
1609
1670
  }
1610
1671
  /**
1611
1672
  * Individual LinkedIn subscription with its own InMail credit pool.
1612
- * A LinkedIn account can have multiple subscriptions simultaneously.
1673
+ *
1674
+ * A LinkedIn account can have multiple subscriptions (e.g., Sales Navigator + Recruiter).
1675
+ * Each subscription has its own InMail credits.
1613
1676
  */
1614
1677
  interface LinkedInSubscriptionInfo {
1678
+ /** Subscription type: 'basic' | 'premium' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate' */
1615
1679
  type: string;
1680
+ /** Raw Unipile feature: 'classic' | 'sales_navigator' | 'recruiter' */
1616
1681
  feature: string;
1617
1682
  inmailCreditsRemaining?: number | null;
1618
1683
  inmailCreditsUpdatedAt?: string | null;
@@ -1621,7 +1686,14 @@ interface LinkedInSubscriptionInfo {
1621
1686
  isActive: boolean;
1622
1687
  }
1623
1688
  /**
1624
- * Comprehensive LinkedIn account information response
1689
+ * Full LinkedIn account information with multiple subscription support.
1690
+ *
1691
+ * A LinkedIn account can have multiple subscriptions simultaneously:
1692
+ * - Sales Navigator (for sales professionals)
1693
+ * - Recruiter (for hiring)
1694
+ * - Premium Career (personal use)
1695
+ *
1696
+ * Each subscription has its own InMail credit pool.
1625
1697
  */
1626
1698
  interface LinkedInAccountInfoResponse {
1627
1699
  connected: boolean;
@@ -1637,6 +1709,11 @@ interface LinkedInAccountInfoResponse {
1637
1709
  canSendInmail: boolean;
1638
1710
  canUseSalesNavigatorApi: boolean;
1639
1711
  canUseRecruiterApi: boolean;
1712
+ inmailSentToday?: number | null;
1713
+ directMessagesSentToday?: number | null;
1714
+ connectionRequestsSentToday?: number | null;
1715
+ gmailSentToday?: number | null;
1716
+ outlookSentToday?: number | null;
1640
1717
  unipileStatus?: string | null;
1641
1718
  }
1642
1719
  /**
@@ -2908,4 +2985,4 @@ declare class ProgressTracker {
2908
2985
  */
2909
2986
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
2910
2987
 
2911
- 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 LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, 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 };
2988
+ 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 LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, 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, RATE_LIMIT_COOLDOWNS, 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, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, 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, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * LinkedIn subscription types
3
3
  */
4
- type LinkedInLimitSubscriptionType = 'basic' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
4
+ type LinkedInLimitSubscriptionType = 'basic' | 'premium' | 'premium_career' | 'premium_business' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate';
5
5
  /**
6
6
  * LinkedIn limits by subscription type
7
7
  */
@@ -9,6 +9,7 @@ interface LinkedInLimits {
9
9
  connectionRequests: {
10
10
  weeklyMax: number;
11
11
  dailySafe: number;
12
+ personalizedMonthly: number | null;
12
13
  };
13
14
  messages: {
14
15
  weeklyMax: number;
@@ -23,11 +24,58 @@ interface LinkedInLimits {
23
24
  dailyMax: number;
24
25
  dailySafe: number;
25
26
  };
27
+ openProfileMessagesMonthly: number | null;
26
28
  }
27
29
  /**
28
30
  * LinkedIn rate limits by subscription type
29
31
  */
30
32
  declare const LINKEDIN_LIMITS: Record<LinkedInLimitSubscriptionType, LinkedInLimits>;
33
+ /**
34
+ * Safe limits when using automation (more conservative than LinkedIn's limits)
35
+ * These are Unipile-recommended limits for automation
36
+ */
37
+ declare const UNIPILE_SAFE_LIMITS: {
38
+ readonly connectionRequestsDaily: {
39
+ readonly basic: 15;
40
+ readonly premium: 20;
41
+ readonly premium_career: 20;
42
+ readonly premium_business: 20;
43
+ readonly sales_navigator: 25;
44
+ readonly recruiter_lite: 25;
45
+ readonly recruiter_corporate: 30;
46
+ };
47
+ readonly messagesDaily: {
48
+ readonly basic: 15;
49
+ readonly premium: 20;
50
+ readonly premium_career: 20;
51
+ readonly premium_business: 20;
52
+ readonly sales_navigator: 20;
53
+ readonly recruiter_lite: 25;
54
+ readonly recruiter_corporate: 30;
55
+ };
56
+ readonly profileViewsDaily: {
57
+ readonly basic: 250;
58
+ readonly premium: 300;
59
+ readonly premium_career: 300;
60
+ readonly premium_business: 300;
61
+ readonly sales_navigator: 500;
62
+ readonly recruiter_lite: 500;
63
+ readonly recruiter_corporate: 500;
64
+ };
65
+ };
66
+ /**
67
+ * Cooldown periods (in seconds) after hitting limits
68
+ */
69
+ declare const RATE_LIMIT_COOLDOWNS: {
70
+ readonly connectionRequestRejected: 3600;
71
+ readonly messageRateLimited: 1800;
72
+ readonly dailyLimitReached: 86400;
73
+ readonly weeklyLimitReached: 604800;
74
+ };
75
+ /**
76
+ * HTTP error codes from Unipile indicating rate limits
77
+ */
78
+ declare const UNIPILE_RATE_LIMIT_ERRORS: Record<number, string>;
31
79
  /**
32
80
  * Action delays for human-like behavior (in seconds)
33
81
  */
@@ -61,8 +109,16 @@ declare function getInmailAllowance(subscriptionType: LinkedInLimitSubscriptionT
61
109
  * Check if subscription can send InMail
62
110
  */
63
111
  declare function canSendInmail(subscriptionType: LinkedInLimitSubscriptionType | string | null | undefined): boolean;
112
+ /**
113
+ * Check if subscription has Open Profile messaging (Recruiter only)
114
+ */
115
+ declare function hasOpenProfileMessages(subscriptionType: LinkedInLimitSubscriptionType | string | null | undefined): boolean;
64
116
  /**
65
117
  * Get best subscription for a specific action when user has multiple subscriptions
118
+ *
119
+ * Priority order matches backend:
120
+ * - InMail: recruiter_corporate > sales_navigator > recruiter_lite > premium_business > premium_career
121
+ * - Other actions: recruiter_corporate > sales_navigator > recruiter_lite > premium_business > premium_career > basic
66
122
  */
67
123
  declare function getBestSubscriptionForAction(subscriptionTypes: (LinkedInLimitSubscriptionType | string)[], action: 'inmail' | 'connection_requests' | 'messages'): LinkedInLimitSubscriptionType | string | null;
68
124
 
@@ -1390,10 +1446,14 @@ interface ProspectSyncIdentifier {
1390
1446
  providerId?: string | null;
1391
1447
  }
1392
1448
  /**
1393
- * Request to sync conversations (prospects REQUIRED)
1449
+ * Request to sync conversations for specific prospects.
1450
+ *
1451
+ * Prospects list is required - syncs only conversations for the specified prospects.
1452
+ * This ensures efficient, targeted syncing without pulling unrelated inbox data.
1394
1453
  */
1395
1454
  interface SyncRequest {
1396
1455
  channels?: string[] | null;
1456
+ /** List of prospects to sync (required). Must include at least one prospect with an identifier. */
1397
1457
  prospects: ProspectSyncIdentifier[];
1398
1458
  }
1399
1459
  /**
@@ -1504,7 +1564,8 @@ interface ProspectInfo {
1504
1564
  interface BatchDraftRequest {
1505
1565
  prospects: ProspectInfo[];
1506
1566
  projectId: string;
1507
- channel?: string;
1567
+ /** Default channel if not specified per prospect */
1568
+ channel: string;
1508
1569
  subjectTemplate?: string | null;
1509
1570
  contentTemplate?: string | null;
1510
1571
  useAiGeneration?: boolean;
@@ -1604,15 +1665,19 @@ interface LinkedInCreditsResponse {
1604
1665
  subscriptionType?: string | null;
1605
1666
  creditsRemaining?: number | null;
1606
1667
  creditsUpdatedAt?: string | null;
1607
- isRealTime?: boolean;
1668
+ isRealTime: boolean;
1608
1669
  canSendInmail: boolean;
1609
1670
  }
1610
1671
  /**
1611
1672
  * Individual LinkedIn subscription with its own InMail credit pool.
1612
- * A LinkedIn account can have multiple subscriptions simultaneously.
1673
+ *
1674
+ * A LinkedIn account can have multiple subscriptions (e.g., Sales Navigator + Recruiter).
1675
+ * Each subscription has its own InMail credits.
1613
1676
  */
1614
1677
  interface LinkedInSubscriptionInfo {
1678
+ /** Subscription type: 'basic' | 'premium' | 'sales_navigator' | 'recruiter_lite' | 'recruiter_corporate' */
1615
1679
  type: string;
1680
+ /** Raw Unipile feature: 'classic' | 'sales_navigator' | 'recruiter' */
1616
1681
  feature: string;
1617
1682
  inmailCreditsRemaining?: number | null;
1618
1683
  inmailCreditsUpdatedAt?: string | null;
@@ -1621,7 +1686,14 @@ interface LinkedInSubscriptionInfo {
1621
1686
  isActive: boolean;
1622
1687
  }
1623
1688
  /**
1624
- * Comprehensive LinkedIn account information response
1689
+ * Full LinkedIn account information with multiple subscription support.
1690
+ *
1691
+ * A LinkedIn account can have multiple subscriptions simultaneously:
1692
+ * - Sales Navigator (for sales professionals)
1693
+ * - Recruiter (for hiring)
1694
+ * - Premium Career (personal use)
1695
+ *
1696
+ * Each subscription has its own InMail credit pool.
1625
1697
  */
1626
1698
  interface LinkedInAccountInfoResponse {
1627
1699
  connected: boolean;
@@ -1637,6 +1709,11 @@ interface LinkedInAccountInfoResponse {
1637
1709
  canSendInmail: boolean;
1638
1710
  canUseSalesNavigatorApi: boolean;
1639
1711
  canUseRecruiterApi: boolean;
1712
+ inmailSentToday?: number | null;
1713
+ directMessagesSentToday?: number | null;
1714
+ connectionRequestsSentToday?: number | null;
1715
+ gmailSentToday?: number | null;
1716
+ outlookSentToday?: number | null;
1640
1717
  unipileStatus?: string | null;
1641
1718
  }
1642
1719
  /**
@@ -2908,4 +2985,4 @@ declare class ProgressTracker {
2908
2985
  */
2909
2986
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
2910
2987
 
2911
- 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 LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, 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 };
2988
+ 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 LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, 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, RATE_LIMIT_COOLDOWNS, 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, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, 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, hasOpenProfileMessages, verifyWebhookSignature };
package/dist/index.mjs CHANGED
@@ -5,7 +5,9 @@ const LINKEDIN_LIMITS = {
5
5
  basic: {
6
6
  connectionRequests: {
7
7
  weeklyMax: 100,
8
- dailySafe: 15
8
+ dailySafe: 15,
9
+ personalizedMonthly: 10
10
+ // Very limited personalized requests
9
11
  },
10
12
  messages: {
11
13
  weeklyMax: 100,
@@ -19,13 +21,41 @@ const LINKEDIN_LIMITS = {
19
21
  profileViews: {
20
22
  dailyMax: 500,
21
23
  dailySafe: 250
22
- }
24
+ },
25
+ openProfileMessagesMonthly: null
23
26
  },
24
- premium_career: {
27
+ premium: {
25
28
  connectionRequests: {
29
+ weeklyMax: 150,
30
+ // Same as basic, SSI-dependent
31
+ dailySafe: 20,
32
+ personalizedMonthly: null
33
+ // Unlimited
34
+ },
35
+ messages: {
26
36
  weeklyMax: 150,
27
37
  dailySafe: 20
28
38
  },
39
+ inmail: {
40
+ monthlyCredits: 5,
41
+ maxAccumulation: 15,
42
+ rollover: true
43
+ },
44
+ profileViews: {
45
+ dailyMax: 1e3,
46
+ // Premium (non-SN): 150-1000/day
47
+ dailySafe: 500
48
+ },
49
+ openProfileMessagesMonthly: null
50
+ },
51
+ premium_career: {
52
+ connectionRequests: {
53
+ weeklyMax: 150,
54
+ // Same as basic, SSI-dependent
55
+ dailySafe: 20,
56
+ personalizedMonthly: null
57
+ // Unlimited
58
+ },
29
59
  messages: {
30
60
  weeklyMax: 150,
31
61
  dailySafe: 20
@@ -38,14 +68,16 @@ const LINKEDIN_LIMITS = {
38
68
  profileViews: {
39
69
  dailyMax: 1e3,
40
70
  // Premium (non-SN): 150-1000/day
41
- dailySafe: 300
42
- }
71
+ dailySafe: 500
72
+ },
73
+ openProfileMessagesMonthly: null
43
74
  },
44
75
  premium_business: {
45
76
  connectionRequests: {
46
77
  weeklyMax: 150,
47
78
  // Same as Premium Career, SSI-dependent
48
- dailySafe: 20
79
+ dailySafe: 20,
80
+ personalizedMonthly: null
49
81
  },
50
82
  messages: {
51
83
  weeklyMax: 150,
@@ -59,13 +91,15 @@ const LINKEDIN_LIMITS = {
59
91
  profileViews: {
60
92
  dailyMax: 1e3,
61
93
  // Premium (non-SN): 150-1000/day
62
- dailySafe: 300
63
- }
94
+ dailySafe: 500
95
+ },
96
+ openProfileMessagesMonthly: null
64
97
  },
65
98
  sales_navigator: {
66
99
  connectionRequests: {
67
100
  weeklyMax: 200,
68
- dailySafe: 25
101
+ dailySafe: 25,
102
+ personalizedMonthly: null
69
103
  },
70
104
  messages: {
71
105
  weeklyMax: 150,
@@ -78,13 +112,15 @@ const LINKEDIN_LIMITS = {
78
112
  },
79
113
  profileViews: {
80
114
  dailyMax: 2e3,
81
- dailySafe: 500
82
- }
115
+ dailySafe: 1e3
116
+ },
117
+ openProfileMessagesMonthly: null
83
118
  },
84
119
  recruiter_lite: {
85
120
  connectionRequests: {
86
121
  weeklyMax: 200,
87
- dailySafe: 25
122
+ dailySafe: 25,
123
+ personalizedMonthly: null
88
124
  },
89
125
  messages: {
90
126
  weeklyMax: 200,
@@ -98,13 +134,15 @@ const LINKEDIN_LIMITS = {
98
134
  },
99
135
  profileViews: {
100
136
  dailyMax: 2e3,
101
- dailySafe: 500
102
- }
137
+ dailySafe: 1e3
138
+ },
139
+ openProfileMessagesMonthly: 1e3
103
140
  },
104
141
  recruiter_corporate: {
105
142
  connectionRequests: {
106
143
  weeklyMax: 250,
107
- dailySafe: 30
144
+ dailySafe: 30,
145
+ personalizedMonthly: null
108
146
  },
109
147
  messages: {
110
148
  weeklyMax: 200,
@@ -117,10 +155,63 @@ const LINKEDIN_LIMITS = {
117
155
  },
118
156
  profileViews: {
119
157
  dailyMax: 2e3,
120
- dailySafe: 500
121
- }
158
+ dailySafe: 1e3
159
+ },
160
+ openProfileMessagesMonthly: 1e3
161
+ }
162
+ };
163
+ const UNIPILE_SAFE_LIMITS = {
164
+ // Connection requests per day (Unipile recommends 80-100 for paid)
165
+ connectionRequestsDaily: {
166
+ basic: 15,
167
+ premium: 20,
168
+ premium_career: 20,
169
+ premium_business: 20,
170
+ sales_navigator: 25,
171
+ recruiter_lite: 25,
172
+ recruiter_corporate: 30
173
+ },
174
+ // Messages per day (steady pace recommended)
175
+ messagesDaily: {
176
+ basic: 15,
177
+ premium: 20,
178
+ premium_career: 20,
179
+ premium_business: 20,
180
+ sales_navigator: 20,
181
+ recruiter_lite: 25,
182
+ recruiter_corporate: 30
183
+ },
184
+ // Profile views per day (stay under 50% of max)
185
+ profileViewsDaily: {
186
+ basic: 250,
187
+ premium: 300,
188
+ // 50% of 1000 max, conservative
189
+ premium_career: 300,
190
+ premium_business: 300,
191
+ sales_navigator: 500,
192
+ // 50% of 2000 max
193
+ recruiter_lite: 500,
194
+ recruiter_corporate: 500
122
195
  }
123
196
  };
197
+ const RATE_LIMIT_COOLDOWNS = {
198
+ connectionRequestRejected: 3600,
199
+ // 1 hour after rejection
200
+ messageRateLimited: 1800,
201
+ // 30 min after rate limit
202
+ dailyLimitReached: 86400,
203
+ // 24 hours
204
+ weeklyLimitReached: 604800
205
+ // 7 days
206
+ };
207
+ const UNIPILE_RATE_LIMIT_ERRORS = {
208
+ 422: "cannot_resend_yet",
209
+ // Connection request limit
210
+ 429: "rate_limited",
211
+ // Too many requests
212
+ 500: "server_error_possibly_rate_limited"
213
+ // Sometimes indicates limits
214
+ };
124
215
  const ACTION_DELAYS = {
125
216
  betweenConnectionRequests: 30,
126
217
  betweenMessages: 15,
@@ -147,27 +238,23 @@ function canSendInmail(subscriptionType) {
147
238
  const limits = getLimits(subscriptionType);
148
239
  return limits.inmail.monthlyCredits > 0;
149
240
  }
241
+ function hasOpenProfileMessages(subscriptionType) {
242
+ const limits = getLimits(subscriptionType);
243
+ return limits.openProfileMessagesMonthly !== null;
244
+ }
150
245
  function getBestSubscriptionForAction(subscriptionTypes, action) {
151
246
  if (subscriptionTypes.length === 0)
152
247
  return null;
153
248
  if (subscriptionTypes.length === 1)
154
249
  return subscriptionTypes[0];
155
250
  if (action === "inmail") {
156
- const priority = ["recruiter_corporate", "recruiter_lite", "sales_navigator", "premium_business", "premium_career", "basic"];
251
+ const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium", "premium_career"];
157
252
  for (const priorityType of priority) {
158
253
  if (subscriptionTypes.includes(priorityType))
159
254
  return priorityType;
160
255
  }
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"];
256
+ } else {
257
+ const priority = ["recruiter_corporate", "sales_navigator", "recruiter_lite", "premium_business", "premium", "premium_career", "basic"];
171
258
  for (const priorityType of priority) {
172
259
  if (subscriptionTypes.includes(priorityType))
173
260
  return priorityType;
@@ -2720,4 +2807,4 @@ function verifyWebhookSignature(payload, signature, secret) {
2720
2807
  );
2721
2808
  }
2722
2809
 
2723
- 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, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, verifyWebhookSignature };
2810
+ 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, RATE_LIMIT_COOLDOWNS, RateLimitError, SourcesNotAvailableError, SyncJobStatus, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, ValidationError, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lumnisai",
3
3
  "type": "module",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "description": "Official Node.js SDK for the Lumnis AI API",
6
6
  "author": "Lumnis AI",
7
7
  "license": "MIT",