lumnisai 0.3.4 → 0.3.6

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
@@ -200,6 +200,159 @@ const UNIPILE_SAFE_LIMITS = {
200
200
  recruiter_corporate: 500
201
201
  }
202
202
  };
203
+ const DEFAULT_SUBSCRIPTION_TYPE = "basic";
204
+ const EMAIL_RATE_LIMITS = {
205
+ email: {
206
+ perDay: 150,
207
+ per5Min: 20,
208
+ delaySeconds: [30, 60]
209
+ }
210
+ };
211
+ const SEQUENCE_RATE_LIMITS = {
212
+ linkedin: {
213
+ connection_request: {
214
+ perDay: {
215
+ basic: 25,
216
+ premium: 40,
217
+ premium_career: 40,
218
+ premium_business: 40,
219
+ sales_navigator: 50,
220
+ recruiter_lite: 100,
221
+ recruiter_corporate: 150
222
+ },
223
+ per5Min: 8,
224
+ delaySeconds: [60, 120]
225
+ },
226
+ message: {
227
+ perDay: {
228
+ // NOTE: basic=40 aligns with DB default from migration 0028
229
+ // Higher-tier accounts can be customized via linkedin_accounts.daily_limits
230
+ basic: 40,
231
+ premium: 40,
232
+ premium_career: 40,
233
+ premium_business: 40,
234
+ sales_navigator: 50,
235
+ recruiter_lite: 60,
236
+ recruiter_corporate: 80
237
+ },
238
+ per5Min: 10,
239
+ delaySeconds: [60, 120]
240
+ },
241
+ inmail: {
242
+ perDay: {
243
+ // NOTE: basic=40 aligns with DB default from migration 0028
244
+ // In practice, basic accounts don't have InMail, but DB allows
245
+ // configuration for accounts that upgrade or have special access
246
+ basic: 40,
247
+ premium: 40,
248
+ premium_career: 40,
249
+ premium_business: 40,
250
+ sales_navigator: 50,
251
+ recruiter_lite: 130,
252
+ recruiter_corporate: 1e3
253
+ },
254
+ per5Min: 10,
255
+ delaySeconds: [60, 120]
256
+ },
257
+ view_profile: {
258
+ perDay: {
259
+ basic: 80,
260
+ premium: 100,
261
+ premium_career: 100,
262
+ premium_business: 100,
263
+ sales_navigator: 150,
264
+ recruiter_lite: 200,
265
+ recruiter_corporate: 200
266
+ },
267
+ per5Min: 15,
268
+ delaySeconds: [30, 60]
269
+ },
270
+ like_post: {
271
+ perDay: {
272
+ basic: 50,
273
+ premium: 50,
274
+ premium_career: 50,
275
+ premium_business: 50,
276
+ sales_navigator: 50,
277
+ recruiter_lite: 50,
278
+ recruiter_corporate: 50
279
+ },
280
+ per5Min: 12,
281
+ delaySeconds: [30, 60]
282
+ },
283
+ comment_post: {
284
+ perDay: {
285
+ basic: 25,
286
+ premium: 25,
287
+ premium_career: 25,
288
+ premium_business: 25,
289
+ sales_navigator: 25,
290
+ recruiter_lite: 25,
291
+ recruiter_corporate: 25
292
+ },
293
+ per5Min: 6,
294
+ delaySeconds: [90, 180]
295
+ }
296
+ },
297
+ email: EMAIL_RATE_LIMITS,
298
+ gmail: EMAIL_RATE_LIMITS,
299
+ outlook: EMAIL_RATE_LIMITS
300
+ };
301
+ const ACTION_ALIASES = {
302
+ // Message variants
303
+ direct_message: "message",
304
+ dm: "message",
305
+ // Connection request variants
306
+ connection_request_with_note: "connection_request",
307
+ connection_request_no_note: "connection_request",
308
+ connect: "connection_request",
309
+ // InMail variants
310
+ in_mail: "inmail",
311
+ // Profile view variants
312
+ profile_view: "view_profile",
313
+ // Post engagement variants
314
+ like: "like_post",
315
+ comment: "comment_post"
316
+ };
317
+ function normalizeAction(action) {
318
+ if (!action)
319
+ return action ?? "";
320
+ const actionLower = action.toLowerCase();
321
+ return ACTION_ALIASES[actionLower] ?? actionLower;
322
+ }
323
+ function getRateLimit(channel, action, subscriptionType = DEFAULT_SUBSCRIPTION_TYPE) {
324
+ const normalizedAction = normalizeAction(action);
325
+ const channelLimits = SEQUENCE_RATE_LIMITS[channel] ?? {};
326
+ const actionLimits = channelLimits[normalizedAction];
327
+ if (!actionLimits) {
328
+ return { perDay: 50, per5Min: 10, delaySeconds: [60, 120] };
329
+ }
330
+ const perDayLimits = actionLimits.perDay;
331
+ let perDay;
332
+ if (typeof perDayLimits === "object") {
333
+ perDay = perDayLimits[subscriptionType] ?? perDayLimits.basic ?? 40;
334
+ } else {
335
+ perDay = perDayLimits;
336
+ }
337
+ return {
338
+ perDay,
339
+ per5Min: actionLimits.per5Min ?? 10,
340
+ delaySeconds: actionLimits.delaySeconds ?? [60, 120]
341
+ };
342
+ }
343
+ function getDefaultDailyLimits(subscriptionType = DEFAULT_SUBSCRIPTION_TYPE) {
344
+ const linkedinLimits = SEQUENCE_RATE_LIMITS.linkedin ?? {};
345
+ const result = {};
346
+ for (const [action, limits] of Object.entries(linkedinLimits)) {
347
+ const perDayLimits = limits.perDay;
348
+ if (typeof perDayLimits === "object") {
349
+ result[action] = perDayLimits[subscriptionType] ?? perDayLimits.basic ?? 25;
350
+ } else {
351
+ result[action] = perDayLimits;
352
+ }
353
+ }
354
+ return result;
355
+ }
203
356
  const RATE_LIMIT_COOLDOWNS = {
204
357
  connectionRequestRejected: 3600,
205
358
  // 1 hour after rejection
@@ -2936,6 +3089,32 @@ class SequencesResource {
2936
3089
  { params: { user_id: userId } }
2937
3090
  );
2938
3091
  }
3092
+ // ==================== LinkedIn Account Rate Limits ====================
3093
+ /**
3094
+ * Get rate limits configuration for a specific LinkedIn account.
3095
+ * @param accountId - The LinkedIn account ID (UUID)
3096
+ * @param userId - User ID or email that owns the account
3097
+ */
3098
+ async getLinkedInAccountRateLimits(accountId, userId) {
3099
+ return this.http.get(
3100
+ `/sequences/linkedin-accounts/${encodeURIComponent(accountId)}/rate-limits`,
3101
+ { params: { user_id: userId } }
3102
+ );
3103
+ }
3104
+ /**
3105
+ * Update rate limits configuration for a specific LinkedIn account.
3106
+ * Only provided fields will be updated. Omit fields to keep current values.
3107
+ * @param accountId - The LinkedIn account ID (UUID)
3108
+ * @param request - The rate limits to update
3109
+ * @param userId - User ID or email that owns the account
3110
+ */
3111
+ async updateLinkedInAccountRateLimits(accountId, request, userId) {
3112
+ return this.http.patch(
3113
+ `/sequences/linkedin-accounts/${encodeURIComponent(accountId)}/rate-limits`,
3114
+ request,
3115
+ { params: { user_id: userId } }
3116
+ );
3117
+ }
2939
3118
  // ==================== Approvals ====================
2940
3119
  /**
2941
3120
  * List steps waiting for approval.
@@ -4045,6 +4224,7 @@ exports.CONTENT_LIMITS_MAP = CONTENT_LIMITS_MAP;
4045
4224
  exports.ChannelType = ChannelType;
4046
4225
  exports.ConversationStatus = ConversationStatus;
4047
4226
  exports.DAILY_INMAIL_LIMITS = DAILY_INMAIL_LIMITS;
4227
+ exports.DEFAULT_SUBSCRIPTION_TYPE = DEFAULT_SUBSCRIPTION_TYPE;
4048
4228
  exports.DraftStatus = DraftStatus;
4049
4229
  exports.InternalServerError = InternalServerError;
4050
4230
  exports.LINKEDIN_LIMITS = LINKEDIN_LIMITS;
@@ -4068,6 +4248,7 @@ exports.ProviderType = ProviderType;
4068
4248
  exports.QueueItemStatus = QueueItemStatus;
4069
4249
  exports.RATE_LIMIT_COOLDOWNS = RATE_LIMIT_COOLDOWNS;
4070
4250
  exports.RateLimitError = RateLimitError;
4251
+ exports.SEQUENCE_RATE_LIMITS = SEQUENCE_RATE_LIMITS;
4071
4252
  exports.SharePermission = SharePermission;
4072
4253
  exports.SourcesNotAvailableError = SourcesNotAvailableError;
4073
4254
  exports.SyncJobStatus = SyncJobStatus;
@@ -4083,9 +4264,12 @@ exports.getBestSubscriptionForAction = getBestSubscriptionForAction;
4083
4264
  exports.getConnectionRequestLimit = getConnectionRequestLimit;
4084
4265
  exports.getContentLimit = getContentLimit;
4085
4266
  exports.getDailyInmailLimit = getDailyInmailLimit;
4267
+ exports.getDefaultDailyLimits = getDefaultDailyLimits;
4086
4268
  exports.getInmailAllowance = getInmailAllowance;
4087
4269
  exports.getLimits = getLimits;
4088
4270
  exports.getMessageLimit = getMessageLimit;
4271
+ exports.getRateLimit = getRateLimit;
4089
4272
  exports.hasOpenProfileMessages = hasOpenProfileMessages;
4090
4273
  exports.isRecruiterSubscription = isRecruiterSubscription;
4274
+ exports.normalizeAction = normalizeAction;
4091
4275
  exports.verifyWebhookSignature = verifyWebhookSignature;
package/dist/index.d.cts CHANGED
@@ -33,6 +33,7 @@ declare const LINKEDIN_LIMITS: Record<LinkedInLimitSubscriptionType, LinkedInLim
33
33
  /**
34
34
  * Safe limits when using automation (more conservative than LinkedIn's limits)
35
35
  * These are Unipile-recommended limits for automation
36
+ * @deprecated Use SEQUENCE_RATE_LIMITS instead for the single source of truth
36
37
  */
37
38
  declare const UNIPILE_SAFE_LIMITS: {
38
39
  readonly connectionRequestsDaily: {
@@ -63,6 +64,53 @@ declare const UNIPILE_SAFE_LIMITS: {
63
64
  readonly recruiter_corporate: 500;
64
65
  };
65
66
  };
67
+ /** Default subscription type when account type is unknown */
68
+ declare const DEFAULT_SUBSCRIPTION_TYPE: LinkedInLimitSubscriptionType;
69
+ /** Rate limit configuration for a single action */
70
+ interface SequenceRateLimitAction {
71
+ perDay: Record<LinkedInLimitSubscriptionType, number> | number;
72
+ per5Min: number;
73
+ delaySeconds: [number, number];
74
+ }
75
+ /**
76
+ * Sequence rate limits - SINGLE SOURCE OF TRUTH
77
+ * Used by the sequence processor, rate limiter, messaging service, and queue processor.
78
+ */
79
+ declare const SEQUENCE_RATE_LIMITS: Record<string, Record<string, SequenceRateLimitAction>>;
80
+ /**
81
+ * Normalize outreach_method/action to base action name used in SEQUENCE_RATE_LIMITS.
82
+ *
83
+ * This handles aliases like:
84
+ * - direct_message -> message
85
+ * - connection_request_with_note -> connection_request
86
+ * - connection_request_no_note -> connection_request
87
+ *
88
+ * @param action - The action or outreach_method string
89
+ * @returns Normalized base action name
90
+ */
91
+ declare function normalizeAction(action: string | null | undefined): string;
92
+ /** Result from getRateLimit */
93
+ interface RateLimitInfo$1 {
94
+ perDay: number;
95
+ per5Min: number;
96
+ delaySeconds: [number, number];
97
+ }
98
+ /**
99
+ * Get rate limits for a specific channel/action/subscription combination.
100
+ *
101
+ * @param channel - Channel (linkedin, email, gmail, outlook)
102
+ * @param action - Action (connection_request, message, inmail, etc.) - aliases are normalized
103
+ * @param subscriptionType - LinkedIn subscription type (basic, premium, sales_navigator, etc.)
104
+ * @returns Rate limit configuration
105
+ */
106
+ declare function getRateLimit(channel: string, action: string, subscriptionType?: LinkedInLimitSubscriptionType | string): RateLimitInfo$1;
107
+ /**
108
+ * Get default daily limits for initializing a new LinkedIn account.
109
+ *
110
+ * @param subscriptionType - LinkedIn subscription type
111
+ * @returns Dict mapping action to daily limit
112
+ */
113
+ declare function getDefaultDailyLimits(subscriptionType?: LinkedInLimitSubscriptionType | string): Record<string, number>;
66
114
  /**
67
115
  * Cooldown periods (in seconds) after hitting limits
68
116
  */
@@ -3869,6 +3917,10 @@ interface ApprovalItem {
3869
3917
  content?: string;
3870
3918
  aiPrecheckResult?: string;
3871
3919
  aiPrecheckReason?: string;
3920
+ /** Notes explaining why this approval was created (e.g., auto-CR after InMail) */
3921
+ approvalNotes?: string;
3922
+ /** Additional metadata (e.g., system_generated flag, triggered_by context) */
3923
+ metadata?: Record<string, unknown>;
3872
3924
  createdAt: string;
3873
3925
  }
3874
3926
  interface ApprovalListResponse {
@@ -4168,6 +4220,10 @@ interface PendingApprovalExtended {
4168
4220
  content?: string;
4169
4221
  aiPrecheckResult?: string;
4170
4222
  aiPrecheckReason?: string;
4223
+ /** Notes explaining why this approval was created (e.g., auto-CR after InMail) */
4224
+ approvalNotes?: string;
4225
+ /** Additional metadata (e.g., system_generated flag, triggered_by context) */
4226
+ metadata?: Record<string, unknown>;
4171
4227
  createdAt: string;
4172
4228
  }
4173
4229
  interface ProjectApprovalsData {
@@ -4248,6 +4304,42 @@ interface EngagementStatusResponse {
4248
4304
  errors: Record<string, string>;
4249
4305
  computedAt: string;
4250
4306
  }
4307
+ /**
4308
+ * Rate limits for a LinkedIn account.
4309
+ * All fields are optional - only provide values you want to set.
4310
+ * Values of 0 disable the action (e.g., inmail=0 for basic accounts).
4311
+ */
4312
+ interface LinkedInAccountRateLimits {
4313
+ /** Daily connection request limit (0 to disable, max 500) */
4314
+ connectionRequest?: number;
4315
+ /** Daily direct message limit (0 to disable, max 150) */
4316
+ message?: number;
4317
+ /** Daily InMail limit (0 to disable, max 1000) */
4318
+ inmail?: number;
4319
+ /** Daily profile view limit (0 to disable, max 200) */
4320
+ viewProfile?: number;
4321
+ /** Daily post like limit (0 to disable, max 100) */
4322
+ likePost?: number;
4323
+ /** Daily post comment limit (0 to disable, max 50) */
4324
+ commentPost?: number;
4325
+ }
4326
+ /**
4327
+ * Request to update rate limits for a LinkedIn account.
4328
+ */
4329
+ interface LinkedInAccountRateLimitsUpdate {
4330
+ /** Daily limits to update. Omit fields to keep current values. */
4331
+ dailyLimits: LinkedInAccountRateLimits;
4332
+ }
4333
+ /**
4334
+ * Response containing rate limits for a LinkedIn account.
4335
+ */
4336
+ interface LinkedInAccountRateLimitsResponse {
4337
+ accountId: string;
4338
+ dailyLimits: Record<string, number>;
4339
+ dailyActionCounts: Record<string, number>;
4340
+ lastResetDate?: string | null;
4341
+ updatedAt: string;
4342
+ }
4251
4343
 
4252
4344
  /**
4253
4345
  * Resource for managing automated multi-step outreach sequences.
@@ -4420,6 +4512,20 @@ declare class SequencesResource {
4420
4512
  * @param userId - User ID or email to check rate limits for
4421
4513
  */
4422
4514
  getRateLimitStatus(userId: string): Promise<RateLimitStatusResponse>;
4515
+ /**
4516
+ * Get rate limits configuration for a specific LinkedIn account.
4517
+ * @param accountId - The LinkedIn account ID (UUID)
4518
+ * @param userId - User ID or email that owns the account
4519
+ */
4520
+ getLinkedInAccountRateLimits(accountId: string, userId: string): Promise<LinkedInAccountRateLimitsResponse>;
4521
+ /**
4522
+ * Update rate limits configuration for a specific LinkedIn account.
4523
+ * Only provided fields will be updated. Omit fields to keep current values.
4524
+ * @param accountId - The LinkedIn account ID (UUID)
4525
+ * @param request - The rate limits to update
4526
+ * @param userId - User ID or email that owns the account
4527
+ */
4528
+ updateLinkedInAccountRateLimits(accountId: string, request: LinkedInAccountRateLimitsUpdate, userId: string): Promise<LinkedInAccountRateLimitsResponse>;
4423
4529
  /**
4424
4530
  * List steps waiting for approval.
4425
4531
  */
@@ -5038,4 +5144,4 @@ declare class ProgressTracker {
5038
5144
  */
5039
5145
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
5040
5146
 
5041
- export { ACTION_DELAYS, type ActionLimit, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type ApprovalItem, type ApprovalListResponse, type ApprovalResponse, type ApprovalStatus, type ApprovalsParams, type ApprovalsRequestItem, type ApprovalsResponseItem, type ApproveStepRequest, 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 BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchExecutionInclude, type BatchExecutionRequest, type BatchExecutionResponse, BatchJobStatus, type BatchPollRequest, type BatchPollResponse, type BatchProspectIdentifier, type BatchRequestItem, type BatchRequestType, type BatchResponseItem, type BatchSendRequest, type BatchSendResponse, type BatchStepMetric, type BillingStatus, type BulkApprovalAction, type BulkApprovalFailure, type BulkApprovalRequest, type BulkApprovalResponse, type BulkCompleteFailure, type BulkCompleteRequest, type BulkCompleteResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkOperationRequest, type BulkOperationResponse, type BulkUploadResponse, CONTENT_LIMITS, CONTENT_LIMITS_MAP, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type CompleteExecutionRequest, type CompleteExecutionResponse, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ConnectionsSyncStatus, type ContactHistorySyncStatus, type ContentLimit, type ContentSource, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionResult, type CriterionType, DAILY_INMAIL_LIMITS, type DatabaseStatus, type DeepPeopleSearchOutput, type DeepSearchPreview, type DeepSearchStats, type DeleteApiKeyResponse, type DeleteConnectionsResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type DuplicateTemplateRequest, type Email, type EmailAction, type EmailThreadSummary, type EngagementStatus, type EngagementStatusData, type EngagementStatusRequest, type EngagementStatusResponse, type ErrorDetail, type ErrorResponse, type ErrorResponseItem, type EvidenceSource, type ExecutionDetailResponse, type ExecutionEvent, type ExecutionEventData, type ExecutionListResponse, type ExecutionMetricsOptions, type ExecutionMetricsResponse, type ExecutionStatus, type ExecutionSummary, type ExecutionSummaryExtended, type ExecutionsParams, type ExecutionsRequestItem, type ExecutionsResponseItem, 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, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LifecycleOperationRequest, type LifecycleOperationResponse, type LinkedInAccountInfoResponse, type LinkedInAction, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type LinkedInSyncStatusResponse, type ListApprovalsOptions, type ListExecutionsOptions, type ListProvidersResponse, type ListStepExecutionsOptions, type ListTemplatesOptions, 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 MetricsParams, type MetricsRequestItem, type MetricsResponseItem, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, type OnFailure, type OutcomeType, OutreachMethod, type PaginationInfo, type PaginationParams, type PendingApprovalExtended, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PostPreviewRequest, type PostPreviewResponse, type PostPreviewResult, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProjectApprovalsData, type ProjectExecutionsData, type ProjectMetricsData, type ProspectConnectionCheck, type ProspectInfo, type ProspectInput, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, type RateLimitData, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo, type RateLimitStatusResponse, type RateLimitsParams, type RateLimitsRequestItem, type RateLimitsResponseItem, type RejectStepRequest, type ReplySentiment, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SequenceAction, type SequenceApprovalNeededData, type SequenceChannel, type SequenceEventType, type SequenceExecutionCompletedData, type SequenceExecutionFailedData, type SequenceStepCompletedData, type SequenceTemplateCreate, type SequenceTemplateResponse, type SequenceTemplateUpdate, SequencesResource, SharePermission, 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, type SkipStepRequest, type SkipStepResponse, type SkippedProspect, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StartExecutionRequest, type StartExecutionResponse, type StepConfig, type StepExecutionItem, type StepExecutionListResponse, type StepExecutionStatus, type StepHistoryEntry, type StepMetric, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, SyncPhaseStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TemplateShareConfig, type TemplateShareInfo, type TemplateShareRequest, type TemplateSharesResponse, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type TransitionCondition, type TransitionConditionOperator, type TransitionConditionType, type TransitionConfig, type TransitionEventParams, type TriggerSyncResponse, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateStepExecutionRequest, type UpdateStepExecutionResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, VALID_EVENT_TYPES, type ValidatedCandidate, ValidationError, type ValidationIssue, type ValidationResponse, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, isRecruiterSubscription, verifyWebhookSignature };
5147
+ export { ACTION_DELAYS, type ActionLimit, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type ApprovalItem, type ApprovalListResponse, type ApprovalResponse, type ApprovalStatus, type ApprovalsParams, type ApprovalsRequestItem, type ApprovalsResponseItem, type ApproveStepRequest, 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 BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchExecutionInclude, type BatchExecutionRequest, type BatchExecutionResponse, BatchJobStatus, type BatchPollRequest, type BatchPollResponse, type BatchProspectIdentifier, type BatchRequestItem, type BatchRequestType, type BatchResponseItem, type BatchSendRequest, type BatchSendResponse, type BatchStepMetric, type BillingStatus, type BulkApprovalAction, type BulkApprovalFailure, type BulkApprovalRequest, type BulkApprovalResponse, type BulkCompleteFailure, type BulkCompleteRequest, type BulkCompleteResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkOperationRequest, type BulkOperationResponse, type BulkUploadResponse, CONTENT_LIMITS, CONTENT_LIMITS_MAP, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type CompleteExecutionRequest, type CompleteExecutionResponse, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ConnectionsSyncStatus, type ContactHistorySyncStatus, type ContentLimit, type ContentSource, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionResult, type CriterionType, DAILY_INMAIL_LIMITS, DEFAULT_SUBSCRIPTION_TYPE, type DatabaseStatus, type DeepPeopleSearchOutput, type DeepSearchPreview, type DeepSearchStats, type DeleteApiKeyResponse, type DeleteConnectionsResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type DuplicateTemplateRequest, type Email, type EmailAction, type EmailThreadSummary, type EngagementStatus, type EngagementStatusData, type EngagementStatusRequest, type EngagementStatusResponse, type ErrorDetail, type ErrorResponse, type ErrorResponseItem, type EvidenceSource, type ExecutionDetailResponse, type ExecutionEvent, type ExecutionEventData, type ExecutionListResponse, type ExecutionMetricsOptions, type ExecutionMetricsResponse, type ExecutionStatus, type ExecutionSummary, type ExecutionSummaryExtended, type ExecutionsParams, type ExecutionsRequestItem, type ExecutionsResponseItem, 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, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LifecycleOperationRequest, type LifecycleOperationResponse, type LinkedInAccountInfoResponse, type LinkedInAccountRateLimits, type LinkedInAccountRateLimitsResponse, type LinkedInAccountRateLimitsUpdate, type LinkedInAction, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type LinkedInSyncStatusResponse, type ListApprovalsOptions, type ListExecutionsOptions, type ListProvidersResponse, type ListStepExecutionsOptions, type ListTemplatesOptions, 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 MetricsParams, type MetricsRequestItem, type MetricsResponseItem, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, type OnFailure, type OutcomeType, OutreachMethod, type PaginationInfo, type PaginationParams, type PendingApprovalExtended, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PostPreviewRequest, type PostPreviewResponse, type PostPreviewResult, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProjectApprovalsData, type ProjectExecutionsData, type ProjectMetricsData, type ProspectConnectionCheck, type ProspectInfo, type ProspectInput, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, type RateLimitData, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo$1 as RateLimitInfo, type RateLimitStatusResponse, type RateLimitsParams, type RateLimitsRequestItem, type RateLimitsResponseItem, type RejectStepRequest, type ReplySentiment, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, SEQUENCE_RATE_LIMITS, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SequenceAction, type SequenceApprovalNeededData, type SequenceChannel, type SequenceEventType, type SequenceExecutionCompletedData, type SequenceExecutionFailedData, type SequenceRateLimitAction, type SequenceStepCompletedData, type SequenceTemplateCreate, type SequenceTemplateResponse, type SequenceTemplateUpdate, SequencesResource, SharePermission, 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, type SkipStepRequest, type SkipStepResponse, type SkippedProspect, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StartExecutionRequest, type StartExecutionResponse, type StepConfig, type StepExecutionItem, type StepExecutionListResponse, type StepExecutionStatus, type StepHistoryEntry, type StepMetric, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, SyncPhaseStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TemplateShareConfig, type TemplateShareInfo, type TemplateShareRequest, type TemplateSharesResponse, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type TransitionCondition, type TransitionConditionOperator, type TransitionConditionType, type TransitionConfig, type TransitionEventParams, type TriggerSyncResponse, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateStepExecutionRequest, type UpdateStepExecutionResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, VALID_EVENT_TYPES, type ValidatedCandidate, ValidationError, type ValidationIssue, type ValidationResponse, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getDefaultDailyLimits, getInmailAllowance, getLimits, getMessageLimit, getRateLimit, hasOpenProfileMessages, isRecruiterSubscription, normalizeAction, verifyWebhookSignature };
package/dist/index.d.mts CHANGED
@@ -33,6 +33,7 @@ declare const LINKEDIN_LIMITS: Record<LinkedInLimitSubscriptionType, LinkedInLim
33
33
  /**
34
34
  * Safe limits when using automation (more conservative than LinkedIn's limits)
35
35
  * These are Unipile-recommended limits for automation
36
+ * @deprecated Use SEQUENCE_RATE_LIMITS instead for the single source of truth
36
37
  */
37
38
  declare const UNIPILE_SAFE_LIMITS: {
38
39
  readonly connectionRequestsDaily: {
@@ -63,6 +64,53 @@ declare const UNIPILE_SAFE_LIMITS: {
63
64
  readonly recruiter_corporate: 500;
64
65
  };
65
66
  };
67
+ /** Default subscription type when account type is unknown */
68
+ declare const DEFAULT_SUBSCRIPTION_TYPE: LinkedInLimitSubscriptionType;
69
+ /** Rate limit configuration for a single action */
70
+ interface SequenceRateLimitAction {
71
+ perDay: Record<LinkedInLimitSubscriptionType, number> | number;
72
+ per5Min: number;
73
+ delaySeconds: [number, number];
74
+ }
75
+ /**
76
+ * Sequence rate limits - SINGLE SOURCE OF TRUTH
77
+ * Used by the sequence processor, rate limiter, messaging service, and queue processor.
78
+ */
79
+ declare const SEQUENCE_RATE_LIMITS: Record<string, Record<string, SequenceRateLimitAction>>;
80
+ /**
81
+ * Normalize outreach_method/action to base action name used in SEQUENCE_RATE_LIMITS.
82
+ *
83
+ * This handles aliases like:
84
+ * - direct_message -> message
85
+ * - connection_request_with_note -> connection_request
86
+ * - connection_request_no_note -> connection_request
87
+ *
88
+ * @param action - The action or outreach_method string
89
+ * @returns Normalized base action name
90
+ */
91
+ declare function normalizeAction(action: string | null | undefined): string;
92
+ /** Result from getRateLimit */
93
+ interface RateLimitInfo$1 {
94
+ perDay: number;
95
+ per5Min: number;
96
+ delaySeconds: [number, number];
97
+ }
98
+ /**
99
+ * Get rate limits for a specific channel/action/subscription combination.
100
+ *
101
+ * @param channel - Channel (linkedin, email, gmail, outlook)
102
+ * @param action - Action (connection_request, message, inmail, etc.) - aliases are normalized
103
+ * @param subscriptionType - LinkedIn subscription type (basic, premium, sales_navigator, etc.)
104
+ * @returns Rate limit configuration
105
+ */
106
+ declare function getRateLimit(channel: string, action: string, subscriptionType?: LinkedInLimitSubscriptionType | string): RateLimitInfo$1;
107
+ /**
108
+ * Get default daily limits for initializing a new LinkedIn account.
109
+ *
110
+ * @param subscriptionType - LinkedIn subscription type
111
+ * @returns Dict mapping action to daily limit
112
+ */
113
+ declare function getDefaultDailyLimits(subscriptionType?: LinkedInLimitSubscriptionType | string): Record<string, number>;
66
114
  /**
67
115
  * Cooldown periods (in seconds) after hitting limits
68
116
  */
@@ -3869,6 +3917,10 @@ interface ApprovalItem {
3869
3917
  content?: string;
3870
3918
  aiPrecheckResult?: string;
3871
3919
  aiPrecheckReason?: string;
3920
+ /** Notes explaining why this approval was created (e.g., auto-CR after InMail) */
3921
+ approvalNotes?: string;
3922
+ /** Additional metadata (e.g., system_generated flag, triggered_by context) */
3923
+ metadata?: Record<string, unknown>;
3872
3924
  createdAt: string;
3873
3925
  }
3874
3926
  interface ApprovalListResponse {
@@ -4168,6 +4220,10 @@ interface PendingApprovalExtended {
4168
4220
  content?: string;
4169
4221
  aiPrecheckResult?: string;
4170
4222
  aiPrecheckReason?: string;
4223
+ /** Notes explaining why this approval was created (e.g., auto-CR after InMail) */
4224
+ approvalNotes?: string;
4225
+ /** Additional metadata (e.g., system_generated flag, triggered_by context) */
4226
+ metadata?: Record<string, unknown>;
4171
4227
  createdAt: string;
4172
4228
  }
4173
4229
  interface ProjectApprovalsData {
@@ -4248,6 +4304,42 @@ interface EngagementStatusResponse {
4248
4304
  errors: Record<string, string>;
4249
4305
  computedAt: string;
4250
4306
  }
4307
+ /**
4308
+ * Rate limits for a LinkedIn account.
4309
+ * All fields are optional - only provide values you want to set.
4310
+ * Values of 0 disable the action (e.g., inmail=0 for basic accounts).
4311
+ */
4312
+ interface LinkedInAccountRateLimits {
4313
+ /** Daily connection request limit (0 to disable, max 500) */
4314
+ connectionRequest?: number;
4315
+ /** Daily direct message limit (0 to disable, max 150) */
4316
+ message?: number;
4317
+ /** Daily InMail limit (0 to disable, max 1000) */
4318
+ inmail?: number;
4319
+ /** Daily profile view limit (0 to disable, max 200) */
4320
+ viewProfile?: number;
4321
+ /** Daily post like limit (0 to disable, max 100) */
4322
+ likePost?: number;
4323
+ /** Daily post comment limit (0 to disable, max 50) */
4324
+ commentPost?: number;
4325
+ }
4326
+ /**
4327
+ * Request to update rate limits for a LinkedIn account.
4328
+ */
4329
+ interface LinkedInAccountRateLimitsUpdate {
4330
+ /** Daily limits to update. Omit fields to keep current values. */
4331
+ dailyLimits: LinkedInAccountRateLimits;
4332
+ }
4333
+ /**
4334
+ * Response containing rate limits for a LinkedIn account.
4335
+ */
4336
+ interface LinkedInAccountRateLimitsResponse {
4337
+ accountId: string;
4338
+ dailyLimits: Record<string, number>;
4339
+ dailyActionCounts: Record<string, number>;
4340
+ lastResetDate?: string | null;
4341
+ updatedAt: string;
4342
+ }
4251
4343
 
4252
4344
  /**
4253
4345
  * Resource for managing automated multi-step outreach sequences.
@@ -4420,6 +4512,20 @@ declare class SequencesResource {
4420
4512
  * @param userId - User ID or email to check rate limits for
4421
4513
  */
4422
4514
  getRateLimitStatus(userId: string): Promise<RateLimitStatusResponse>;
4515
+ /**
4516
+ * Get rate limits configuration for a specific LinkedIn account.
4517
+ * @param accountId - The LinkedIn account ID (UUID)
4518
+ * @param userId - User ID or email that owns the account
4519
+ */
4520
+ getLinkedInAccountRateLimits(accountId: string, userId: string): Promise<LinkedInAccountRateLimitsResponse>;
4521
+ /**
4522
+ * Update rate limits configuration for a specific LinkedIn account.
4523
+ * Only provided fields will be updated. Omit fields to keep current values.
4524
+ * @param accountId - The LinkedIn account ID (UUID)
4525
+ * @param request - The rate limits to update
4526
+ * @param userId - User ID or email that owns the account
4527
+ */
4528
+ updateLinkedInAccountRateLimits(accountId: string, request: LinkedInAccountRateLimitsUpdate, userId: string): Promise<LinkedInAccountRateLimitsResponse>;
4423
4529
  /**
4424
4530
  * List steps waiting for approval.
4425
4531
  */
@@ -5038,4 +5144,4 @@ declare class ProgressTracker {
5038
5144
  */
5039
5145
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
5040
5146
 
5041
- export { ACTION_DELAYS, type ActionLimit, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type ApprovalItem, type ApprovalListResponse, type ApprovalResponse, type ApprovalStatus, type ApprovalsParams, type ApprovalsRequestItem, type ApprovalsResponseItem, type ApproveStepRequest, 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 BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchExecutionInclude, type BatchExecutionRequest, type BatchExecutionResponse, BatchJobStatus, type BatchPollRequest, type BatchPollResponse, type BatchProspectIdentifier, type BatchRequestItem, type BatchRequestType, type BatchResponseItem, type BatchSendRequest, type BatchSendResponse, type BatchStepMetric, type BillingStatus, type BulkApprovalAction, type BulkApprovalFailure, type BulkApprovalRequest, type BulkApprovalResponse, type BulkCompleteFailure, type BulkCompleteRequest, type BulkCompleteResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkOperationRequest, type BulkOperationResponse, type BulkUploadResponse, CONTENT_LIMITS, CONTENT_LIMITS_MAP, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type CompleteExecutionRequest, type CompleteExecutionResponse, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ConnectionsSyncStatus, type ContactHistorySyncStatus, type ContentLimit, type ContentSource, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionResult, type CriterionType, DAILY_INMAIL_LIMITS, type DatabaseStatus, type DeepPeopleSearchOutput, type DeepSearchPreview, type DeepSearchStats, type DeleteApiKeyResponse, type DeleteConnectionsResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type DuplicateTemplateRequest, type Email, type EmailAction, type EmailThreadSummary, type EngagementStatus, type EngagementStatusData, type EngagementStatusRequest, type EngagementStatusResponse, type ErrorDetail, type ErrorResponse, type ErrorResponseItem, type EvidenceSource, type ExecutionDetailResponse, type ExecutionEvent, type ExecutionEventData, type ExecutionListResponse, type ExecutionMetricsOptions, type ExecutionMetricsResponse, type ExecutionStatus, type ExecutionSummary, type ExecutionSummaryExtended, type ExecutionsParams, type ExecutionsRequestItem, type ExecutionsResponseItem, 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, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LifecycleOperationRequest, type LifecycleOperationResponse, type LinkedInAccountInfoResponse, type LinkedInAction, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type LinkedInSyncStatusResponse, type ListApprovalsOptions, type ListExecutionsOptions, type ListProvidersResponse, type ListStepExecutionsOptions, type ListTemplatesOptions, 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 MetricsParams, type MetricsRequestItem, type MetricsResponseItem, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, type OnFailure, type OutcomeType, OutreachMethod, type PaginationInfo, type PaginationParams, type PendingApprovalExtended, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PostPreviewRequest, type PostPreviewResponse, type PostPreviewResult, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProjectApprovalsData, type ProjectExecutionsData, type ProjectMetricsData, type ProspectConnectionCheck, type ProspectInfo, type ProspectInput, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, type RateLimitData, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo, type RateLimitStatusResponse, type RateLimitsParams, type RateLimitsRequestItem, type RateLimitsResponseItem, type RejectStepRequest, type ReplySentiment, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SequenceAction, type SequenceApprovalNeededData, type SequenceChannel, type SequenceEventType, type SequenceExecutionCompletedData, type SequenceExecutionFailedData, type SequenceStepCompletedData, type SequenceTemplateCreate, type SequenceTemplateResponse, type SequenceTemplateUpdate, SequencesResource, SharePermission, 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, type SkipStepRequest, type SkipStepResponse, type SkippedProspect, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StartExecutionRequest, type StartExecutionResponse, type StepConfig, type StepExecutionItem, type StepExecutionListResponse, type StepExecutionStatus, type StepHistoryEntry, type StepMetric, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, SyncPhaseStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TemplateShareConfig, type TemplateShareInfo, type TemplateShareRequest, type TemplateSharesResponse, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type TransitionCondition, type TransitionConditionOperator, type TransitionConditionType, type TransitionConfig, type TransitionEventParams, type TriggerSyncResponse, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateStepExecutionRequest, type UpdateStepExecutionResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, VALID_EVENT_TYPES, type ValidatedCandidate, ValidationError, type ValidationIssue, type ValidationResponse, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, isRecruiterSubscription, verifyWebhookSignature };
5147
+ export { ACTION_DELAYS, type ActionLimit, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type ApprovalItem, type ApprovalListResponse, type ApprovalResponse, type ApprovalStatus, type ApprovalsParams, type ApprovalsRequestItem, type ApprovalsResponseItem, type ApproveStepRequest, 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 BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchExecutionInclude, type BatchExecutionRequest, type BatchExecutionResponse, BatchJobStatus, type BatchPollRequest, type BatchPollResponse, type BatchProspectIdentifier, type BatchRequestItem, type BatchRequestType, type BatchResponseItem, type BatchSendRequest, type BatchSendResponse, type BatchStepMetric, type BillingStatus, type BulkApprovalAction, type BulkApprovalFailure, type BulkApprovalRequest, type BulkApprovalResponse, type BulkCompleteFailure, type BulkCompleteRequest, type BulkCompleteResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkOperationRequest, type BulkOperationResponse, type BulkUploadResponse, CONTENT_LIMITS, CONTENT_LIMITS_MAP, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type CompleteExecutionRequest, type CompleteExecutionResponse, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ConnectionsSyncStatus, type ContactHistorySyncStatus, type ContentLimit, type ContentSource, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionResult, type CriterionType, DAILY_INMAIL_LIMITS, DEFAULT_SUBSCRIPTION_TYPE, type DatabaseStatus, type DeepPeopleSearchOutput, type DeepSearchPreview, type DeepSearchStats, type DeleteApiKeyResponse, type DeleteConnectionsResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type DuplicateTemplateRequest, type Email, type EmailAction, type EmailThreadSummary, type EngagementStatus, type EngagementStatusData, type EngagementStatusRequest, type EngagementStatusResponse, type ErrorDetail, type ErrorResponse, type ErrorResponseItem, type EvidenceSource, type ExecutionDetailResponse, type ExecutionEvent, type ExecutionEventData, type ExecutionListResponse, type ExecutionMetricsOptions, type ExecutionMetricsResponse, type ExecutionStatus, type ExecutionSummary, type ExecutionSummaryExtended, type ExecutionsParams, type ExecutionsRequestItem, type ExecutionsResponseItem, 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, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LifecycleOperationRequest, type LifecycleOperationResponse, type LinkedInAccountInfoResponse, type LinkedInAccountRateLimits, type LinkedInAccountRateLimitsResponse, type LinkedInAccountRateLimitsUpdate, type LinkedInAction, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type LinkedInSyncStatusResponse, type ListApprovalsOptions, type ListExecutionsOptions, type ListProvidersResponse, type ListStepExecutionsOptions, type ListTemplatesOptions, 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 MetricsParams, type MetricsRequestItem, type MetricsResponseItem, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, type OnFailure, type OutcomeType, OutreachMethod, type PaginationInfo, type PaginationParams, type PendingApprovalExtended, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PostPreviewRequest, type PostPreviewResponse, type PostPreviewResult, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProjectApprovalsData, type ProjectExecutionsData, type ProjectMetricsData, type ProspectConnectionCheck, type ProspectInfo, type ProspectInput, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, type RateLimitData, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo$1 as RateLimitInfo, type RateLimitStatusResponse, type RateLimitsParams, type RateLimitsRequestItem, type RateLimitsResponseItem, type RejectStepRequest, type ReplySentiment, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, SEQUENCE_RATE_LIMITS, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SequenceAction, type SequenceApprovalNeededData, type SequenceChannel, type SequenceEventType, type SequenceExecutionCompletedData, type SequenceExecutionFailedData, type SequenceRateLimitAction, type SequenceStepCompletedData, type SequenceTemplateCreate, type SequenceTemplateResponse, type SequenceTemplateUpdate, SequencesResource, SharePermission, 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, type SkipStepRequest, type SkipStepResponse, type SkippedProspect, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StartExecutionRequest, type StartExecutionResponse, type StepConfig, type StepExecutionItem, type StepExecutionListResponse, type StepExecutionStatus, type StepHistoryEntry, type StepMetric, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, SyncPhaseStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TemplateShareConfig, type TemplateShareInfo, type TemplateShareRequest, type TemplateSharesResponse, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type TransitionCondition, type TransitionConditionOperator, type TransitionConditionType, type TransitionConfig, type TransitionEventParams, type TriggerSyncResponse, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateStepExecutionRequest, type UpdateStepExecutionResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, VALID_EVENT_TYPES, type ValidatedCandidate, ValidationError, type ValidationIssue, type ValidationResponse, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getDefaultDailyLimits, getInmailAllowance, getLimits, getMessageLimit, getRateLimit, hasOpenProfileMessages, isRecruiterSubscription, normalizeAction, verifyWebhookSignature };
package/dist/index.d.ts CHANGED
@@ -33,6 +33,7 @@ declare const LINKEDIN_LIMITS: Record<LinkedInLimitSubscriptionType, LinkedInLim
33
33
  /**
34
34
  * Safe limits when using automation (more conservative than LinkedIn's limits)
35
35
  * These are Unipile-recommended limits for automation
36
+ * @deprecated Use SEQUENCE_RATE_LIMITS instead for the single source of truth
36
37
  */
37
38
  declare const UNIPILE_SAFE_LIMITS: {
38
39
  readonly connectionRequestsDaily: {
@@ -63,6 +64,53 @@ declare const UNIPILE_SAFE_LIMITS: {
63
64
  readonly recruiter_corporate: 500;
64
65
  };
65
66
  };
67
+ /** Default subscription type when account type is unknown */
68
+ declare const DEFAULT_SUBSCRIPTION_TYPE: LinkedInLimitSubscriptionType;
69
+ /** Rate limit configuration for a single action */
70
+ interface SequenceRateLimitAction {
71
+ perDay: Record<LinkedInLimitSubscriptionType, number> | number;
72
+ per5Min: number;
73
+ delaySeconds: [number, number];
74
+ }
75
+ /**
76
+ * Sequence rate limits - SINGLE SOURCE OF TRUTH
77
+ * Used by the sequence processor, rate limiter, messaging service, and queue processor.
78
+ */
79
+ declare const SEQUENCE_RATE_LIMITS: Record<string, Record<string, SequenceRateLimitAction>>;
80
+ /**
81
+ * Normalize outreach_method/action to base action name used in SEQUENCE_RATE_LIMITS.
82
+ *
83
+ * This handles aliases like:
84
+ * - direct_message -> message
85
+ * - connection_request_with_note -> connection_request
86
+ * - connection_request_no_note -> connection_request
87
+ *
88
+ * @param action - The action or outreach_method string
89
+ * @returns Normalized base action name
90
+ */
91
+ declare function normalizeAction(action: string | null | undefined): string;
92
+ /** Result from getRateLimit */
93
+ interface RateLimitInfo$1 {
94
+ perDay: number;
95
+ per5Min: number;
96
+ delaySeconds: [number, number];
97
+ }
98
+ /**
99
+ * Get rate limits for a specific channel/action/subscription combination.
100
+ *
101
+ * @param channel - Channel (linkedin, email, gmail, outlook)
102
+ * @param action - Action (connection_request, message, inmail, etc.) - aliases are normalized
103
+ * @param subscriptionType - LinkedIn subscription type (basic, premium, sales_navigator, etc.)
104
+ * @returns Rate limit configuration
105
+ */
106
+ declare function getRateLimit(channel: string, action: string, subscriptionType?: LinkedInLimitSubscriptionType | string): RateLimitInfo$1;
107
+ /**
108
+ * Get default daily limits for initializing a new LinkedIn account.
109
+ *
110
+ * @param subscriptionType - LinkedIn subscription type
111
+ * @returns Dict mapping action to daily limit
112
+ */
113
+ declare function getDefaultDailyLimits(subscriptionType?: LinkedInLimitSubscriptionType | string): Record<string, number>;
66
114
  /**
67
115
  * Cooldown periods (in seconds) after hitting limits
68
116
  */
@@ -3869,6 +3917,10 @@ interface ApprovalItem {
3869
3917
  content?: string;
3870
3918
  aiPrecheckResult?: string;
3871
3919
  aiPrecheckReason?: string;
3920
+ /** Notes explaining why this approval was created (e.g., auto-CR after InMail) */
3921
+ approvalNotes?: string;
3922
+ /** Additional metadata (e.g., system_generated flag, triggered_by context) */
3923
+ metadata?: Record<string, unknown>;
3872
3924
  createdAt: string;
3873
3925
  }
3874
3926
  interface ApprovalListResponse {
@@ -4168,6 +4220,10 @@ interface PendingApprovalExtended {
4168
4220
  content?: string;
4169
4221
  aiPrecheckResult?: string;
4170
4222
  aiPrecheckReason?: string;
4223
+ /** Notes explaining why this approval was created (e.g., auto-CR after InMail) */
4224
+ approvalNotes?: string;
4225
+ /** Additional metadata (e.g., system_generated flag, triggered_by context) */
4226
+ metadata?: Record<string, unknown>;
4171
4227
  createdAt: string;
4172
4228
  }
4173
4229
  interface ProjectApprovalsData {
@@ -4248,6 +4304,42 @@ interface EngagementStatusResponse {
4248
4304
  errors: Record<string, string>;
4249
4305
  computedAt: string;
4250
4306
  }
4307
+ /**
4308
+ * Rate limits for a LinkedIn account.
4309
+ * All fields are optional - only provide values you want to set.
4310
+ * Values of 0 disable the action (e.g., inmail=0 for basic accounts).
4311
+ */
4312
+ interface LinkedInAccountRateLimits {
4313
+ /** Daily connection request limit (0 to disable, max 500) */
4314
+ connectionRequest?: number;
4315
+ /** Daily direct message limit (0 to disable, max 150) */
4316
+ message?: number;
4317
+ /** Daily InMail limit (0 to disable, max 1000) */
4318
+ inmail?: number;
4319
+ /** Daily profile view limit (0 to disable, max 200) */
4320
+ viewProfile?: number;
4321
+ /** Daily post like limit (0 to disable, max 100) */
4322
+ likePost?: number;
4323
+ /** Daily post comment limit (0 to disable, max 50) */
4324
+ commentPost?: number;
4325
+ }
4326
+ /**
4327
+ * Request to update rate limits for a LinkedIn account.
4328
+ */
4329
+ interface LinkedInAccountRateLimitsUpdate {
4330
+ /** Daily limits to update. Omit fields to keep current values. */
4331
+ dailyLimits: LinkedInAccountRateLimits;
4332
+ }
4333
+ /**
4334
+ * Response containing rate limits for a LinkedIn account.
4335
+ */
4336
+ interface LinkedInAccountRateLimitsResponse {
4337
+ accountId: string;
4338
+ dailyLimits: Record<string, number>;
4339
+ dailyActionCounts: Record<string, number>;
4340
+ lastResetDate?: string | null;
4341
+ updatedAt: string;
4342
+ }
4251
4343
 
4252
4344
  /**
4253
4345
  * Resource for managing automated multi-step outreach sequences.
@@ -4420,6 +4512,20 @@ declare class SequencesResource {
4420
4512
  * @param userId - User ID or email to check rate limits for
4421
4513
  */
4422
4514
  getRateLimitStatus(userId: string): Promise<RateLimitStatusResponse>;
4515
+ /**
4516
+ * Get rate limits configuration for a specific LinkedIn account.
4517
+ * @param accountId - The LinkedIn account ID (UUID)
4518
+ * @param userId - User ID or email that owns the account
4519
+ */
4520
+ getLinkedInAccountRateLimits(accountId: string, userId: string): Promise<LinkedInAccountRateLimitsResponse>;
4521
+ /**
4522
+ * Update rate limits configuration for a specific LinkedIn account.
4523
+ * Only provided fields will be updated. Omit fields to keep current values.
4524
+ * @param accountId - The LinkedIn account ID (UUID)
4525
+ * @param request - The rate limits to update
4526
+ * @param userId - User ID or email that owns the account
4527
+ */
4528
+ updateLinkedInAccountRateLimits(accountId: string, request: LinkedInAccountRateLimitsUpdate, userId: string): Promise<LinkedInAccountRateLimitsResponse>;
4423
4529
  /**
4424
4530
  * List steps waiting for approval.
4425
4531
  */
@@ -5038,4 +5144,4 @@ declare class ProgressTracker {
5038
5144
  */
5039
5145
  declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
5040
5146
 
5041
- export { ACTION_DELAYS, type ActionLimit, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type ApprovalItem, type ApprovalListResponse, type ApprovalResponse, type ApprovalStatus, type ApprovalsParams, type ApprovalsRequestItem, type ApprovalsResponseItem, type ApproveStepRequest, 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 BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchExecutionInclude, type BatchExecutionRequest, type BatchExecutionResponse, BatchJobStatus, type BatchPollRequest, type BatchPollResponse, type BatchProspectIdentifier, type BatchRequestItem, type BatchRequestType, type BatchResponseItem, type BatchSendRequest, type BatchSendResponse, type BatchStepMetric, type BillingStatus, type BulkApprovalAction, type BulkApprovalFailure, type BulkApprovalRequest, type BulkApprovalResponse, type BulkCompleteFailure, type BulkCompleteRequest, type BulkCompleteResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkOperationRequest, type BulkOperationResponse, type BulkUploadResponse, CONTENT_LIMITS, CONTENT_LIMITS_MAP, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type CompleteExecutionRequest, type CompleteExecutionResponse, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ConnectionsSyncStatus, type ContactHistorySyncStatus, type ContentLimit, type ContentSource, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionResult, type CriterionType, DAILY_INMAIL_LIMITS, type DatabaseStatus, type DeepPeopleSearchOutput, type DeepSearchPreview, type DeepSearchStats, type DeleteApiKeyResponse, type DeleteConnectionsResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type DuplicateTemplateRequest, type Email, type EmailAction, type EmailThreadSummary, type EngagementStatus, type EngagementStatusData, type EngagementStatusRequest, type EngagementStatusResponse, type ErrorDetail, type ErrorResponse, type ErrorResponseItem, type EvidenceSource, type ExecutionDetailResponse, type ExecutionEvent, type ExecutionEventData, type ExecutionListResponse, type ExecutionMetricsOptions, type ExecutionMetricsResponse, type ExecutionStatus, type ExecutionSummary, type ExecutionSummaryExtended, type ExecutionsParams, type ExecutionsRequestItem, type ExecutionsResponseItem, 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, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LifecycleOperationRequest, type LifecycleOperationResponse, type LinkedInAccountInfoResponse, type LinkedInAction, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type LinkedInSyncStatusResponse, type ListApprovalsOptions, type ListExecutionsOptions, type ListProvidersResponse, type ListStepExecutionsOptions, type ListTemplatesOptions, 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 MetricsParams, type MetricsRequestItem, type MetricsResponseItem, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, type OnFailure, type OutcomeType, OutreachMethod, type PaginationInfo, type PaginationParams, type PendingApprovalExtended, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PostPreviewRequest, type PostPreviewResponse, type PostPreviewResult, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProjectApprovalsData, type ProjectExecutionsData, type ProjectMetricsData, type ProspectConnectionCheck, type ProspectInfo, type ProspectInput, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, type RateLimitData, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo, type RateLimitStatusResponse, type RateLimitsParams, type RateLimitsRequestItem, type RateLimitsResponseItem, type RejectStepRequest, type ReplySentiment, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SequenceAction, type SequenceApprovalNeededData, type SequenceChannel, type SequenceEventType, type SequenceExecutionCompletedData, type SequenceExecutionFailedData, type SequenceStepCompletedData, type SequenceTemplateCreate, type SequenceTemplateResponse, type SequenceTemplateUpdate, SequencesResource, SharePermission, 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, type SkipStepRequest, type SkipStepResponse, type SkippedProspect, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StartExecutionRequest, type StartExecutionResponse, type StepConfig, type StepExecutionItem, type StepExecutionListResponse, type StepExecutionStatus, type StepHistoryEntry, type StepMetric, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, SyncPhaseStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TemplateShareConfig, type TemplateShareInfo, type TemplateShareRequest, type TemplateSharesResponse, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type TransitionCondition, type TransitionConditionOperator, type TransitionConditionType, type TransitionConfig, type TransitionEventParams, type TriggerSyncResponse, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateStepExecutionRequest, type UpdateStepExecutionResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, VALID_EVENT_TYPES, type ValidatedCandidate, ValidationError, type ValidationIssue, type ValidationResponse, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, isRecruiterSubscription, verifyWebhookSignature };
5147
+ export { ACTION_DELAYS, type ActionLimit, type AddAndRunCriterionRequest, type AddCriterionRequest, type AgentConfig, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppliedFilters, type ApprovalItem, type ApprovalListResponse, type ApprovalResponse, type ApprovalStatus, type ApprovalsParams, type ApprovalsRequestItem, type ApprovalsResponseItem, type ApproveStepRequest, 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 BatchDraftJobProgress, type BatchDraftJobResponse, type BatchDraftJobStartedData, type BatchDraftJobStatusResponse, type BatchDraftProgressData, type BatchDraftRequest, type BatchDraftResponse, type BatchDraftStreamCallbacks, type BatchDraftStreamEvent, type BatchDraftStreamEventType, type BatchExecutionInclude, type BatchExecutionRequest, type BatchExecutionResponse, BatchJobStatus, type BatchPollRequest, type BatchPollResponse, type BatchProspectIdentifier, type BatchRequestItem, type BatchRequestType, type BatchResponseItem, type BatchSendRequest, type BatchSendResponse, type BatchStepMetric, type BillingStatus, type BulkApprovalAction, type BulkApprovalFailure, type BulkApprovalRequest, type BulkApprovalResponse, type BulkCompleteFailure, type BulkCompleteRequest, type BulkCompleteResponse, type BulkDeleteRequest, type BulkDeleteResponse, type BulkOperationRequest, type BulkOperationResponse, type BulkUploadResponse, CONTENT_LIMITS, CONTENT_LIMITS_MAP, type CancelDraftResponse, type CancelResponseResponse, type ChannelContactHistory, ChannelType, type CheckAppEnabledParams, type CheckLinkedInConnectionRequest, type CheckPriorContactRequest, type CheckPriorContactResponse, type ChunkingStrategy, type CompleteExecutionRequest, type CompleteExecutionResponse, type ConnectionAcceptedData, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ConnectionSummary, type ConnectionsSyncStatus, type ContactHistorySyncStatus, type ContentLimit, type ContentSource, type ContentType, type ConversationDetail, ConversationStatus, type ConversationSummary, type CreateDraftRequest, type CreateFeedbackRequest, type CreateFeedbackResponse, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type CriteriaClassification, type CriteriaMetadata, type CriterionDefinition, type CriterionResult, type CriterionType, DAILY_INMAIL_LIMITS, DEFAULT_SUBSCRIPTION_TYPE, type DatabaseStatus, type DeepPeopleSearchOutput, type DeepSearchPreview, type DeepSearchStats, type DeleteApiKeyResponse, type DeleteConnectionsResponse, type DeleteConversationResponse, type DeleteConversationsByProjectResponse, type DisconnectRequest, type DisconnectResponse, type DraftResponse, type DraftSendOverride, DraftStatus, type DuplicateHandling, type DuplicateTemplateRequest, type Email, type EmailAction, type EmailThreadSummary, type EngagementStatus, type EngagementStatusData, type EngagementStatusRequest, type EngagementStatusResponse, type ErrorDetail, type ErrorResponse, type ErrorResponseItem, type EvidenceSource, type ExecutionDetailResponse, type ExecutionEvent, type ExecutionEventData, type ExecutionListResponse, type ExecutionMetricsOptions, type ExecutionMetricsResponse, type ExecutionStatus, type ExecutionSummary, type ExecutionSummaryExtended, type ExecutionsParams, type ExecutionsRequestItem, type ExecutionsResponseItem, 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, type InmailSubscription, IntegrationsResource, InternalServerError, LINKEDIN_LIMITS, type LifecycleOperationRequest, type LifecycleOperationResponse, type LinkedInAccountInfoResponse, type LinkedInAccountRateLimits, type LinkedInAccountRateLimitsResponse, type LinkedInAccountRateLimitsUpdate, type LinkedInAction, type LinkedInConnectionStatus, type LinkedInCreditsResponse, type LinkedInLimitSubscriptionType, type LinkedInLimits, type LinkedInSendRequest, type LinkedInSubscriptionInfo, LinkedInSubscriptionType, type LinkedInSyncStatusResponse, type ListApprovalsOptions, type ListExecutionsOptions, type ListProvidersResponse, type ListStepExecutionsOptions, type ListTemplatesOptions, 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 MetricsParams, type MetricsRequestItem, type MetricsResponseItem, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NetworkDistance, NoDataSourcesError, NotFoundError, type OnFailure, type OutcomeType, OutreachMethod, type PaginationInfo, type PaginationParams, type PendingApprovalExtended, PeopleDataSource, PeopleResource, type PeopleSearchRequest, type PeopleSearchResponse, type PersonResult, type Plan, type PostPreviewRequest, type PostPreviewResponse, type PostPreviewResult, type PriorContactMessage, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, ProgressTracker, type ProjectApprovalsData, type ProjectExecutionsData, type ProjectMetricsData, type ProspectConnectionCheck, type ProspectInfo, type ProspectInput, type ProspectPriorContactResult, type ProspectSyncIdentifier, type ProspectSyncResult, ProviderType, QueueItemStatus, type QuickPeopleSearchOutput, RATE_LIMIT_COOLDOWNS, type RateLimitData, RateLimitError, type RateLimitErrorOptions, type RateLimitInfo$1 as RateLimitInfo, type RateLimitStatusResponse, type RateLimitsParams, type RateLimitsRequestItem, type RateLimitsResponseItem, type RejectStepRequest, type ReplySentiment, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, SEQUENCE_RATE_LIMITS, type SalaryRange, type Scope, type SelectedSkill, type SendMessageRequest, type SendMessageResponse, type SendReplyRequest, type SendResult, type SequenceAction, type SequenceApprovalNeededData, type SequenceChannel, type SequenceEventType, type SequenceExecutionCompletedData, type SequenceExecutionFailedData, type SequenceRateLimitAction, type SequenceStepCompletedData, type SequenceTemplateCreate, type SequenceTemplateResponse, type SequenceTemplateUpdate, SequencesResource, SharePermission, 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, type SkipStepRequest, type SkipStepResponse, type SkippedProspect, SourcesNotAvailableError, type SpecializedAgentParams, type SpecializedAgentType, type StartExecutionRequest, type StartExecutionResponse, type StepConfig, type StepExecutionItem, type StepExecutionListResponse, type StepExecutionStatus, type StepHistoryEntry, type StepMetric, type StoreApiKeyRequest, type StructuredResponse, type SyncJobResponse, SyncJobStatus, SyncPhaseStatus, type SyncProspectRequest, type SyncProspectResponse, type SyncRequest, type SyncStats, type TemplateShareConfig, type TemplateShareInfo, type TemplateShareRequest, type TemplateSharesResponse, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type TransitionCondition, type TransitionConditionOperator, type TransitionConditionType, type TransitionConfig, type TransitionEventParams, type TriggerSyncResponse, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, type UUID, type UnlinkConversationsResponse, type UpdateAppStatusParams, type UpdateAppStatusResponse, type UpdateDraftRequest, type UpdateLinkedInSubscriptionRequest, type UpdateStepExecutionRequest, type UpdateStepExecutionResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, VALID_EVENT_TYPES, type ValidatedCandidate, ValidationError, type ValidationIssue, type ValidationResponse, type WebhookEvent, type WebhookPayload, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getDefaultDailyLimits, getInmailAllowance, getLimits, getMessageLimit, getRateLimit, hasOpenProfileMessages, isRecruiterSubscription, normalizeAction, verifyWebhookSignature };
package/dist/index.mjs CHANGED
@@ -194,6 +194,159 @@ const UNIPILE_SAFE_LIMITS = {
194
194
  recruiter_corporate: 500
195
195
  }
196
196
  };
197
+ const DEFAULT_SUBSCRIPTION_TYPE = "basic";
198
+ const EMAIL_RATE_LIMITS = {
199
+ email: {
200
+ perDay: 150,
201
+ per5Min: 20,
202
+ delaySeconds: [30, 60]
203
+ }
204
+ };
205
+ const SEQUENCE_RATE_LIMITS = {
206
+ linkedin: {
207
+ connection_request: {
208
+ perDay: {
209
+ basic: 25,
210
+ premium: 40,
211
+ premium_career: 40,
212
+ premium_business: 40,
213
+ sales_navigator: 50,
214
+ recruiter_lite: 100,
215
+ recruiter_corporate: 150
216
+ },
217
+ per5Min: 8,
218
+ delaySeconds: [60, 120]
219
+ },
220
+ message: {
221
+ perDay: {
222
+ // NOTE: basic=40 aligns with DB default from migration 0028
223
+ // Higher-tier accounts can be customized via linkedin_accounts.daily_limits
224
+ basic: 40,
225
+ premium: 40,
226
+ premium_career: 40,
227
+ premium_business: 40,
228
+ sales_navigator: 50,
229
+ recruiter_lite: 60,
230
+ recruiter_corporate: 80
231
+ },
232
+ per5Min: 10,
233
+ delaySeconds: [60, 120]
234
+ },
235
+ inmail: {
236
+ perDay: {
237
+ // NOTE: basic=40 aligns with DB default from migration 0028
238
+ // In practice, basic accounts don't have InMail, but DB allows
239
+ // configuration for accounts that upgrade or have special access
240
+ basic: 40,
241
+ premium: 40,
242
+ premium_career: 40,
243
+ premium_business: 40,
244
+ sales_navigator: 50,
245
+ recruiter_lite: 130,
246
+ recruiter_corporate: 1e3
247
+ },
248
+ per5Min: 10,
249
+ delaySeconds: [60, 120]
250
+ },
251
+ view_profile: {
252
+ perDay: {
253
+ basic: 80,
254
+ premium: 100,
255
+ premium_career: 100,
256
+ premium_business: 100,
257
+ sales_navigator: 150,
258
+ recruiter_lite: 200,
259
+ recruiter_corporate: 200
260
+ },
261
+ per5Min: 15,
262
+ delaySeconds: [30, 60]
263
+ },
264
+ like_post: {
265
+ perDay: {
266
+ basic: 50,
267
+ premium: 50,
268
+ premium_career: 50,
269
+ premium_business: 50,
270
+ sales_navigator: 50,
271
+ recruiter_lite: 50,
272
+ recruiter_corporate: 50
273
+ },
274
+ per5Min: 12,
275
+ delaySeconds: [30, 60]
276
+ },
277
+ comment_post: {
278
+ perDay: {
279
+ basic: 25,
280
+ premium: 25,
281
+ premium_career: 25,
282
+ premium_business: 25,
283
+ sales_navigator: 25,
284
+ recruiter_lite: 25,
285
+ recruiter_corporate: 25
286
+ },
287
+ per5Min: 6,
288
+ delaySeconds: [90, 180]
289
+ }
290
+ },
291
+ email: EMAIL_RATE_LIMITS,
292
+ gmail: EMAIL_RATE_LIMITS,
293
+ outlook: EMAIL_RATE_LIMITS
294
+ };
295
+ const ACTION_ALIASES = {
296
+ // Message variants
297
+ direct_message: "message",
298
+ dm: "message",
299
+ // Connection request variants
300
+ connection_request_with_note: "connection_request",
301
+ connection_request_no_note: "connection_request",
302
+ connect: "connection_request",
303
+ // InMail variants
304
+ in_mail: "inmail",
305
+ // Profile view variants
306
+ profile_view: "view_profile",
307
+ // Post engagement variants
308
+ like: "like_post",
309
+ comment: "comment_post"
310
+ };
311
+ function normalizeAction(action) {
312
+ if (!action)
313
+ return action ?? "";
314
+ const actionLower = action.toLowerCase();
315
+ return ACTION_ALIASES[actionLower] ?? actionLower;
316
+ }
317
+ function getRateLimit(channel, action, subscriptionType = DEFAULT_SUBSCRIPTION_TYPE) {
318
+ const normalizedAction = normalizeAction(action);
319
+ const channelLimits = SEQUENCE_RATE_LIMITS[channel] ?? {};
320
+ const actionLimits = channelLimits[normalizedAction];
321
+ if (!actionLimits) {
322
+ return { perDay: 50, per5Min: 10, delaySeconds: [60, 120] };
323
+ }
324
+ const perDayLimits = actionLimits.perDay;
325
+ let perDay;
326
+ if (typeof perDayLimits === "object") {
327
+ perDay = perDayLimits[subscriptionType] ?? perDayLimits.basic ?? 40;
328
+ } else {
329
+ perDay = perDayLimits;
330
+ }
331
+ return {
332
+ perDay,
333
+ per5Min: actionLimits.per5Min ?? 10,
334
+ delaySeconds: actionLimits.delaySeconds ?? [60, 120]
335
+ };
336
+ }
337
+ function getDefaultDailyLimits(subscriptionType = DEFAULT_SUBSCRIPTION_TYPE) {
338
+ const linkedinLimits = SEQUENCE_RATE_LIMITS.linkedin ?? {};
339
+ const result = {};
340
+ for (const [action, limits] of Object.entries(linkedinLimits)) {
341
+ const perDayLimits = limits.perDay;
342
+ if (typeof perDayLimits === "object") {
343
+ result[action] = perDayLimits[subscriptionType] ?? perDayLimits.basic ?? 25;
344
+ } else {
345
+ result[action] = perDayLimits;
346
+ }
347
+ }
348
+ return result;
349
+ }
197
350
  const RATE_LIMIT_COOLDOWNS = {
198
351
  connectionRequestRejected: 3600,
199
352
  // 1 hour after rejection
@@ -2930,6 +3083,32 @@ class SequencesResource {
2930
3083
  { params: { user_id: userId } }
2931
3084
  );
2932
3085
  }
3086
+ // ==================== LinkedIn Account Rate Limits ====================
3087
+ /**
3088
+ * Get rate limits configuration for a specific LinkedIn account.
3089
+ * @param accountId - The LinkedIn account ID (UUID)
3090
+ * @param userId - User ID or email that owns the account
3091
+ */
3092
+ async getLinkedInAccountRateLimits(accountId, userId) {
3093
+ return this.http.get(
3094
+ `/sequences/linkedin-accounts/${encodeURIComponent(accountId)}/rate-limits`,
3095
+ { params: { user_id: userId } }
3096
+ );
3097
+ }
3098
+ /**
3099
+ * Update rate limits configuration for a specific LinkedIn account.
3100
+ * Only provided fields will be updated. Omit fields to keep current values.
3101
+ * @param accountId - The LinkedIn account ID (UUID)
3102
+ * @param request - The rate limits to update
3103
+ * @param userId - User ID or email that owns the account
3104
+ */
3105
+ async updateLinkedInAccountRateLimits(accountId, request, userId) {
3106
+ return this.http.patch(
3107
+ `/sequences/linkedin-accounts/${encodeURIComponent(accountId)}/rate-limits`,
3108
+ request,
3109
+ { params: { user_id: userId } }
3110
+ );
3111
+ }
2933
3112
  // ==================== Approvals ====================
2934
3113
  /**
2935
3114
  * List steps waiting for approval.
@@ -4031,4 +4210,4 @@ function verifyWebhookSignature(payload, signature, secret) {
4031
4210
  );
4032
4211
  }
4033
4212
 
4034
- export { ACTION_DELAYS, AuthenticationError, BatchJobStatus, CONTENT_LIMITS, CONTENT_LIMITS_MAP, ChannelType, ConversationStatus, DAILY_INMAIL_LIMITS, 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, SharePermission, SourcesNotAvailableError, SyncJobStatus, SyncPhaseStatus, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, VALID_EVENT_TYPES, ValidationError, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getInmailAllowance, getLimits, getMessageLimit, hasOpenProfileMessages, isRecruiterSubscription, verifyWebhookSignature };
4213
+ export { ACTION_DELAYS, AuthenticationError, BatchJobStatus, CONTENT_LIMITS, CONTENT_LIMITS_MAP, ChannelType, ConversationStatus, DAILY_INMAIL_LIMITS, DEFAULT_SUBSCRIPTION_TYPE, 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, SEQUENCE_RATE_LIMITS, SharePermission, SourcesNotAvailableError, SyncJobStatus, SyncPhaseStatus, UNIPILE_RATE_LIMIT_ERRORS, UNIPILE_SAFE_LIMITS, VALID_EVENT_TYPES, ValidationError, canSendInmail, displayProgress, formatProgressEntry, getBestSubscriptionForAction, getConnectionRequestLimit, getContentLimit, getDailyInmailLimit, getDefaultDailyLimits, getInmailAllowance, getLimits, getMessageLimit, getRateLimit, hasOpenProfileMessages, isRecruiterSubscription, normalizeAction, verifyWebhookSignature };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "lumnisai",
3
3
  "type": "module",
4
- "version": "0.3.4",
4
+ "version": "0.3.6",
5
5
  "description": "Official Node.js SDK for the Lumnis AI API",
6
6
  "author": "Lumnis AI",
7
7
  "license": "MIT",