@scalemule/sdk 0.0.60 → 0.0.62
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 +44 -1
- package/dist/index.mjs +43 -1
- 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,
|
|
@@ -1151,7 +1152,7 @@ var ScaleMuleClient = class {
|
|
|
1151
1152
|
const method = (init.method || "GET").toUpperCase();
|
|
1152
1153
|
const timeout = init.timeout || this.defaultTimeout;
|
|
1153
1154
|
const maxRetries = init.skipRetry ? 0 : init.retries ?? this.maxRetries;
|
|
1154
|
-
const bodyStr = init.body ? JSON.stringify(init.body) : void 0;
|
|
1155
|
+
const bodyStr = init.body !== void 0 && init.body !== null ? typeof init.body === "string" ? init.body : JSON.stringify(init.body) : void 0;
|
|
1155
1156
|
let lastError = null;
|
|
1156
1157
|
let idempotencyKey = null;
|
|
1157
1158
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
@@ -1160,6 +1161,9 @@ var ScaleMuleClient = class {
|
|
|
1160
1161
|
"User-Agent": `ScaleMule-SDK-TypeScript/${SDK_VERSION}`,
|
|
1161
1162
|
...init.headers
|
|
1162
1163
|
};
|
|
1164
|
+
if (bodyStr !== void 0 && !Object.keys(headers).some((k) => k.toLowerCase() === "content-type")) {
|
|
1165
|
+
headers["Content-Type"] = "application/json";
|
|
1166
|
+
}
|
|
1163
1167
|
if (!init.skipAuth && this.sessionToken) {
|
|
1164
1168
|
headers["Authorization"] = `Bearer ${this.sessionToken}`;
|
|
1165
1169
|
}
|
|
@@ -5297,6 +5301,43 @@ var ReferralsService = class extends ServiceModule {
|
|
|
5297
5301
|
}
|
|
5298
5302
|
};
|
|
5299
5303
|
|
|
5304
|
+
// src/services/leads.ts
|
|
5305
|
+
var LeadsService = class extends ServiceModule {
|
|
5306
|
+
constructor() {
|
|
5307
|
+
super(...arguments);
|
|
5308
|
+
this.basePath = "/v1/leads";
|
|
5309
|
+
}
|
|
5310
|
+
/**
|
|
5311
|
+
* Submit a sales lead. Enterprise-form extras and the plan context are folded
|
|
5312
|
+
* into `metadata` (the leads table has no native company/employees columns).
|
|
5313
|
+
*/
|
|
5314
|
+
async create(input, options) {
|
|
5315
|
+
const metadata = {
|
|
5316
|
+
...input.metadata ?? {},
|
|
5317
|
+
...input.message ? { message: input.message } : {},
|
|
5318
|
+
...input.company ? { company: input.company } : {},
|
|
5319
|
+
...input.jobTitle ? { job_title: input.jobTitle } : {},
|
|
5320
|
+
...input.employees ? { employees: input.employees } : {},
|
|
5321
|
+
...input.country ? { country: input.country } : {},
|
|
5322
|
+
...input.planId ? { plan_id: input.planId } : {},
|
|
5323
|
+
...input.planName ? { plan_name: input.planName } : {}
|
|
5324
|
+
};
|
|
5325
|
+
const body = {
|
|
5326
|
+
contact_name: input.contactName,
|
|
5327
|
+
contact_email: input.contactEmail,
|
|
5328
|
+
contact_phone: input.contactPhone,
|
|
5329
|
+
service_category: input.serviceCategory ?? "sales_inquiry",
|
|
5330
|
+
lead_source: input.leadSource ?? "form",
|
|
5331
|
+
utm_source: input.utmSource,
|
|
5332
|
+
utm_medium: input.utmMedium,
|
|
5333
|
+
utm_campaign: input.utmCampaign,
|
|
5334
|
+
// Backend stores metadata as a JSON string (matches admin client shape).
|
|
5335
|
+
metadata: JSON.stringify(metadata)
|
|
5336
|
+
};
|
|
5337
|
+
return this.post("", body, options);
|
|
5338
|
+
}
|
|
5339
|
+
};
|
|
5340
|
+
|
|
5300
5341
|
// src/services/billing.ts
|
|
5301
5342
|
var BillingService = class extends ServiceModule {
|
|
5302
5343
|
constructor() {
|
|
@@ -8578,6 +8619,7 @@ var ScaleMule = class {
|
|
|
8578
8619
|
this.socialPolicy = new SocialPolicyService(this._client);
|
|
8579
8620
|
this.referrals = new ReferralsService(this._client);
|
|
8580
8621
|
this.billing = new BillingService(this._client);
|
|
8622
|
+
this.leads = new LeadsService(this._client);
|
|
8581
8623
|
this.analytics = new AnalyticsService(this._client);
|
|
8582
8624
|
this.flags = new FlagsService(this._client);
|
|
8583
8625
|
this.communication = new CommunicationService(this._client);
|
|
@@ -8765,6 +8807,7 @@ var index_default = ScaleMule;
|
|
|
8765
8807
|
IdentityService,
|
|
8766
8808
|
LEGACY_ANONYMOUS_ID_KEYS,
|
|
8767
8809
|
LeaderboardService,
|
|
8810
|
+
LeadsService,
|
|
8768
8811
|
ListingsService,
|
|
8769
8812
|
LoggerService,
|
|
8770
8813
|
MEDIA_PRESETS,
|
package/dist/index.mjs
CHANGED
|
@@ -1048,7 +1048,7 @@ var ScaleMuleClient = class {
|
|
|
1048
1048
|
const method = (init.method || "GET").toUpperCase();
|
|
1049
1049
|
const timeout = init.timeout || this.defaultTimeout;
|
|
1050
1050
|
const maxRetries = init.skipRetry ? 0 : init.retries ?? this.maxRetries;
|
|
1051
|
-
const bodyStr = init.body ? JSON.stringify(init.body) : void 0;
|
|
1051
|
+
const bodyStr = init.body !== void 0 && init.body !== null ? typeof init.body === "string" ? init.body : JSON.stringify(init.body) : void 0;
|
|
1052
1052
|
let lastError = null;
|
|
1053
1053
|
let idempotencyKey = null;
|
|
1054
1054
|
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
@@ -1057,6 +1057,9 @@ var ScaleMuleClient = class {
|
|
|
1057
1057
|
"User-Agent": `ScaleMule-SDK-TypeScript/${SDK_VERSION}`,
|
|
1058
1058
|
...init.headers
|
|
1059
1059
|
};
|
|
1060
|
+
if (bodyStr !== void 0 && !Object.keys(headers).some((k) => k.toLowerCase() === "content-type")) {
|
|
1061
|
+
headers["Content-Type"] = "application/json";
|
|
1062
|
+
}
|
|
1060
1063
|
if (!init.skipAuth && this.sessionToken) {
|
|
1061
1064
|
headers["Authorization"] = `Bearer ${this.sessionToken}`;
|
|
1062
1065
|
}
|
|
@@ -5194,6 +5197,43 @@ var ReferralsService = class extends ServiceModule {
|
|
|
5194
5197
|
}
|
|
5195
5198
|
};
|
|
5196
5199
|
|
|
5200
|
+
// src/services/leads.ts
|
|
5201
|
+
var LeadsService = class extends ServiceModule {
|
|
5202
|
+
constructor() {
|
|
5203
|
+
super(...arguments);
|
|
5204
|
+
this.basePath = "/v1/leads";
|
|
5205
|
+
}
|
|
5206
|
+
/**
|
|
5207
|
+
* Submit a sales lead. Enterprise-form extras and the plan context are folded
|
|
5208
|
+
* into `metadata` (the leads table has no native company/employees columns).
|
|
5209
|
+
*/
|
|
5210
|
+
async create(input, options) {
|
|
5211
|
+
const metadata = {
|
|
5212
|
+
...input.metadata ?? {},
|
|
5213
|
+
...input.message ? { message: input.message } : {},
|
|
5214
|
+
...input.company ? { company: input.company } : {},
|
|
5215
|
+
...input.jobTitle ? { job_title: input.jobTitle } : {},
|
|
5216
|
+
...input.employees ? { employees: input.employees } : {},
|
|
5217
|
+
...input.country ? { country: input.country } : {},
|
|
5218
|
+
...input.planId ? { plan_id: input.planId } : {},
|
|
5219
|
+
...input.planName ? { plan_name: input.planName } : {}
|
|
5220
|
+
};
|
|
5221
|
+
const body = {
|
|
5222
|
+
contact_name: input.contactName,
|
|
5223
|
+
contact_email: input.contactEmail,
|
|
5224
|
+
contact_phone: input.contactPhone,
|
|
5225
|
+
service_category: input.serviceCategory ?? "sales_inquiry",
|
|
5226
|
+
lead_source: input.leadSource ?? "form",
|
|
5227
|
+
utm_source: input.utmSource,
|
|
5228
|
+
utm_medium: input.utmMedium,
|
|
5229
|
+
utm_campaign: input.utmCampaign,
|
|
5230
|
+
// Backend stores metadata as a JSON string (matches admin client shape).
|
|
5231
|
+
metadata: JSON.stringify(metadata)
|
|
5232
|
+
};
|
|
5233
|
+
return this.post("", body, options);
|
|
5234
|
+
}
|
|
5235
|
+
};
|
|
5236
|
+
|
|
5197
5237
|
// src/services/billing.ts
|
|
5198
5238
|
var BillingService = class extends ServiceModule {
|
|
5199
5239
|
constructor() {
|
|
@@ -8475,6 +8515,7 @@ var ScaleMule = class {
|
|
|
8475
8515
|
this.socialPolicy = new SocialPolicyService(this._client);
|
|
8476
8516
|
this.referrals = new ReferralsService(this._client);
|
|
8477
8517
|
this.billing = new BillingService(this._client);
|
|
8518
|
+
this.leads = new LeadsService(this._client);
|
|
8478
8519
|
this.analytics = new AnalyticsService(this._client);
|
|
8479
8520
|
this.flags = new FlagsService(this._client);
|
|
8480
8521
|
this.communication = new CommunicationService(this._client);
|
|
@@ -8661,6 +8702,7 @@ export {
|
|
|
8661
8702
|
IdentityService,
|
|
8662
8703
|
LEGACY_ANONYMOUS_ID_KEYS,
|
|
8663
8704
|
LeaderboardService,
|
|
8705
|
+
LeadsService,
|
|
8664
8706
|
ListingsService,
|
|
8665
8707
|
LoggerService,
|
|
8666
8708
|
MEDIA_PRESETS,
|