@scalemule/sdk 0.0.60 → 0.0.61
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.d.mts +60 -1
- package/dist/index.d.ts +60 -1
- package/dist/index.js +40 -0
- package/dist/index.mjs +39 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3085,6 +3085,64 @@ declare class ReferralsService extends ServiceModule {
|
|
|
3085
3085
|
resolveCode(code: string, options?: RequestOptions): Promise<ApiResponse<ResolvedReferral>>;
|
|
3086
3086
|
}
|
|
3087
3087
|
|
|
3088
|
+
/**
|
|
3089
|
+
* Leads Service Module
|
|
3090
|
+
*
|
|
3091
|
+
* Sales lead capture — e.g. the "Contact us" form on a custom/enterprise plan.
|
|
3092
|
+
* Callable by a not-logged-in visitor (only the app's API key is required).
|
|
3093
|
+
*
|
|
3094
|
+
* Routes:
|
|
3095
|
+
* POST / → create a lead (tenant-scoped by the app credential)
|
|
3096
|
+
*
|
|
3097
|
+
* The leads table has native contact fields (name/email/phone) plus a free-form
|
|
3098
|
+
* `metadata` JSON. Enterprise-form extras (company, job title, employees,
|
|
3099
|
+
* country, message) and the plan context are placed into `metadata`.
|
|
3100
|
+
*/
|
|
3101
|
+
|
|
3102
|
+
interface CreateLeadInput {
|
|
3103
|
+
/** Required. Full contact name (e.g. `${firstName} ${lastName}`). */
|
|
3104
|
+
contactName: string;
|
|
3105
|
+
/** Required. */
|
|
3106
|
+
contactEmail: string;
|
|
3107
|
+
contactPhone?: string;
|
|
3108
|
+
/** Defaults to 'sales_inquiry'. */
|
|
3109
|
+
serviceCategory?: string;
|
|
3110
|
+
/** Defaults to 'form'. */
|
|
3111
|
+
leadSource?: string;
|
|
3112
|
+
/** Free-text "how can sales help you?". Stored in metadata. */
|
|
3113
|
+
message?: string;
|
|
3114
|
+
company?: string;
|
|
3115
|
+
jobTitle?: string;
|
|
3116
|
+
employees?: string;
|
|
3117
|
+
country?: string;
|
|
3118
|
+
/** The plan the enquiry is about (custom/enterprise tier). */
|
|
3119
|
+
planId?: string;
|
|
3120
|
+
planName?: string;
|
|
3121
|
+
utmSource?: string;
|
|
3122
|
+
utmMedium?: string;
|
|
3123
|
+
utmCampaign?: string;
|
|
3124
|
+
/** Extra fields merged into the lead's metadata. */
|
|
3125
|
+
metadata?: Record<string, unknown>;
|
|
3126
|
+
}
|
|
3127
|
+
interface Lead {
|
|
3128
|
+
id: string;
|
|
3129
|
+
contact_name: string;
|
|
3130
|
+
contact_email: string;
|
|
3131
|
+
contact_phone?: string;
|
|
3132
|
+
service_category: string;
|
|
3133
|
+
lead_source: string;
|
|
3134
|
+
lead_status: string;
|
|
3135
|
+
created_at: string;
|
|
3136
|
+
}
|
|
3137
|
+
declare class LeadsService extends ServiceModule {
|
|
3138
|
+
protected basePath: string;
|
|
3139
|
+
/**
|
|
3140
|
+
* Submit a sales lead. Enterprise-form extras and the plan context are folded
|
|
3141
|
+
* into `metadata` (the leads table has no native company/employees columns).
|
|
3142
|
+
*/
|
|
3143
|
+
create(input: CreateLeadInput, options?: RequestOptions): Promise<ApiResponse<Lead>>;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3088
3146
|
/**
|
|
3089
3147
|
* Billing Service Module
|
|
3090
3148
|
*
|
|
@@ -7240,6 +7298,7 @@ declare class ScaleMule {
|
|
|
7240
7298
|
readonly socialPolicy: SocialPolicyService;
|
|
7241
7299
|
readonly referrals: ReferralsService;
|
|
7242
7300
|
readonly billing: BillingService;
|
|
7301
|
+
readonly leads: LeadsService;
|
|
7243
7302
|
readonly analytics: AnalyticsService;
|
|
7244
7303
|
readonly flags: FlagsService;
|
|
7245
7304
|
readonly communication: CommunicationService;
|
|
@@ -7340,4 +7399,4 @@ declare class ScaleMule {
|
|
|
7340
7399
|
getClient(): ScaleMuleClient;
|
|
7341
7400
|
}
|
|
7342
7401
|
|
|
7343
|
-
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
7402
|
+
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateLeadInput, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Lead, type Leaderboard, type LeaderboardEntry, LeaderboardService, LeadsService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type VoteState, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.d.ts
CHANGED
|
@@ -3085,6 +3085,64 @@ declare class ReferralsService extends ServiceModule {
|
|
|
3085
3085
|
resolveCode(code: string, options?: RequestOptions): Promise<ApiResponse<ResolvedReferral>>;
|
|
3086
3086
|
}
|
|
3087
3087
|
|
|
3088
|
+
/**
|
|
3089
|
+
* Leads Service Module
|
|
3090
|
+
*
|
|
3091
|
+
* Sales lead capture — e.g. the "Contact us" form on a custom/enterprise plan.
|
|
3092
|
+
* Callable by a not-logged-in visitor (only the app's API key is required).
|
|
3093
|
+
*
|
|
3094
|
+
* Routes:
|
|
3095
|
+
* POST / → create a lead (tenant-scoped by the app credential)
|
|
3096
|
+
*
|
|
3097
|
+
* The leads table has native contact fields (name/email/phone) plus a free-form
|
|
3098
|
+
* `metadata` JSON. Enterprise-form extras (company, job title, employees,
|
|
3099
|
+
* country, message) and the plan context are placed into `metadata`.
|
|
3100
|
+
*/
|
|
3101
|
+
|
|
3102
|
+
interface CreateLeadInput {
|
|
3103
|
+
/** Required. Full contact name (e.g. `${firstName} ${lastName}`). */
|
|
3104
|
+
contactName: string;
|
|
3105
|
+
/** Required. */
|
|
3106
|
+
contactEmail: string;
|
|
3107
|
+
contactPhone?: string;
|
|
3108
|
+
/** Defaults to 'sales_inquiry'. */
|
|
3109
|
+
serviceCategory?: string;
|
|
3110
|
+
/** Defaults to 'form'. */
|
|
3111
|
+
leadSource?: string;
|
|
3112
|
+
/** Free-text "how can sales help you?". Stored in metadata. */
|
|
3113
|
+
message?: string;
|
|
3114
|
+
company?: string;
|
|
3115
|
+
jobTitle?: string;
|
|
3116
|
+
employees?: string;
|
|
3117
|
+
country?: string;
|
|
3118
|
+
/** The plan the enquiry is about (custom/enterprise tier). */
|
|
3119
|
+
planId?: string;
|
|
3120
|
+
planName?: string;
|
|
3121
|
+
utmSource?: string;
|
|
3122
|
+
utmMedium?: string;
|
|
3123
|
+
utmCampaign?: string;
|
|
3124
|
+
/** Extra fields merged into the lead's metadata. */
|
|
3125
|
+
metadata?: Record<string, unknown>;
|
|
3126
|
+
}
|
|
3127
|
+
interface Lead {
|
|
3128
|
+
id: string;
|
|
3129
|
+
contact_name: string;
|
|
3130
|
+
contact_email: string;
|
|
3131
|
+
contact_phone?: string;
|
|
3132
|
+
service_category: string;
|
|
3133
|
+
lead_source: string;
|
|
3134
|
+
lead_status: string;
|
|
3135
|
+
created_at: string;
|
|
3136
|
+
}
|
|
3137
|
+
declare class LeadsService extends ServiceModule {
|
|
3138
|
+
protected basePath: string;
|
|
3139
|
+
/**
|
|
3140
|
+
* Submit a sales lead. Enterprise-form extras and the plan context are folded
|
|
3141
|
+
* into `metadata` (the leads table has no native company/employees columns).
|
|
3142
|
+
*/
|
|
3143
|
+
create(input: CreateLeadInput, options?: RequestOptions): Promise<ApiResponse<Lead>>;
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3088
3146
|
/**
|
|
3089
3147
|
* Billing Service Module
|
|
3090
3148
|
*
|
|
@@ -7240,6 +7298,7 @@ declare class ScaleMule {
|
|
|
7240
7298
|
readonly socialPolicy: SocialPolicyService;
|
|
7241
7299
|
readonly referrals: ReferralsService;
|
|
7242
7300
|
readonly billing: BillingService;
|
|
7301
|
+
readonly leads: LeadsService;
|
|
7243
7302
|
readonly analytics: AnalyticsService;
|
|
7244
7303
|
readonly flags: FlagsService;
|
|
7245
7304
|
readonly communication: CommunicationService;
|
|
@@ -7340,4 +7399,4 @@ declare class ScaleMule {
|
|
|
7340
7399
|
getClient(): ScaleMuleClient;
|
|
7341
7400
|
}
|
|
7342
7401
|
|
|
7343
|
-
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
7402
|
+
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateLeadInput, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Lead, type Leaderboard, type LeaderboardEntry, LeaderboardService, LeadsService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type VoteState, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.js
CHANGED
|
@@ -321,6 +321,7 @@ __export(index_exports, {
|
|
|
321
321
|
IdentityService: () => IdentityService,
|
|
322
322
|
LEGACY_ANONYMOUS_ID_KEYS: () => LEGACY_ANONYMOUS_ID_KEYS,
|
|
323
323
|
LeaderboardService: () => LeaderboardService,
|
|
324
|
+
LeadsService: () => LeadsService,
|
|
324
325
|
ListingsService: () => ListingsService,
|
|
325
326
|
LoggerService: () => LoggerService,
|
|
326
327
|
MEDIA_PRESETS: () => MEDIA_PRESETS,
|
|
@@ -5297,6 +5298,43 @@ var ReferralsService = class extends ServiceModule {
|
|
|
5297
5298
|
}
|
|
5298
5299
|
};
|
|
5299
5300
|
|
|
5301
|
+
// src/services/leads.ts
|
|
5302
|
+
var LeadsService = class extends ServiceModule {
|
|
5303
|
+
constructor() {
|
|
5304
|
+
super(...arguments);
|
|
5305
|
+
this.basePath = "/v1/leads";
|
|
5306
|
+
}
|
|
5307
|
+
/**
|
|
5308
|
+
* Submit a sales lead. Enterprise-form extras and the plan context are folded
|
|
5309
|
+
* into `metadata` (the leads table has no native company/employees columns).
|
|
5310
|
+
*/
|
|
5311
|
+
async create(input, options) {
|
|
5312
|
+
const metadata = {
|
|
5313
|
+
...input.metadata ?? {},
|
|
5314
|
+
...input.message ? { message: input.message } : {},
|
|
5315
|
+
...input.company ? { company: input.company } : {},
|
|
5316
|
+
...input.jobTitle ? { job_title: input.jobTitle } : {},
|
|
5317
|
+
...input.employees ? { employees: input.employees } : {},
|
|
5318
|
+
...input.country ? { country: input.country } : {},
|
|
5319
|
+
...input.planId ? { plan_id: input.planId } : {},
|
|
5320
|
+
...input.planName ? { plan_name: input.planName } : {}
|
|
5321
|
+
};
|
|
5322
|
+
const body = {
|
|
5323
|
+
contact_name: input.contactName,
|
|
5324
|
+
contact_email: input.contactEmail,
|
|
5325
|
+
contact_phone: input.contactPhone,
|
|
5326
|
+
service_category: input.serviceCategory ?? "sales_inquiry",
|
|
5327
|
+
lead_source: input.leadSource ?? "form",
|
|
5328
|
+
utm_source: input.utmSource,
|
|
5329
|
+
utm_medium: input.utmMedium,
|
|
5330
|
+
utm_campaign: input.utmCampaign,
|
|
5331
|
+
// Backend stores metadata as a JSON string (matches admin client shape).
|
|
5332
|
+
metadata: JSON.stringify(metadata)
|
|
5333
|
+
};
|
|
5334
|
+
return this.post("", body, options);
|
|
5335
|
+
}
|
|
5336
|
+
};
|
|
5337
|
+
|
|
5300
5338
|
// src/services/billing.ts
|
|
5301
5339
|
var BillingService = class extends ServiceModule {
|
|
5302
5340
|
constructor() {
|
|
@@ -8578,6 +8616,7 @@ var ScaleMule = class {
|
|
|
8578
8616
|
this.socialPolicy = new SocialPolicyService(this._client);
|
|
8579
8617
|
this.referrals = new ReferralsService(this._client);
|
|
8580
8618
|
this.billing = new BillingService(this._client);
|
|
8619
|
+
this.leads = new LeadsService(this._client);
|
|
8581
8620
|
this.analytics = new AnalyticsService(this._client);
|
|
8582
8621
|
this.flags = new FlagsService(this._client);
|
|
8583
8622
|
this.communication = new CommunicationService(this._client);
|
|
@@ -8765,6 +8804,7 @@ var index_default = ScaleMule;
|
|
|
8765
8804
|
IdentityService,
|
|
8766
8805
|
LEGACY_ANONYMOUS_ID_KEYS,
|
|
8767
8806
|
LeaderboardService,
|
|
8807
|
+
LeadsService,
|
|
8768
8808
|
ListingsService,
|
|
8769
8809
|
LoggerService,
|
|
8770
8810
|
MEDIA_PRESETS,
|
package/dist/index.mjs
CHANGED
|
@@ -5194,6 +5194,43 @@ var ReferralsService = class extends ServiceModule {
|
|
|
5194
5194
|
}
|
|
5195
5195
|
};
|
|
5196
5196
|
|
|
5197
|
+
// src/services/leads.ts
|
|
5198
|
+
var LeadsService = class extends ServiceModule {
|
|
5199
|
+
constructor() {
|
|
5200
|
+
super(...arguments);
|
|
5201
|
+
this.basePath = "/v1/leads";
|
|
5202
|
+
}
|
|
5203
|
+
/**
|
|
5204
|
+
* Submit a sales lead. Enterprise-form extras and the plan context are folded
|
|
5205
|
+
* into `metadata` (the leads table has no native company/employees columns).
|
|
5206
|
+
*/
|
|
5207
|
+
async create(input, options) {
|
|
5208
|
+
const metadata = {
|
|
5209
|
+
...input.metadata ?? {},
|
|
5210
|
+
...input.message ? { message: input.message } : {},
|
|
5211
|
+
...input.company ? { company: input.company } : {},
|
|
5212
|
+
...input.jobTitle ? { job_title: input.jobTitle } : {},
|
|
5213
|
+
...input.employees ? { employees: input.employees } : {},
|
|
5214
|
+
...input.country ? { country: input.country } : {},
|
|
5215
|
+
...input.planId ? { plan_id: input.planId } : {},
|
|
5216
|
+
...input.planName ? { plan_name: input.planName } : {}
|
|
5217
|
+
};
|
|
5218
|
+
const body = {
|
|
5219
|
+
contact_name: input.contactName,
|
|
5220
|
+
contact_email: input.contactEmail,
|
|
5221
|
+
contact_phone: input.contactPhone,
|
|
5222
|
+
service_category: input.serviceCategory ?? "sales_inquiry",
|
|
5223
|
+
lead_source: input.leadSource ?? "form",
|
|
5224
|
+
utm_source: input.utmSource,
|
|
5225
|
+
utm_medium: input.utmMedium,
|
|
5226
|
+
utm_campaign: input.utmCampaign,
|
|
5227
|
+
// Backend stores metadata as a JSON string (matches admin client shape).
|
|
5228
|
+
metadata: JSON.stringify(metadata)
|
|
5229
|
+
};
|
|
5230
|
+
return this.post("", body, options);
|
|
5231
|
+
}
|
|
5232
|
+
};
|
|
5233
|
+
|
|
5197
5234
|
// src/services/billing.ts
|
|
5198
5235
|
var BillingService = class extends ServiceModule {
|
|
5199
5236
|
constructor() {
|
|
@@ -8475,6 +8512,7 @@ var ScaleMule = class {
|
|
|
8475
8512
|
this.socialPolicy = new SocialPolicyService(this._client);
|
|
8476
8513
|
this.referrals = new ReferralsService(this._client);
|
|
8477
8514
|
this.billing = new BillingService(this._client);
|
|
8515
|
+
this.leads = new LeadsService(this._client);
|
|
8478
8516
|
this.analytics = new AnalyticsService(this._client);
|
|
8479
8517
|
this.flags = new FlagsService(this._client);
|
|
8480
8518
|
this.communication = new CommunicationService(this._client);
|
|
@@ -8661,6 +8699,7 @@ export {
|
|
|
8661
8699
|
IdentityService,
|
|
8662
8700
|
LEGACY_ANONYMOUS_ID_KEYS,
|
|
8663
8701
|
LeaderboardService,
|
|
8702
|
+
LeadsService,
|
|
8664
8703
|
ListingsService,
|
|
8665
8704
|
LoggerService,
|
|
8666
8705
|
MEDIA_PRESETS,
|