@scalemule/sdk 0.0.55 → 0.0.57

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
@@ -4687,6 +4687,17 @@ interface TransformResult {
4687
4687
  height: number;
4688
4688
  format: string;
4689
4689
  }
4690
+ type PhotoPreset = 'hero' | 'inline' | 'thumbnail' | 'avatar' | 'logo';
4691
+ interface PhotoManifest {
4692
+ file_id: string;
4693
+ photo_id: string;
4694
+ content_type: string;
4695
+ preset: PhotoPreset | 'original';
4696
+ ready: boolean;
4697
+ variants: Record<string, string>;
4698
+ srcset: string | null;
4699
+ default: string | null;
4700
+ }
4690
4701
  /** Options for building a transform URL or requesting a transform */
4691
4702
  interface TransformOptions {
4692
4703
  width?: number;
@@ -4745,6 +4756,15 @@ declare class PhotoService extends ServiceModule {
4745
4756
  delete(id: string, options?: RequestOptions): Promise<ApiResponse<{
4746
4757
  deleted: boolean;
4747
4758
  }>>;
4759
+ getPresets(options?: RequestOptions): Promise<ApiResponse<Record<PhotoPreset, {
4760
+ widths: number[];
4761
+ }>>>;
4762
+ getManifest(id: string, params?: {
4763
+ preset?: PhotoPreset;
4764
+ }, options?: RequestOptions): Promise<ApiResponse<PhotoManifest>>;
4765
+ getPublicManifest(id: string, params?: {
4766
+ preset?: PhotoPreset;
4767
+ }, options?: RequestOptions): Promise<ApiResponse<PhotoManifest>>;
4748
4768
  /**
4749
4769
  * Build an absolute URL for the on-demand transform endpoint.
4750
4770
  *
@@ -4970,6 +4990,119 @@ declare class AudioService extends ServiceModule {
4970
4990
  }, requestOptions?: RequestOptions): Promise<ApiResponse<AudioUploadViaStorageResult>>;
4971
4991
  }
4972
4992
 
4993
+ type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'other';
4994
+ type MediaPreset = 'hero' | 'inline' | 'thumbnail' | 'avatar' | 'logo' | 'custom';
4995
+ type MediaUploadPhase = 'presigning' | 'uploading' | 'scanning' | 'optimizing' | 'ready';
4996
+ interface MediaUploadEvent {
4997
+ phase: MediaUploadPhase;
4998
+ progress?: number;
4999
+ file_id?: string;
5000
+ }
5001
+ interface MediaPresetSpec {
5002
+ widths: readonly number[];
5003
+ fit?: 'cover' | 'contain';
5004
+ }
5005
+ declare const MEDIA_PRESETS: {
5006
+ readonly hero: {
5007
+ readonly widths: readonly [400, 800, 1200, 1600, 2400];
5008
+ };
5009
+ readonly inline: {
5010
+ readonly widths: readonly [400, 800, 1200];
5011
+ };
5012
+ readonly thumbnail: {
5013
+ readonly widths: readonly [120, 240, 360];
5014
+ readonly fit: "cover";
5015
+ };
5016
+ readonly avatar: {
5017
+ readonly widths: readonly [64, 128, 256];
5018
+ readonly fit: "cover";
5019
+ };
5020
+ readonly logo: {
5021
+ readonly widths: readonly [120, 240, 480];
5022
+ };
5023
+ };
5024
+ interface MediaManifest {
5025
+ file_id: string;
5026
+ content_type: string;
5027
+ preset: MediaPreset | 'original';
5028
+ ready?: boolean;
5029
+ variants: Record<string, string>;
5030
+ srcset: string | null;
5031
+ default: string | null;
5032
+ }
5033
+ interface MediaAsset {
5034
+ file_id: string;
5035
+ photo_id: string | null;
5036
+ filename: string;
5037
+ content_type: string;
5038
+ size_bytes: number;
5039
+ kind: MediaKind;
5040
+ visibility: Visibility;
5041
+ is_public: boolean;
5042
+ scan_status?: string;
5043
+ created_at: string;
5044
+ original_url: string | null;
5045
+ cdn_url: string | null;
5046
+ manifest: MediaManifest | null;
5047
+ }
5048
+ interface MediaUploadResult {
5049
+ file_id: string;
5050
+ photo_id: string | null;
5051
+ original_view_url: string | null;
5052
+ optimized_url_promise: Promise<string | null>;
5053
+ hls_url_promise: Promise<string | null>;
5054
+ mime_type: string;
5055
+ is_public: boolean;
5056
+ visibility: Visibility;
5057
+ cdn_url: string | null;
5058
+ asset: MediaAsset;
5059
+ }
5060
+ interface MediaUploadOptions {
5061
+ visibility?: Visibility;
5062
+ isPublic?: boolean;
5063
+ policy?: MediaPolicy;
5064
+ filename?: string;
5065
+ metadata?: Record<string, unknown>;
5066
+ preset?: MediaPreset;
5067
+ customWidths?: number[];
5068
+ prewarm?: boolean;
5069
+ onProgress?: (event: MediaUploadEvent) => void;
5070
+ signal?: AbortSignal;
5071
+ skipPhotoRegister?: boolean;
5072
+ }
5073
+ interface MediaManifestOptions {
5074
+ preset?: MediaPreset;
5075
+ customWidths?: number[];
5076
+ }
5077
+ declare class MediaService extends ServiceModule {
5078
+ private readonly storage;
5079
+ private readonly photo;
5080
+ private readonly video;
5081
+ private readonly audio;
5082
+ protected basePath: string;
5083
+ constructor(client: ScaleMuleClient, storage: StorageService, photo: PhotoService, video: VideoService, audio: AudioService);
5084
+ getPresets(): Record<Exclude<MediaPreset, 'custom'>, MediaPresetSpec>;
5085
+ upload(file: File | Blob, options?: MediaUploadOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaUploadResult>>;
5086
+ get(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
5087
+ list(params?: PaginationParams & MediaManifestOptions, requestOptions?: RequestOptions): Promise<PaginatedResponse<MediaAsset>>;
5088
+ delete(fileId: string, options?: RequestOptions): Promise<ApiResponse<{
5089
+ deleted: boolean;
5090
+ }>>;
5091
+ releaseQuarantine(fileId: string, reason?: string, options?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
5092
+ getManifest(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaManifest>>;
5093
+ buildAsset(file: FileInfo, options?: MediaManifestOptions & {
5094
+ photoId?: string | null;
5095
+ }, manifest?: MediaManifest | null): MediaAsset;
5096
+ buildManifest(file: FileInfo, options?: MediaManifestOptions): MediaManifest | null;
5097
+ private uploadAnonymous;
5098
+ private uploadImage;
5099
+ private waitForAnonymousReady;
5100
+ private fetchInfoBestEffort;
5101
+ private fetchManifest;
5102
+ private pollPhotoOptimizationComplete;
5103
+ private waitForAnonymousManifest;
5104
+ }
5105
+
4973
5106
  type TtsAccessMode = 'owner_private' | 'tenant_shared' | 'public';
4974
5107
  type TtsSpeechProfile = 'private_default' | 'developer_summary' | 'public_blog' | 'enterprise_strict';
4975
5108
  interface TtsAudioInfo {
@@ -6785,6 +6918,7 @@ declare class ScaleMule {
6785
6918
  readonly events: EventsService;
6786
6919
  readonly graph: GraphService;
6787
6920
  readonly functions: FunctionsService;
6921
+ readonly media: MediaService;
6788
6922
  readonly photo: PhotoService;
6789
6923
  readonly audio: AudioService;
6790
6924
  readonly tts: TtsService;
@@ -6862,4 +6996,4 @@ declare class ScaleMule {
6862
6996
  getClient(): ScaleMuleClient;
6863
6997
  }
6864
6998
 
6865
- 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, 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, type MediaPolicy, 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, 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 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, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
6999
+ 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, 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, 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 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, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
package/dist/index.d.ts CHANGED
@@ -4687,6 +4687,17 @@ interface TransformResult {
4687
4687
  height: number;
4688
4688
  format: string;
4689
4689
  }
4690
+ type PhotoPreset = 'hero' | 'inline' | 'thumbnail' | 'avatar' | 'logo';
4691
+ interface PhotoManifest {
4692
+ file_id: string;
4693
+ photo_id: string;
4694
+ content_type: string;
4695
+ preset: PhotoPreset | 'original';
4696
+ ready: boolean;
4697
+ variants: Record<string, string>;
4698
+ srcset: string | null;
4699
+ default: string | null;
4700
+ }
4690
4701
  /** Options for building a transform URL or requesting a transform */
4691
4702
  interface TransformOptions {
4692
4703
  width?: number;
@@ -4745,6 +4756,15 @@ declare class PhotoService extends ServiceModule {
4745
4756
  delete(id: string, options?: RequestOptions): Promise<ApiResponse<{
4746
4757
  deleted: boolean;
4747
4758
  }>>;
4759
+ getPresets(options?: RequestOptions): Promise<ApiResponse<Record<PhotoPreset, {
4760
+ widths: number[];
4761
+ }>>>;
4762
+ getManifest(id: string, params?: {
4763
+ preset?: PhotoPreset;
4764
+ }, options?: RequestOptions): Promise<ApiResponse<PhotoManifest>>;
4765
+ getPublicManifest(id: string, params?: {
4766
+ preset?: PhotoPreset;
4767
+ }, options?: RequestOptions): Promise<ApiResponse<PhotoManifest>>;
4748
4768
  /**
4749
4769
  * Build an absolute URL for the on-demand transform endpoint.
4750
4770
  *
@@ -4970,6 +4990,119 @@ declare class AudioService extends ServiceModule {
4970
4990
  }, requestOptions?: RequestOptions): Promise<ApiResponse<AudioUploadViaStorageResult>>;
4971
4991
  }
4972
4992
 
4993
+ type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'other';
4994
+ type MediaPreset = 'hero' | 'inline' | 'thumbnail' | 'avatar' | 'logo' | 'custom';
4995
+ type MediaUploadPhase = 'presigning' | 'uploading' | 'scanning' | 'optimizing' | 'ready';
4996
+ interface MediaUploadEvent {
4997
+ phase: MediaUploadPhase;
4998
+ progress?: number;
4999
+ file_id?: string;
5000
+ }
5001
+ interface MediaPresetSpec {
5002
+ widths: readonly number[];
5003
+ fit?: 'cover' | 'contain';
5004
+ }
5005
+ declare const MEDIA_PRESETS: {
5006
+ readonly hero: {
5007
+ readonly widths: readonly [400, 800, 1200, 1600, 2400];
5008
+ };
5009
+ readonly inline: {
5010
+ readonly widths: readonly [400, 800, 1200];
5011
+ };
5012
+ readonly thumbnail: {
5013
+ readonly widths: readonly [120, 240, 360];
5014
+ readonly fit: "cover";
5015
+ };
5016
+ readonly avatar: {
5017
+ readonly widths: readonly [64, 128, 256];
5018
+ readonly fit: "cover";
5019
+ };
5020
+ readonly logo: {
5021
+ readonly widths: readonly [120, 240, 480];
5022
+ };
5023
+ };
5024
+ interface MediaManifest {
5025
+ file_id: string;
5026
+ content_type: string;
5027
+ preset: MediaPreset | 'original';
5028
+ ready?: boolean;
5029
+ variants: Record<string, string>;
5030
+ srcset: string | null;
5031
+ default: string | null;
5032
+ }
5033
+ interface MediaAsset {
5034
+ file_id: string;
5035
+ photo_id: string | null;
5036
+ filename: string;
5037
+ content_type: string;
5038
+ size_bytes: number;
5039
+ kind: MediaKind;
5040
+ visibility: Visibility;
5041
+ is_public: boolean;
5042
+ scan_status?: string;
5043
+ created_at: string;
5044
+ original_url: string | null;
5045
+ cdn_url: string | null;
5046
+ manifest: MediaManifest | null;
5047
+ }
5048
+ interface MediaUploadResult {
5049
+ file_id: string;
5050
+ photo_id: string | null;
5051
+ original_view_url: string | null;
5052
+ optimized_url_promise: Promise<string | null>;
5053
+ hls_url_promise: Promise<string | null>;
5054
+ mime_type: string;
5055
+ is_public: boolean;
5056
+ visibility: Visibility;
5057
+ cdn_url: string | null;
5058
+ asset: MediaAsset;
5059
+ }
5060
+ interface MediaUploadOptions {
5061
+ visibility?: Visibility;
5062
+ isPublic?: boolean;
5063
+ policy?: MediaPolicy;
5064
+ filename?: string;
5065
+ metadata?: Record<string, unknown>;
5066
+ preset?: MediaPreset;
5067
+ customWidths?: number[];
5068
+ prewarm?: boolean;
5069
+ onProgress?: (event: MediaUploadEvent) => void;
5070
+ signal?: AbortSignal;
5071
+ skipPhotoRegister?: boolean;
5072
+ }
5073
+ interface MediaManifestOptions {
5074
+ preset?: MediaPreset;
5075
+ customWidths?: number[];
5076
+ }
5077
+ declare class MediaService extends ServiceModule {
5078
+ private readonly storage;
5079
+ private readonly photo;
5080
+ private readonly video;
5081
+ private readonly audio;
5082
+ protected basePath: string;
5083
+ constructor(client: ScaleMuleClient, storage: StorageService, photo: PhotoService, video: VideoService, audio: AudioService);
5084
+ getPresets(): Record<Exclude<MediaPreset, 'custom'>, MediaPresetSpec>;
5085
+ upload(file: File | Blob, options?: MediaUploadOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaUploadResult>>;
5086
+ get(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
5087
+ list(params?: PaginationParams & MediaManifestOptions, requestOptions?: RequestOptions): Promise<PaginatedResponse<MediaAsset>>;
5088
+ delete(fileId: string, options?: RequestOptions): Promise<ApiResponse<{
5089
+ deleted: boolean;
5090
+ }>>;
5091
+ releaseQuarantine(fileId: string, reason?: string, options?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
5092
+ getManifest(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaManifest>>;
5093
+ buildAsset(file: FileInfo, options?: MediaManifestOptions & {
5094
+ photoId?: string | null;
5095
+ }, manifest?: MediaManifest | null): MediaAsset;
5096
+ buildManifest(file: FileInfo, options?: MediaManifestOptions): MediaManifest | null;
5097
+ private uploadAnonymous;
5098
+ private uploadImage;
5099
+ private waitForAnonymousReady;
5100
+ private fetchInfoBestEffort;
5101
+ private fetchManifest;
5102
+ private pollPhotoOptimizationComplete;
5103
+ private waitForAnonymousManifest;
5104
+ }
5105
+
4973
5106
  type TtsAccessMode = 'owner_private' | 'tenant_shared' | 'public';
4974
5107
  type TtsSpeechProfile = 'private_default' | 'developer_summary' | 'public_blog' | 'enterprise_strict';
4975
5108
  interface TtsAudioInfo {
@@ -6785,6 +6918,7 @@ declare class ScaleMule {
6785
6918
  readonly events: EventsService;
6786
6919
  readonly graph: GraphService;
6787
6920
  readonly functions: FunctionsService;
6921
+ readonly media: MediaService;
6788
6922
  readonly photo: PhotoService;
6789
6923
  readonly audio: AudioService;
6790
6924
  readonly tts: TtsService;
@@ -6862,4 +6996,4 @@ declare class ScaleMule {
6862
6996
  getClient(): ScaleMuleClient;
6863
6997
  }
6864
6998
 
6865
- 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, 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, type MediaPolicy, 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, 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 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, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
6999
+ 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, 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, 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 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, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };