@scalemule/sdk 0.0.23 → 0.0.24

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 CHANGED
@@ -1870,6 +1870,83 @@ declare class SocialService extends ServiceModule {
1870
1870
  }): Promise<ApiResponse<Comment>>;
1871
1871
  }
1872
1872
 
1873
+ /**
1874
+ * Referrals Service Module
1875
+ *
1876
+ * Referral program management — share links, campaigns, attribution, rewards.
1877
+ *
1878
+ * Routes:
1879
+ * GET /me → current user's referral profile + stats
1880
+ * GET /me/analytics → referral analytics over time
1881
+ * POST /links → create tracked share link (records channel)
1882
+ * GET /public → resolve referral code to campaign info (no auth)
1883
+ * GET /campaign → get campaign config
1884
+ */
1885
+
1886
+ interface ReferralProfile {
1887
+ referral_code: string;
1888
+ share_link: string;
1889
+ campaign: ReferralCampaign;
1890
+ stats: ReferralStats;
1891
+ }
1892
+ interface ReferralCampaign {
1893
+ id: string;
1894
+ name: string;
1895
+ status: 'active' | 'inactive';
1896
+ reward_referrer_cents: number;
1897
+ reward_friend_cents: number;
1898
+ starts_at: string | null;
1899
+ ends_at: string | null;
1900
+ }
1901
+ interface ReferralStats {
1902
+ clicks: number;
1903
+ signups: number;
1904
+ paid: number;
1905
+ rewarded: number;
1906
+ }
1907
+ interface ShareLink {
1908
+ channel: string;
1909
+ share_link: string;
1910
+ referral_code: string;
1911
+ }
1912
+ interface ReferralAnalytics {
1913
+ daily: Array<{
1914
+ date: string;
1915
+ clicks: number;
1916
+ signups: number;
1917
+ paid: number;
1918
+ }>;
1919
+ totals: ReferralStats;
1920
+ }
1921
+ interface ResolvedReferral {
1922
+ referral_code: string;
1923
+ campaign: ReferralCampaign;
1924
+ }
1925
+ declare class ReferralsService extends ServiceModule {
1926
+ protected basePath: string;
1927
+ /**
1928
+ * Get current user's referral code, share link, campaign, and stats.
1929
+ * Requires member auth.
1930
+ */
1931
+ getMyReferral(options?: RequestOptions): Promise<ApiResponse<ReferralProfile>>;
1932
+ /**
1933
+ * Generate a tracked share link. The `channel` param records where
1934
+ * the share was initiated (e.g., 'whatsapp', 'email', 'copy').
1935
+ * Requires member auth.
1936
+ */
1937
+ createShareLink(channel?: string, options?: RequestOptions): Promise<ApiResponse<ShareLink>>;
1938
+ /**
1939
+ * Get referral analytics for the current user over the last N days.
1940
+ * Requires member auth.
1941
+ */
1942
+ getMyAnalytics(days?: number, options?: RequestOptions): Promise<ApiResponse<ReferralAnalytics>>;
1943
+ /**
1944
+ * Resolve a referral code to its campaign info.
1945
+ * Public endpoint — no member auth required, only API key.
1946
+ */
1947
+ resolveCode(code: string, options?: RequestOptions): Promise<ApiResponse<ResolvedReferral>>;
1948
+ }
1949
+
1873
1950
  /**
1874
1951
  * Billing Service Module
1875
1952
  *
@@ -5364,6 +5441,7 @@ declare class ScaleMule {
5364
5441
  readonly data: DataService;
5365
5442
  readonly chat: ChatService;
5366
5443
  readonly social: SocialService;
5444
+ readonly referrals: ReferralsService;
5367
5445
  readonly billing: BillingService;
5368
5446
  readonly analytics: AnalyticsService;
5369
5447
  readonly flags: FlagsService;
@@ -5441,4 +5519,4 @@ declare class ScaleMule {
5441
5519
  getClient(): ScaleMuleClient;
5442
5520
  }
5443
5521
 
5444
- export { type AccountBalance, 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 AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, 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 GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, 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 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 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 Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, 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 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 Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
5522
+ export { type AccountBalance, 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 AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, 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 GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, 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 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 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, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, 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 SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, 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 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 Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
package/dist/index.d.ts CHANGED
@@ -1870,6 +1870,83 @@ declare class SocialService extends ServiceModule {
1870
1870
  }): Promise<ApiResponse<Comment>>;
1871
1871
  }
1872
1872
 
1873
+ /**
1874
+ * Referrals Service Module
1875
+ *
1876
+ * Referral program management — share links, campaigns, attribution, rewards.
1877
+ *
1878
+ * Routes:
1879
+ * GET /me → current user's referral profile + stats
1880
+ * GET /me/analytics → referral analytics over time
1881
+ * POST /links → create tracked share link (records channel)
1882
+ * GET /public → resolve referral code to campaign info (no auth)
1883
+ * GET /campaign → get campaign config
1884
+ */
1885
+
1886
+ interface ReferralProfile {
1887
+ referral_code: string;
1888
+ share_link: string;
1889
+ campaign: ReferralCampaign;
1890
+ stats: ReferralStats;
1891
+ }
1892
+ interface ReferralCampaign {
1893
+ id: string;
1894
+ name: string;
1895
+ status: 'active' | 'inactive';
1896
+ reward_referrer_cents: number;
1897
+ reward_friend_cents: number;
1898
+ starts_at: string | null;
1899
+ ends_at: string | null;
1900
+ }
1901
+ interface ReferralStats {
1902
+ clicks: number;
1903
+ signups: number;
1904
+ paid: number;
1905
+ rewarded: number;
1906
+ }
1907
+ interface ShareLink {
1908
+ channel: string;
1909
+ share_link: string;
1910
+ referral_code: string;
1911
+ }
1912
+ interface ReferralAnalytics {
1913
+ daily: Array<{
1914
+ date: string;
1915
+ clicks: number;
1916
+ signups: number;
1917
+ paid: number;
1918
+ }>;
1919
+ totals: ReferralStats;
1920
+ }
1921
+ interface ResolvedReferral {
1922
+ referral_code: string;
1923
+ campaign: ReferralCampaign;
1924
+ }
1925
+ declare class ReferralsService extends ServiceModule {
1926
+ protected basePath: string;
1927
+ /**
1928
+ * Get current user's referral code, share link, campaign, and stats.
1929
+ * Requires member auth.
1930
+ */
1931
+ getMyReferral(options?: RequestOptions): Promise<ApiResponse<ReferralProfile>>;
1932
+ /**
1933
+ * Generate a tracked share link. The `channel` param records where
1934
+ * the share was initiated (e.g., 'whatsapp', 'email', 'copy').
1935
+ * Requires member auth.
1936
+ */
1937
+ createShareLink(channel?: string, options?: RequestOptions): Promise<ApiResponse<ShareLink>>;
1938
+ /**
1939
+ * Get referral analytics for the current user over the last N days.
1940
+ * Requires member auth.
1941
+ */
1942
+ getMyAnalytics(days?: number, options?: RequestOptions): Promise<ApiResponse<ReferralAnalytics>>;
1943
+ /**
1944
+ * Resolve a referral code to its campaign info.
1945
+ * Public endpoint — no member auth required, only API key.
1946
+ */
1947
+ resolveCode(code: string, options?: RequestOptions): Promise<ApiResponse<ResolvedReferral>>;
1948
+ }
1949
+
1873
1950
  /**
1874
1951
  * Billing Service Module
1875
1952
  *
@@ -5364,6 +5441,7 @@ declare class ScaleMule {
5364
5441
  readonly data: DataService;
5365
5442
  readonly chat: ChatService;
5366
5443
  readonly social: SocialService;
5444
+ readonly referrals: ReferralsService;
5367
5445
  readonly billing: BillingService;
5368
5446
  readonly analytics: AnalyticsService;
5369
5447
  readonly flags: FlagsService;
@@ -5441,4 +5519,4 @@ declare class ScaleMule {
5441
5519
  getClient(): ScaleMuleClient;
5442
5520
  }
5443
5521
 
5444
- export { type AccountBalance, 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 AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, 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 GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, 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 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 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 Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, 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 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 Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
5522
+ export { type AccountBalance, 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 AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, 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 GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, 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 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 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, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, 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 SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, 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 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 Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
package/dist/index.js CHANGED
@@ -326,6 +326,7 @@ __export(index_exports, {
326
326
  PhotoService: () => PhotoService,
327
327
  QueueService: () => QueueService,
328
328
  RealtimeService: () => RealtimeService,
329
+ ReferralsService: () => ReferralsService,
329
330
  ScaleMule: () => ScaleMule,
330
331
  ScaleMuleClient: () => ScaleMuleClient,
331
332
  SchedulerService: () => SchedulerService,
@@ -4068,6 +4069,44 @@ var SocialService = class extends ServiceModule {
4068
4069
  }
4069
4070
  };
4070
4071
 
4072
+ // src/services/referrals.ts
4073
+ var ReferralsService = class extends ServiceModule {
4074
+ constructor() {
4075
+ super(...arguments);
4076
+ this.basePath = "/v1/referrals";
4077
+ }
4078
+ /**
4079
+ * Get current user's referral code, share link, campaign, and stats.
4080
+ * Requires member auth.
4081
+ */
4082
+ async getMyReferral(options) {
4083
+ return this._get("/me", options);
4084
+ }
4085
+ /**
4086
+ * Generate a tracked share link. The `channel` param records where
4087
+ * the share was initiated (e.g., 'whatsapp', 'email', 'copy').
4088
+ * Requires member auth.
4089
+ */
4090
+ async createShareLink(channel, options) {
4091
+ return this.post("/links", channel ? { channel } : void 0, options);
4092
+ }
4093
+ /**
4094
+ * Get referral analytics for the current user over the last N days.
4095
+ * Requires member auth.
4096
+ */
4097
+ async getMyAnalytics(days, options) {
4098
+ const query = days ? `?days=${days}` : "";
4099
+ return this._get(`/me/analytics${query}`, options);
4100
+ }
4101
+ /**
4102
+ * Resolve a referral code to its campaign info.
4103
+ * Public endpoint — no member auth required, only API key.
4104
+ */
4105
+ async resolveCode(code, options) {
4106
+ return this._get(`/public?rc=${encodeURIComponent(code)}`, options);
4107
+ }
4108
+ };
4109
+
4071
4110
  // src/services/billing.ts
4072
4111
  var BillingService = class extends ServiceModule {
4073
4112
  constructor() {
@@ -6220,6 +6259,7 @@ var ScaleMule = class {
6220
6259
  this.data = new DataService(this._client);
6221
6260
  this.chat = new ChatService(this._client);
6222
6261
  this.social = new SocialService(this._client);
6262
+ this.referrals = new ReferralsService(this._client);
6223
6263
  this.billing = new BillingService(this._client);
6224
6264
  this.analytics = new AnalyticsService(this._client);
6225
6265
  this.flags = new FlagsService(this._client);
@@ -6374,6 +6414,7 @@ var index_default = ScaleMule;
6374
6414
  PhotoService,
6375
6415
  QueueService,
6376
6416
  RealtimeService,
6417
+ ReferralsService,
6377
6418
  ScaleMule,
6378
6419
  ScaleMuleClient,
6379
6420
  SchedulerService,
package/dist/index.mjs CHANGED
@@ -3710,6 +3710,44 @@ var SocialService = class extends ServiceModule {
3710
3710
  }
3711
3711
  };
3712
3712
 
3713
+ // src/services/referrals.ts
3714
+ var ReferralsService = class extends ServiceModule {
3715
+ constructor() {
3716
+ super(...arguments);
3717
+ this.basePath = "/v1/referrals";
3718
+ }
3719
+ /**
3720
+ * Get current user's referral code, share link, campaign, and stats.
3721
+ * Requires member auth.
3722
+ */
3723
+ async getMyReferral(options) {
3724
+ return this._get("/me", options);
3725
+ }
3726
+ /**
3727
+ * Generate a tracked share link. The `channel` param records where
3728
+ * the share was initiated (e.g., 'whatsapp', 'email', 'copy').
3729
+ * Requires member auth.
3730
+ */
3731
+ async createShareLink(channel, options) {
3732
+ return this.post("/links", channel ? { channel } : void 0, options);
3733
+ }
3734
+ /**
3735
+ * Get referral analytics for the current user over the last N days.
3736
+ * Requires member auth.
3737
+ */
3738
+ async getMyAnalytics(days, options) {
3739
+ const query = days ? `?days=${days}` : "";
3740
+ return this._get(`/me/analytics${query}`, options);
3741
+ }
3742
+ /**
3743
+ * Resolve a referral code to its campaign info.
3744
+ * Public endpoint — no member auth required, only API key.
3745
+ */
3746
+ async resolveCode(code, options) {
3747
+ return this._get(`/public?rc=${encodeURIComponent(code)}`, options);
3748
+ }
3749
+ };
3750
+
3713
3751
  // src/services/billing.ts
3714
3752
  var BillingService = class extends ServiceModule {
3715
3753
  constructor() {
@@ -5862,6 +5900,7 @@ var ScaleMule = class {
5862
5900
  this.data = new DataService(this._client);
5863
5901
  this.chat = new ChatService(this._client);
5864
5902
  this.social = new SocialService(this._client);
5903
+ this.referrals = new ReferralsService(this._client);
5865
5904
  this.billing = new BillingService(this._client);
5866
5905
  this.analytics = new AnalyticsService(this._client);
5867
5906
  this.flags = new FlagsService(this._client);
@@ -6015,6 +6054,7 @@ export {
6015
6054
  PhotoService,
6016
6055
  QueueService,
6017
6056
  RealtimeService,
6057
+ ReferralsService,
6018
6058
  ScaleMule,
6019
6059
  ScaleMuleClient,
6020
6060
  SchedulerService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/sdk",
3
- "version": "0.0.23",
3
+ "version": "0.0.24",
4
4
  "description": "Official TypeScript/JavaScript SDK for ScaleMule Backend-as-a-Service",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -65,7 +65,7 @@
65
65
  "semver": "^7.7.4"
66
66
  },
67
67
  "peerDependencies": {
68
- "@scalemule/ui": "^0.0.1",
68
+ "@scalemule/ui": ">=0.0.1",
69
69
  "browser-image-compression": ">=2.0.0"
70
70
  },
71
71
  "peerDependenciesMeta": {
@@ -77,7 +77,7 @@
77
77
  }
78
78
  },
79
79
  "devDependencies": {
80
- "@scalemule/ui": "^0.0.1",
80
+ "@scalemule/ui": ">=0.0.1",
81
81
  "@types/node": "^20.10.0",
82
82
  "@typescript-eslint/eslint-plugin": "^6.13.0",
83
83
  "@typescript-eslint/parser": "^6.13.0",