@scalemule/sdk 0.0.55 → 0.0.56
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 +113 -1
- package/dist/index.d.ts +113 -1
- package/dist/index.js +564 -0
- package/dist/index.mjs +562 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4970,6 +4970,117 @@ declare class AudioService extends ServiceModule {
|
|
|
4970
4970
|
}, requestOptions?: RequestOptions): Promise<ApiResponse<AudioUploadViaStorageResult>>;
|
|
4971
4971
|
}
|
|
4972
4972
|
|
|
4973
|
+
type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'other';
|
|
4974
|
+
type MediaPreset = 'hero' | 'inline' | 'thumbnail' | 'avatar' | 'logo' | 'custom';
|
|
4975
|
+
type MediaUploadPhase = 'presigning' | 'uploading' | 'scanning' | 'optimizing' | 'ready';
|
|
4976
|
+
interface MediaUploadEvent {
|
|
4977
|
+
phase: MediaUploadPhase;
|
|
4978
|
+
progress?: number;
|
|
4979
|
+
file_id?: string;
|
|
4980
|
+
}
|
|
4981
|
+
interface MediaPresetSpec {
|
|
4982
|
+
widths: readonly number[];
|
|
4983
|
+
fit?: 'cover' | 'contain';
|
|
4984
|
+
}
|
|
4985
|
+
declare const MEDIA_PRESETS: {
|
|
4986
|
+
readonly hero: {
|
|
4987
|
+
readonly widths: readonly [400, 800, 1200, 1600, 2400];
|
|
4988
|
+
};
|
|
4989
|
+
readonly inline: {
|
|
4990
|
+
readonly widths: readonly [400, 800, 1200];
|
|
4991
|
+
};
|
|
4992
|
+
readonly thumbnail: {
|
|
4993
|
+
readonly widths: readonly [120, 240, 360];
|
|
4994
|
+
readonly fit: "cover";
|
|
4995
|
+
};
|
|
4996
|
+
readonly avatar: {
|
|
4997
|
+
readonly widths: readonly [64, 128, 256];
|
|
4998
|
+
readonly fit: "cover";
|
|
4999
|
+
};
|
|
5000
|
+
readonly logo: {
|
|
5001
|
+
readonly widths: readonly [120, 240, 480];
|
|
5002
|
+
};
|
|
5003
|
+
};
|
|
5004
|
+
interface MediaManifest {
|
|
5005
|
+
file_id: string;
|
|
5006
|
+
content_type: string;
|
|
5007
|
+
preset: MediaPreset | 'original';
|
|
5008
|
+
variants: Record<string, string>;
|
|
5009
|
+
srcset: string | null;
|
|
5010
|
+
default: string | null;
|
|
5011
|
+
}
|
|
5012
|
+
interface MediaAsset {
|
|
5013
|
+
file_id: string;
|
|
5014
|
+
photo_id: string | null;
|
|
5015
|
+
filename: string;
|
|
5016
|
+
content_type: string;
|
|
5017
|
+
size_bytes: number;
|
|
5018
|
+
kind: MediaKind;
|
|
5019
|
+
visibility: Visibility;
|
|
5020
|
+
is_public: boolean;
|
|
5021
|
+
scan_status?: string;
|
|
5022
|
+
created_at: string;
|
|
5023
|
+
original_url: string | null;
|
|
5024
|
+
cdn_url: string | null;
|
|
5025
|
+
manifest: MediaManifest | null;
|
|
5026
|
+
}
|
|
5027
|
+
interface MediaUploadResult {
|
|
5028
|
+
file_id: string;
|
|
5029
|
+
photo_id: string | null;
|
|
5030
|
+
original_view_url: string | null;
|
|
5031
|
+
optimized_url_promise: Promise<string | null>;
|
|
5032
|
+
hls_url_promise: Promise<string | null>;
|
|
5033
|
+
mime_type: string;
|
|
5034
|
+
is_public: boolean;
|
|
5035
|
+
visibility: Visibility;
|
|
5036
|
+
cdn_url: string | null;
|
|
5037
|
+
asset: MediaAsset;
|
|
5038
|
+
}
|
|
5039
|
+
interface MediaUploadOptions {
|
|
5040
|
+
visibility?: Visibility;
|
|
5041
|
+
isPublic?: boolean;
|
|
5042
|
+
policy?: MediaPolicy;
|
|
5043
|
+
filename?: string;
|
|
5044
|
+
metadata?: Record<string, unknown>;
|
|
5045
|
+
preset?: MediaPreset;
|
|
5046
|
+
customWidths?: number[];
|
|
5047
|
+
prewarm?: boolean;
|
|
5048
|
+
onProgress?: (event: MediaUploadEvent) => void;
|
|
5049
|
+
signal?: AbortSignal;
|
|
5050
|
+
skipPhotoRegister?: boolean;
|
|
5051
|
+
}
|
|
5052
|
+
interface MediaManifestOptions {
|
|
5053
|
+
preset?: MediaPreset;
|
|
5054
|
+
customWidths?: number[];
|
|
5055
|
+
}
|
|
5056
|
+
declare class MediaService extends ServiceModule {
|
|
5057
|
+
private readonly storage;
|
|
5058
|
+
private readonly photo;
|
|
5059
|
+
private readonly video;
|
|
5060
|
+
private readonly audio;
|
|
5061
|
+
protected basePath: string;
|
|
5062
|
+
constructor(client: ScaleMuleClient, storage: StorageService, photo: PhotoService, video: VideoService, audio: AudioService);
|
|
5063
|
+
getPresets(): Record<Exclude<MediaPreset, 'custom'>, MediaPresetSpec>;
|
|
5064
|
+
upload(file: File | Blob, options?: MediaUploadOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaUploadResult>>;
|
|
5065
|
+
get(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
|
|
5066
|
+
list(params?: PaginationParams & MediaManifestOptions, requestOptions?: RequestOptions): Promise<PaginatedResponse<MediaAsset>>;
|
|
5067
|
+
delete(fileId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
5068
|
+
deleted: boolean;
|
|
5069
|
+
}>>;
|
|
5070
|
+
releaseQuarantine(fileId: string, reason?: string, options?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
|
|
5071
|
+
getManifest(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaManifest>>;
|
|
5072
|
+
buildAsset(file: FileInfo, options?: MediaManifestOptions & {
|
|
5073
|
+
photoId?: string | null;
|
|
5074
|
+
}): MediaAsset;
|
|
5075
|
+
buildManifest(file: FileInfo, options?: MediaManifestOptions): MediaManifest | null;
|
|
5076
|
+
private uploadAnonymous;
|
|
5077
|
+
private uploadImage;
|
|
5078
|
+
private waitForAnonymousReady;
|
|
5079
|
+
private fetchInfoBestEffort;
|
|
5080
|
+
private pollPhotoOptimizationComplete;
|
|
5081
|
+
private prewarmManifest;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
4973
5084
|
type TtsAccessMode = 'owner_private' | 'tenant_shared' | 'public';
|
|
4974
5085
|
type TtsSpeechProfile = 'private_default' | 'developer_summary' | 'public_blog' | 'enterprise_strict';
|
|
4975
5086
|
interface TtsAudioInfo {
|
|
@@ -6785,6 +6896,7 @@ declare class ScaleMule {
|
|
|
6785
6896
|
readonly events: EventsService;
|
|
6786
6897
|
readonly graph: GraphService;
|
|
6787
6898
|
readonly functions: FunctionsService;
|
|
6899
|
+
readonly media: MediaService;
|
|
6788
6900
|
readonly photo: PhotoService;
|
|
6789
6901
|
readonly audio: AudioService;
|
|
6790
6902
|
readonly tts: TtsService;
|
|
@@ -6862,4 +6974,4 @@ declare class ScaleMule {
|
|
|
6862
6974
|
getClient(): ScaleMuleClient;
|
|
6863
6975
|
}
|
|
6864
6976
|
|
|
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 };
|
|
6977
|
+
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
|
@@ -4970,6 +4970,117 @@ declare class AudioService extends ServiceModule {
|
|
|
4970
4970
|
}, requestOptions?: RequestOptions): Promise<ApiResponse<AudioUploadViaStorageResult>>;
|
|
4971
4971
|
}
|
|
4972
4972
|
|
|
4973
|
+
type MediaKind = 'image' | 'video' | 'audio' | 'document' | 'other';
|
|
4974
|
+
type MediaPreset = 'hero' | 'inline' | 'thumbnail' | 'avatar' | 'logo' | 'custom';
|
|
4975
|
+
type MediaUploadPhase = 'presigning' | 'uploading' | 'scanning' | 'optimizing' | 'ready';
|
|
4976
|
+
interface MediaUploadEvent {
|
|
4977
|
+
phase: MediaUploadPhase;
|
|
4978
|
+
progress?: number;
|
|
4979
|
+
file_id?: string;
|
|
4980
|
+
}
|
|
4981
|
+
interface MediaPresetSpec {
|
|
4982
|
+
widths: readonly number[];
|
|
4983
|
+
fit?: 'cover' | 'contain';
|
|
4984
|
+
}
|
|
4985
|
+
declare const MEDIA_PRESETS: {
|
|
4986
|
+
readonly hero: {
|
|
4987
|
+
readonly widths: readonly [400, 800, 1200, 1600, 2400];
|
|
4988
|
+
};
|
|
4989
|
+
readonly inline: {
|
|
4990
|
+
readonly widths: readonly [400, 800, 1200];
|
|
4991
|
+
};
|
|
4992
|
+
readonly thumbnail: {
|
|
4993
|
+
readonly widths: readonly [120, 240, 360];
|
|
4994
|
+
readonly fit: "cover";
|
|
4995
|
+
};
|
|
4996
|
+
readonly avatar: {
|
|
4997
|
+
readonly widths: readonly [64, 128, 256];
|
|
4998
|
+
readonly fit: "cover";
|
|
4999
|
+
};
|
|
5000
|
+
readonly logo: {
|
|
5001
|
+
readonly widths: readonly [120, 240, 480];
|
|
5002
|
+
};
|
|
5003
|
+
};
|
|
5004
|
+
interface MediaManifest {
|
|
5005
|
+
file_id: string;
|
|
5006
|
+
content_type: string;
|
|
5007
|
+
preset: MediaPreset | 'original';
|
|
5008
|
+
variants: Record<string, string>;
|
|
5009
|
+
srcset: string | null;
|
|
5010
|
+
default: string | null;
|
|
5011
|
+
}
|
|
5012
|
+
interface MediaAsset {
|
|
5013
|
+
file_id: string;
|
|
5014
|
+
photo_id: string | null;
|
|
5015
|
+
filename: string;
|
|
5016
|
+
content_type: string;
|
|
5017
|
+
size_bytes: number;
|
|
5018
|
+
kind: MediaKind;
|
|
5019
|
+
visibility: Visibility;
|
|
5020
|
+
is_public: boolean;
|
|
5021
|
+
scan_status?: string;
|
|
5022
|
+
created_at: string;
|
|
5023
|
+
original_url: string | null;
|
|
5024
|
+
cdn_url: string | null;
|
|
5025
|
+
manifest: MediaManifest | null;
|
|
5026
|
+
}
|
|
5027
|
+
interface MediaUploadResult {
|
|
5028
|
+
file_id: string;
|
|
5029
|
+
photo_id: string | null;
|
|
5030
|
+
original_view_url: string | null;
|
|
5031
|
+
optimized_url_promise: Promise<string | null>;
|
|
5032
|
+
hls_url_promise: Promise<string | null>;
|
|
5033
|
+
mime_type: string;
|
|
5034
|
+
is_public: boolean;
|
|
5035
|
+
visibility: Visibility;
|
|
5036
|
+
cdn_url: string | null;
|
|
5037
|
+
asset: MediaAsset;
|
|
5038
|
+
}
|
|
5039
|
+
interface MediaUploadOptions {
|
|
5040
|
+
visibility?: Visibility;
|
|
5041
|
+
isPublic?: boolean;
|
|
5042
|
+
policy?: MediaPolicy;
|
|
5043
|
+
filename?: string;
|
|
5044
|
+
metadata?: Record<string, unknown>;
|
|
5045
|
+
preset?: MediaPreset;
|
|
5046
|
+
customWidths?: number[];
|
|
5047
|
+
prewarm?: boolean;
|
|
5048
|
+
onProgress?: (event: MediaUploadEvent) => void;
|
|
5049
|
+
signal?: AbortSignal;
|
|
5050
|
+
skipPhotoRegister?: boolean;
|
|
5051
|
+
}
|
|
5052
|
+
interface MediaManifestOptions {
|
|
5053
|
+
preset?: MediaPreset;
|
|
5054
|
+
customWidths?: number[];
|
|
5055
|
+
}
|
|
5056
|
+
declare class MediaService extends ServiceModule {
|
|
5057
|
+
private readonly storage;
|
|
5058
|
+
private readonly photo;
|
|
5059
|
+
private readonly video;
|
|
5060
|
+
private readonly audio;
|
|
5061
|
+
protected basePath: string;
|
|
5062
|
+
constructor(client: ScaleMuleClient, storage: StorageService, photo: PhotoService, video: VideoService, audio: AudioService);
|
|
5063
|
+
getPresets(): Record<Exclude<MediaPreset, 'custom'>, MediaPresetSpec>;
|
|
5064
|
+
upload(file: File | Blob, options?: MediaUploadOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaUploadResult>>;
|
|
5065
|
+
get(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
|
|
5066
|
+
list(params?: PaginationParams & MediaManifestOptions, requestOptions?: RequestOptions): Promise<PaginatedResponse<MediaAsset>>;
|
|
5067
|
+
delete(fileId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
5068
|
+
deleted: boolean;
|
|
5069
|
+
}>>;
|
|
5070
|
+
releaseQuarantine(fileId: string, reason?: string, options?: RequestOptions): Promise<ApiResponse<MediaAsset>>;
|
|
5071
|
+
getManifest(fileId: string, options?: MediaManifestOptions, requestOptions?: RequestOptions): Promise<ApiResponse<MediaManifest>>;
|
|
5072
|
+
buildAsset(file: FileInfo, options?: MediaManifestOptions & {
|
|
5073
|
+
photoId?: string | null;
|
|
5074
|
+
}): MediaAsset;
|
|
5075
|
+
buildManifest(file: FileInfo, options?: MediaManifestOptions): MediaManifest | null;
|
|
5076
|
+
private uploadAnonymous;
|
|
5077
|
+
private uploadImage;
|
|
5078
|
+
private waitForAnonymousReady;
|
|
5079
|
+
private fetchInfoBestEffort;
|
|
5080
|
+
private pollPhotoOptimizationComplete;
|
|
5081
|
+
private prewarmManifest;
|
|
5082
|
+
}
|
|
5083
|
+
|
|
4973
5084
|
type TtsAccessMode = 'owner_private' | 'tenant_shared' | 'public';
|
|
4974
5085
|
type TtsSpeechProfile = 'private_default' | 'developer_summary' | 'public_blog' | 'enterprise_strict';
|
|
4975
5086
|
interface TtsAudioInfo {
|
|
@@ -6785,6 +6896,7 @@ declare class ScaleMule {
|
|
|
6785
6896
|
readonly events: EventsService;
|
|
6786
6897
|
readonly graph: GraphService;
|
|
6787
6898
|
readonly functions: FunctionsService;
|
|
6899
|
+
readonly media: MediaService;
|
|
6788
6900
|
readonly photo: PhotoService;
|
|
6789
6901
|
readonly audio: AudioService;
|
|
6790
6902
|
readonly tts: TtsService;
|
|
@@ -6862,4 +6974,4 @@ declare class ScaleMule {
|
|
|
6862
6974
|
getClient(): ScaleMuleClient;
|
|
6863
6975
|
}
|
|
6864
6976
|
|
|
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 };
|
|
6977
|
+
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 };
|