@scalemule/sdk 0.0.68 → 0.0.70
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/README.md +22 -0
- package/dist/index.d.mts +37 -1
- package/dist/index.d.ts +37 -1
- package/dist/index.js +19 -2
- package/dist/index.mjs +19 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -357,6 +357,28 @@ await sm.social.like('post', postId)
|
|
|
357
357
|
const { data } = await sm.social.getComments(postId)
|
|
358
358
|
```
|
|
359
359
|
|
|
360
|
+
For apps that moderate posts in their own canonical store, project a reviewed
|
|
361
|
+
post into Social with the client API key from a server route. The projection is
|
|
362
|
+
idempotent for each application, `source_kind`, and `source_id`. Keep the creator's
|
|
363
|
+
discovery setting aligned with the app's public-profile preference.
|
|
364
|
+
|
|
365
|
+
```ts
|
|
366
|
+
await sm.social.upsertDiscoveryCreator({
|
|
367
|
+
creator_user_id: authorId,
|
|
368
|
+
username: authorHandle,
|
|
369
|
+
is_discoverable: profileIsPublic,
|
|
370
|
+
})
|
|
371
|
+
await sm.social.upsertContentPost({
|
|
372
|
+
author_user_id: authorId,
|
|
373
|
+
source_kind: 'community_post',
|
|
374
|
+
source_id: canonicalPostId,
|
|
375
|
+
distribution_state: 'published',
|
|
376
|
+
access_policy: 'public',
|
|
377
|
+
content_type: 'text',
|
|
378
|
+
title: reviewedTitle,
|
|
379
|
+
})
|
|
380
|
+
```
|
|
381
|
+
|
|
360
382
|
## Teams
|
|
361
383
|
|
|
362
384
|
```ts
|
package/dist/index.d.mts
CHANGED
|
@@ -130,6 +130,9 @@ interface ScaleMuleConfig {
|
|
|
130
130
|
applicationId?: string;
|
|
131
131
|
/** Base URL for API requests. Overrides environment preset. */
|
|
132
132
|
baseUrl?: string;
|
|
133
|
+
/** Public gateway for WebSockets when HTTP uses a same-origin cookie proxy.
|
|
134
|
+
* When set, realtime requires a successful ticket exchange; bearer fallback is disabled. */
|
|
135
|
+
realtimeUrl?: string;
|
|
133
136
|
/** Environment preset ('dev' or 'prod'). Defaults to 'prod'. */
|
|
134
137
|
environment?: 'dev' | 'prod';
|
|
135
138
|
/** Retry configuration for transient failures */
|
|
@@ -442,6 +445,7 @@ declare class ScaleMuleClient {
|
|
|
442
445
|
private apiKey;
|
|
443
446
|
private applicationId;
|
|
444
447
|
private baseUrl;
|
|
448
|
+
private realtimeUrl?;
|
|
445
449
|
private debug;
|
|
446
450
|
private storage;
|
|
447
451
|
private defaultTimeout;
|
|
@@ -525,6 +529,8 @@ declare class ScaleMuleClient {
|
|
|
525
529
|
/** Persist known accounts to storage */
|
|
526
530
|
private persistKnownAccounts;
|
|
527
531
|
getBaseUrl(): string;
|
|
532
|
+
getRealtimeUrl(): string;
|
|
533
|
+
requiresRealtimeTicket(): boolean;
|
|
528
534
|
getApiKey(): string;
|
|
529
535
|
isOnline(): boolean;
|
|
530
536
|
getOfflineQueueLength(): number;
|
|
@@ -2676,6 +2682,33 @@ interface SocialPost {
|
|
|
2676
2682
|
shares_count: number;
|
|
2677
2683
|
created_at: string;
|
|
2678
2684
|
}
|
|
2685
|
+
/** A canonical app record projected into Social after the app's moderation workflow. */
|
|
2686
|
+
interface SocialContentProjectionInput {
|
|
2687
|
+
author_user_id: string;
|
|
2688
|
+
source_kind: string;
|
|
2689
|
+
source_id: string;
|
|
2690
|
+
distribution_state: 'published' | 'hidden' | 'unpublished' | 'moderated_removed' | 'deleted';
|
|
2691
|
+
access_policy?: 'public' | 'followers' | 'premium' | 'private' | 'subscribers';
|
|
2692
|
+
content_type?: 'image' | 'video' | 'audio' | 'mixed' | 'text';
|
|
2693
|
+
preview_mode?: 'clear' | 'blurred' | 'none';
|
|
2694
|
+
title?: string;
|
|
2695
|
+
caption?: string;
|
|
2696
|
+
preview_photo_id?: string;
|
|
2697
|
+
published_at?: string;
|
|
2698
|
+
}
|
|
2699
|
+
interface SocialContentProjection extends SocialContentProjectionInput {
|
|
2700
|
+
id: string;
|
|
2701
|
+
created_at: string;
|
|
2702
|
+
updated_at: string;
|
|
2703
|
+
}
|
|
2704
|
+
interface SocialDiscoveryCreatorInput {
|
|
2705
|
+
creator_user_id: string;
|
|
2706
|
+
username: string;
|
|
2707
|
+
display_name?: string;
|
|
2708
|
+
primary_category?: string;
|
|
2709
|
+
avatar_asset_ref?: string;
|
|
2710
|
+
is_discoverable: boolean;
|
|
2711
|
+
}
|
|
2679
2712
|
interface Comment {
|
|
2680
2713
|
id: string;
|
|
2681
2714
|
post_id: string;
|
|
@@ -2733,6 +2766,9 @@ interface ViewState {
|
|
|
2733
2766
|
}
|
|
2734
2767
|
declare class SocialService extends ServiceModule {
|
|
2735
2768
|
protected basePath: string;
|
|
2769
|
+
/** Client API-key route; never send an internal platform token from an app. */
|
|
2770
|
+
upsertContentPost(input: SocialContentProjectionInput, options?: RequestOptions): Promise<ApiResponse<SocialContentProjection>>;
|
|
2771
|
+
upsertDiscoveryCreator(input: SocialDiscoveryCreatorInput, options?: RequestOptions): Promise<ApiResponse<unknown>>;
|
|
2736
2772
|
follow(userId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
2737
2773
|
followed: boolean;
|
|
2738
2774
|
}>>;
|
|
@@ -7769,4 +7805,4 @@ declare class ScaleMule {
|
|
|
7769
7805
|
getClient(): ScaleMuleClient;
|
|
7770
7806
|
}
|
|
7771
7807
|
|
|
7772
|
-
export { type AcceptQuoteInput, 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 AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, 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 CreatePollInput, type CreateQuoteInput, 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 CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, 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 Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, 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 Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, 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 UpdatePollInput, 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, pollSharePercent, pollVoterKey, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
7808
|
+
export { type AcceptQuoteInput, 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 AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, 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 CreatePollInput, type CreateQuoteInput, 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 CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, 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 Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, 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 Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, 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 SocialContentProjection, type SocialContentProjectionInput, type SocialDiscoveryCreatorInput, 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 UpdatePollInput, 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, pollSharePercent, pollVoterKey, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.d.ts
CHANGED
|
@@ -130,6 +130,9 @@ interface ScaleMuleConfig {
|
|
|
130
130
|
applicationId?: string;
|
|
131
131
|
/** Base URL for API requests. Overrides environment preset. */
|
|
132
132
|
baseUrl?: string;
|
|
133
|
+
/** Public gateway for WebSockets when HTTP uses a same-origin cookie proxy.
|
|
134
|
+
* When set, realtime requires a successful ticket exchange; bearer fallback is disabled. */
|
|
135
|
+
realtimeUrl?: string;
|
|
133
136
|
/** Environment preset ('dev' or 'prod'). Defaults to 'prod'. */
|
|
134
137
|
environment?: 'dev' | 'prod';
|
|
135
138
|
/** Retry configuration for transient failures */
|
|
@@ -442,6 +445,7 @@ declare class ScaleMuleClient {
|
|
|
442
445
|
private apiKey;
|
|
443
446
|
private applicationId;
|
|
444
447
|
private baseUrl;
|
|
448
|
+
private realtimeUrl?;
|
|
445
449
|
private debug;
|
|
446
450
|
private storage;
|
|
447
451
|
private defaultTimeout;
|
|
@@ -525,6 +529,8 @@ declare class ScaleMuleClient {
|
|
|
525
529
|
/** Persist known accounts to storage */
|
|
526
530
|
private persistKnownAccounts;
|
|
527
531
|
getBaseUrl(): string;
|
|
532
|
+
getRealtimeUrl(): string;
|
|
533
|
+
requiresRealtimeTicket(): boolean;
|
|
528
534
|
getApiKey(): string;
|
|
529
535
|
isOnline(): boolean;
|
|
530
536
|
getOfflineQueueLength(): number;
|
|
@@ -2676,6 +2682,33 @@ interface SocialPost {
|
|
|
2676
2682
|
shares_count: number;
|
|
2677
2683
|
created_at: string;
|
|
2678
2684
|
}
|
|
2685
|
+
/** A canonical app record projected into Social after the app's moderation workflow. */
|
|
2686
|
+
interface SocialContentProjectionInput {
|
|
2687
|
+
author_user_id: string;
|
|
2688
|
+
source_kind: string;
|
|
2689
|
+
source_id: string;
|
|
2690
|
+
distribution_state: 'published' | 'hidden' | 'unpublished' | 'moderated_removed' | 'deleted';
|
|
2691
|
+
access_policy?: 'public' | 'followers' | 'premium' | 'private' | 'subscribers';
|
|
2692
|
+
content_type?: 'image' | 'video' | 'audio' | 'mixed' | 'text';
|
|
2693
|
+
preview_mode?: 'clear' | 'blurred' | 'none';
|
|
2694
|
+
title?: string;
|
|
2695
|
+
caption?: string;
|
|
2696
|
+
preview_photo_id?: string;
|
|
2697
|
+
published_at?: string;
|
|
2698
|
+
}
|
|
2699
|
+
interface SocialContentProjection extends SocialContentProjectionInput {
|
|
2700
|
+
id: string;
|
|
2701
|
+
created_at: string;
|
|
2702
|
+
updated_at: string;
|
|
2703
|
+
}
|
|
2704
|
+
interface SocialDiscoveryCreatorInput {
|
|
2705
|
+
creator_user_id: string;
|
|
2706
|
+
username: string;
|
|
2707
|
+
display_name?: string;
|
|
2708
|
+
primary_category?: string;
|
|
2709
|
+
avatar_asset_ref?: string;
|
|
2710
|
+
is_discoverable: boolean;
|
|
2711
|
+
}
|
|
2679
2712
|
interface Comment {
|
|
2680
2713
|
id: string;
|
|
2681
2714
|
post_id: string;
|
|
@@ -2733,6 +2766,9 @@ interface ViewState {
|
|
|
2733
2766
|
}
|
|
2734
2767
|
declare class SocialService extends ServiceModule {
|
|
2735
2768
|
protected basePath: string;
|
|
2769
|
+
/** Client API-key route; never send an internal platform token from an app. */
|
|
2770
|
+
upsertContentPost(input: SocialContentProjectionInput, options?: RequestOptions): Promise<ApiResponse<SocialContentProjection>>;
|
|
2771
|
+
upsertDiscoveryCreator(input: SocialDiscoveryCreatorInput, options?: RequestOptions): Promise<ApiResponse<unknown>>;
|
|
2736
2772
|
follow(userId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
2737
2773
|
followed: boolean;
|
|
2738
2774
|
}>>;
|
|
@@ -7769,4 +7805,4 @@ declare class ScaleMule {
|
|
|
7769
7805
|
getClient(): ScaleMuleClient;
|
|
7770
7806
|
}
|
|
7771
7807
|
|
|
7772
|
-
export { type AcceptQuoteInput, 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 AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, 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 CreatePollInput, type CreateQuoteInput, 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 CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, 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 Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, 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 Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, 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 UpdatePollInput, 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, pollSharePercent, pollVoterKey, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
7808
|
+
export { type AcceptQuoteInput, 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 AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, 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 CreatePollInput, type CreateQuoteInput, 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 CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, 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 Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, 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 Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, 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 SocialContentProjection, type SocialContentProjectionInput, type SocialDiscoveryCreatorInput, 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 UpdatePollInput, 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, pollSharePercent, pollVoterKey, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.js
CHANGED
|
@@ -830,6 +830,7 @@ var ScaleMuleClient = class {
|
|
|
830
830
|
this.apiKey = config.apiKey;
|
|
831
831
|
this.applicationId = config.applicationId || null;
|
|
832
832
|
this.baseUrl = config.baseUrl || GATEWAY_URLS[config.environment || "prod"];
|
|
833
|
+
this.realtimeUrl = config.realtimeUrl;
|
|
833
834
|
this.debug = config.debug || false;
|
|
834
835
|
this.storage = config.storage || createDefaultStorage();
|
|
835
836
|
this.defaultTimeout = config.timeout || DEFAULT_TIMEOUT;
|
|
@@ -1122,6 +1123,12 @@ var ScaleMuleClient = class {
|
|
|
1122
1123
|
getBaseUrl() {
|
|
1123
1124
|
return this.baseUrl;
|
|
1124
1125
|
}
|
|
1126
|
+
getRealtimeUrl() {
|
|
1127
|
+
return this.realtimeUrl || this.baseUrl;
|
|
1128
|
+
}
|
|
1129
|
+
requiresRealtimeTicket() {
|
|
1130
|
+
return this.realtimeUrl !== void 0;
|
|
1131
|
+
}
|
|
1125
1132
|
getApiKey() {
|
|
1126
1133
|
return this.apiKey;
|
|
1127
1134
|
}
|
|
@@ -4322,6 +4329,7 @@ var RealtimeService = class extends ServiceModule {
|
|
|
4322
4329
|
}
|
|
4323
4330
|
async fetchTicketAndConnect() {
|
|
4324
4331
|
const baseUrl = this.client.getBaseUrl();
|
|
4332
|
+
const realtimeUrl = this.client.getRealtimeUrl();
|
|
4325
4333
|
try {
|
|
4326
4334
|
const headers = { "Content-Type": "application/json" };
|
|
4327
4335
|
const apiKey = this.client.getApiKey();
|
|
@@ -4344,10 +4352,12 @@ var RealtimeService = class extends ServiceModule {
|
|
|
4344
4352
|
if (ticketRes.ok) {
|
|
4345
4353
|
const ticketData = await ticketRes.json();
|
|
4346
4354
|
const ticket = ticketData.ticket;
|
|
4347
|
-
|
|
4355
|
+
if (typeof ticket !== "string" || !ticket) throw new Error("Missing realtime ticket");
|
|
4356
|
+
wsUrl = realtimeUrl.replace(/^http/, "ws") + `/v1/realtime/ws?ticket=${encodeURIComponent(ticket)}`;
|
|
4348
4357
|
this.usedTicketAuth = true;
|
|
4349
4358
|
} else {
|
|
4350
|
-
|
|
4359
|
+
if (this.client.requiresRealtimeTicket()) throw new Error("Realtime ticket required");
|
|
4360
|
+
wsUrl = realtimeUrl.replace(/^http/, "ws") + "/v1/realtime/ws";
|
|
4351
4361
|
this.usedTicketAuth = false;
|
|
4352
4362
|
}
|
|
4353
4363
|
this.ws = new WebSocket(wsUrl);
|
|
@@ -5156,6 +5166,13 @@ var SocialService = class extends ServiceModule {
|
|
|
5156
5166
|
super(...arguments);
|
|
5157
5167
|
this.basePath = "/v1/social";
|
|
5158
5168
|
}
|
|
5169
|
+
/** Client API-key route; never send an internal platform token from an app. */
|
|
5170
|
+
async upsertContentPost(input, options) {
|
|
5171
|
+
return this.post("/client/content-posts/upsert", input, options);
|
|
5172
|
+
}
|
|
5173
|
+
async upsertDiscoveryCreator(input, options) {
|
|
5174
|
+
return this.post("/client/discovery/creators/upsert", input, options);
|
|
5175
|
+
}
|
|
5159
5176
|
// --------------------------------------------------------------------------
|
|
5160
5177
|
// Follow / Unfollow
|
|
5161
5178
|
// --------------------------------------------------------------------------
|
package/dist/index.mjs
CHANGED
|
@@ -721,6 +721,7 @@ var ScaleMuleClient = class {
|
|
|
721
721
|
this.apiKey = config.apiKey;
|
|
722
722
|
this.applicationId = config.applicationId || null;
|
|
723
723
|
this.baseUrl = config.baseUrl || GATEWAY_URLS[config.environment || "prod"];
|
|
724
|
+
this.realtimeUrl = config.realtimeUrl;
|
|
724
725
|
this.debug = config.debug || false;
|
|
725
726
|
this.storage = config.storage || createDefaultStorage();
|
|
726
727
|
this.defaultTimeout = config.timeout || DEFAULT_TIMEOUT;
|
|
@@ -1013,6 +1014,12 @@ var ScaleMuleClient = class {
|
|
|
1013
1014
|
getBaseUrl() {
|
|
1014
1015
|
return this.baseUrl;
|
|
1015
1016
|
}
|
|
1017
|
+
getRealtimeUrl() {
|
|
1018
|
+
return this.realtimeUrl || this.baseUrl;
|
|
1019
|
+
}
|
|
1020
|
+
requiresRealtimeTicket() {
|
|
1021
|
+
return this.realtimeUrl !== void 0;
|
|
1022
|
+
}
|
|
1016
1023
|
getApiKey() {
|
|
1017
1024
|
return this.apiKey;
|
|
1018
1025
|
}
|
|
@@ -4213,6 +4220,7 @@ var RealtimeService = class extends ServiceModule {
|
|
|
4213
4220
|
}
|
|
4214
4221
|
async fetchTicketAndConnect() {
|
|
4215
4222
|
const baseUrl = this.client.getBaseUrl();
|
|
4223
|
+
const realtimeUrl = this.client.getRealtimeUrl();
|
|
4216
4224
|
try {
|
|
4217
4225
|
const headers = { "Content-Type": "application/json" };
|
|
4218
4226
|
const apiKey = this.client.getApiKey();
|
|
@@ -4235,10 +4243,12 @@ var RealtimeService = class extends ServiceModule {
|
|
|
4235
4243
|
if (ticketRes.ok) {
|
|
4236
4244
|
const ticketData = await ticketRes.json();
|
|
4237
4245
|
const ticket = ticketData.ticket;
|
|
4238
|
-
|
|
4246
|
+
if (typeof ticket !== "string" || !ticket) throw new Error("Missing realtime ticket");
|
|
4247
|
+
wsUrl = realtimeUrl.replace(/^http/, "ws") + `/v1/realtime/ws?ticket=${encodeURIComponent(ticket)}`;
|
|
4239
4248
|
this.usedTicketAuth = true;
|
|
4240
4249
|
} else {
|
|
4241
|
-
|
|
4250
|
+
if (this.client.requiresRealtimeTicket()) throw new Error("Realtime ticket required");
|
|
4251
|
+
wsUrl = realtimeUrl.replace(/^http/, "ws") + "/v1/realtime/ws";
|
|
4242
4252
|
this.usedTicketAuth = false;
|
|
4243
4253
|
}
|
|
4244
4254
|
this.ws = new WebSocket(wsUrl);
|
|
@@ -5047,6 +5057,13 @@ var SocialService = class extends ServiceModule {
|
|
|
5047
5057
|
super(...arguments);
|
|
5048
5058
|
this.basePath = "/v1/social";
|
|
5049
5059
|
}
|
|
5060
|
+
/** Client API-key route; never send an internal platform token from an app. */
|
|
5061
|
+
async upsertContentPost(input, options) {
|
|
5062
|
+
return this.post("/client/content-posts/upsert", input, options);
|
|
5063
|
+
}
|
|
5064
|
+
async upsertDiscoveryCreator(input, options) {
|
|
5065
|
+
return this.post("/client/discovery/creators/upsert", input, options);
|
|
5066
|
+
}
|
|
5050
5067
|
// --------------------------------------------------------------------------
|
|
5051
5068
|
// Follow / Unfollow
|
|
5052
5069
|
// --------------------------------------------------------------------------
|