@scalemule/sdk 0.0.42 → 0.0.43
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 +77 -1
- package/dist/index.d.ts +77 -1
- package/dist/index.js +71 -0
- package/dist/index.mjs +70 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -4594,6 +4594,81 @@ declare class PhotoService extends ServiceModule {
|
|
|
4594
4594
|
getPhoto(id: string): Promise<ApiResponse<PhotoInfo>>;
|
|
4595
4595
|
}
|
|
4596
4596
|
|
|
4597
|
+
/**
|
|
4598
|
+
* Audio service — typed wrapper over `/v1/audios`.
|
|
4599
|
+
*
|
|
4600
|
+
* Phase 5 MVP scope:
|
|
4601
|
+
* - `uploadViaStorage()` — presigned-direct-to-S3 upload + register flow,
|
|
4602
|
+
* mirrors `photo.uploadViaStorage()` and `video.uploadViaStorage()`.
|
|
4603
|
+
* - `register()` — explicitly register an already-uploaded storage file
|
|
4604
|
+
* with the audio service so it gets typed metadata + ownership.
|
|
4605
|
+
*
|
|
4606
|
+
* Out of scope today (future phases): waveform peaks, codec normalization,
|
|
4607
|
+
* derivative transcoding profiles. The audio service stores metadata; the
|
|
4608
|
+
* actual bytes live in scalemule-storage and are served via the storage
|
|
4609
|
+
* view URL. Once the audio worker ships, this service will gain a
|
|
4610
|
+
* `transcoded_url_promise` field analogous to photo's
|
|
4611
|
+
* `optimized_url_promise`.
|
|
4612
|
+
*/
|
|
4613
|
+
|
|
4614
|
+
/** Result of {@link AudioService.register}. */
|
|
4615
|
+
interface AudioRegisterResult {
|
|
4616
|
+
/** Audio service id. `audio_id == file_id` invariant holds. */
|
|
4617
|
+
audio_id: string;
|
|
4618
|
+
/** Storage file_id (same as `audio_id`). */
|
|
4619
|
+
file_id: string;
|
|
4620
|
+
/** `'ready'` once the audio row exists. The audio service's pipeline
|
|
4621
|
+
* is metadata-only today; bytes are immediately playable via the
|
|
4622
|
+
* storage view URL. */
|
|
4623
|
+
status: 'ready' | 'processing' | 'failed';
|
|
4624
|
+
}
|
|
4625
|
+
/** Result of {@link AudioService.uploadViaStorage}. */
|
|
4626
|
+
interface AudioUploadViaStorageResult {
|
|
4627
|
+
/** Storage file_id. */
|
|
4628
|
+
file_id: string;
|
|
4629
|
+
/** Audio service id (== file_id). `null` when register failed but the
|
|
4630
|
+
* storage upload succeeded — the file is still usable as a generic
|
|
4631
|
+
* private file. */
|
|
4632
|
+
audio_id: string | null;
|
|
4633
|
+
/** Short-lived signed URL to the original bytes. Usable immediately. */
|
|
4634
|
+
original_view_url: string | null;
|
|
4635
|
+
}
|
|
4636
|
+
declare class AudioService extends ServiceModule {
|
|
4637
|
+
private readonly storage;
|
|
4638
|
+
protected basePath: string;
|
|
4639
|
+
/**
|
|
4640
|
+
* @param storage Required for {@link uploadViaStorage}. Wired up by the
|
|
4641
|
+
* top-level {@link ScaleMule} constructor — most call sites should not
|
|
4642
|
+
* instantiate `AudioService` directly.
|
|
4643
|
+
*/
|
|
4644
|
+
constructor(client: ScaleMuleClient, storage: StorageService);
|
|
4645
|
+
/**
|
|
4646
|
+
* Register a storage-uploaded audio asset with the audio service.
|
|
4647
|
+
* Idempotent — re-calling with the same `file_id` returns the existing
|
|
4648
|
+
* record.
|
|
4649
|
+
*/
|
|
4650
|
+
register(args: {
|
|
4651
|
+
fileId: string;
|
|
4652
|
+
userId?: string;
|
|
4653
|
+
}, options?: RequestOptions): Promise<ApiResponse<AudioRegisterResult>>;
|
|
4654
|
+
/**
|
|
4655
|
+
* Upload a file to storage (browser → S3 direct, private, uncompressed)
|
|
4656
|
+
* and register it with the audio service.
|
|
4657
|
+
*
|
|
4658
|
+
* Mirrors `photo.uploadViaStorage()` / `video.uploadViaStorage()`. If
|
|
4659
|
+
* `register()` fails after a successful storage upload, the file is *not*
|
|
4660
|
+
* lost — the returned `file_id` is still valid as a generic private storage
|
|
4661
|
+
* file. The SDK logs a warning and returns `audio_id: null`.
|
|
4662
|
+
*/
|
|
4663
|
+
uploadViaStorage(file: File | Blob, uploadOptions?: {
|
|
4664
|
+
userId?: string;
|
|
4665
|
+
filename?: string;
|
|
4666
|
+
metadata?: Record<string, unknown>;
|
|
4667
|
+
onProgress?: (progress: number) => void;
|
|
4668
|
+
signal?: AbortSignal;
|
|
4669
|
+
}, requestOptions?: RequestOptions): Promise<ApiResponse<AudioUploadViaStorageResult>>;
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4597
4672
|
/**
|
|
4598
4673
|
* Queue Service Module
|
|
4599
4674
|
*
|
|
@@ -6318,6 +6393,7 @@ declare class ScaleMule {
|
|
|
6318
6393
|
readonly graph: GraphService;
|
|
6319
6394
|
readonly functions: FunctionsService;
|
|
6320
6395
|
readonly photo: PhotoService;
|
|
6396
|
+
readonly audio: AudioService;
|
|
6321
6397
|
readonly flagContent: FlagContentService;
|
|
6322
6398
|
readonly creatorMaker: CreatorMakerService;
|
|
6323
6399
|
readonly compliance: ComplianceService;
|
|
@@ -6392,4 +6468,4 @@ declare class ScaleMule {
|
|
|
6392
6468
|
getClient(): ScaleMuleClient;
|
|
6393
6469
|
}
|
|
6394
6470
|
|
|
6395
|
-
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 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 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 };
|
|
6471
|
+
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 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
|
@@ -4594,6 +4594,81 @@ declare class PhotoService extends ServiceModule {
|
|
|
4594
4594
|
getPhoto(id: string): Promise<ApiResponse<PhotoInfo>>;
|
|
4595
4595
|
}
|
|
4596
4596
|
|
|
4597
|
+
/**
|
|
4598
|
+
* Audio service — typed wrapper over `/v1/audios`.
|
|
4599
|
+
*
|
|
4600
|
+
* Phase 5 MVP scope:
|
|
4601
|
+
* - `uploadViaStorage()` — presigned-direct-to-S3 upload + register flow,
|
|
4602
|
+
* mirrors `photo.uploadViaStorage()` and `video.uploadViaStorage()`.
|
|
4603
|
+
* - `register()` — explicitly register an already-uploaded storage file
|
|
4604
|
+
* with the audio service so it gets typed metadata + ownership.
|
|
4605
|
+
*
|
|
4606
|
+
* Out of scope today (future phases): waveform peaks, codec normalization,
|
|
4607
|
+
* derivative transcoding profiles. The audio service stores metadata; the
|
|
4608
|
+
* actual bytes live in scalemule-storage and are served via the storage
|
|
4609
|
+
* view URL. Once the audio worker ships, this service will gain a
|
|
4610
|
+
* `transcoded_url_promise` field analogous to photo's
|
|
4611
|
+
* `optimized_url_promise`.
|
|
4612
|
+
*/
|
|
4613
|
+
|
|
4614
|
+
/** Result of {@link AudioService.register}. */
|
|
4615
|
+
interface AudioRegisterResult {
|
|
4616
|
+
/** Audio service id. `audio_id == file_id` invariant holds. */
|
|
4617
|
+
audio_id: string;
|
|
4618
|
+
/** Storage file_id (same as `audio_id`). */
|
|
4619
|
+
file_id: string;
|
|
4620
|
+
/** `'ready'` once the audio row exists. The audio service's pipeline
|
|
4621
|
+
* is metadata-only today; bytes are immediately playable via the
|
|
4622
|
+
* storage view URL. */
|
|
4623
|
+
status: 'ready' | 'processing' | 'failed';
|
|
4624
|
+
}
|
|
4625
|
+
/** Result of {@link AudioService.uploadViaStorage}. */
|
|
4626
|
+
interface AudioUploadViaStorageResult {
|
|
4627
|
+
/** Storage file_id. */
|
|
4628
|
+
file_id: string;
|
|
4629
|
+
/** Audio service id (== file_id). `null` when register failed but the
|
|
4630
|
+
* storage upload succeeded — the file is still usable as a generic
|
|
4631
|
+
* private file. */
|
|
4632
|
+
audio_id: string | null;
|
|
4633
|
+
/** Short-lived signed URL to the original bytes. Usable immediately. */
|
|
4634
|
+
original_view_url: string | null;
|
|
4635
|
+
}
|
|
4636
|
+
declare class AudioService extends ServiceModule {
|
|
4637
|
+
private readonly storage;
|
|
4638
|
+
protected basePath: string;
|
|
4639
|
+
/**
|
|
4640
|
+
* @param storage Required for {@link uploadViaStorage}. Wired up by the
|
|
4641
|
+
* top-level {@link ScaleMule} constructor — most call sites should not
|
|
4642
|
+
* instantiate `AudioService` directly.
|
|
4643
|
+
*/
|
|
4644
|
+
constructor(client: ScaleMuleClient, storage: StorageService);
|
|
4645
|
+
/**
|
|
4646
|
+
* Register a storage-uploaded audio asset with the audio service.
|
|
4647
|
+
* Idempotent — re-calling with the same `file_id` returns the existing
|
|
4648
|
+
* record.
|
|
4649
|
+
*/
|
|
4650
|
+
register(args: {
|
|
4651
|
+
fileId: string;
|
|
4652
|
+
userId?: string;
|
|
4653
|
+
}, options?: RequestOptions): Promise<ApiResponse<AudioRegisterResult>>;
|
|
4654
|
+
/**
|
|
4655
|
+
* Upload a file to storage (browser → S3 direct, private, uncompressed)
|
|
4656
|
+
* and register it with the audio service.
|
|
4657
|
+
*
|
|
4658
|
+
* Mirrors `photo.uploadViaStorage()` / `video.uploadViaStorage()`. If
|
|
4659
|
+
* `register()` fails after a successful storage upload, the file is *not*
|
|
4660
|
+
* lost — the returned `file_id` is still valid as a generic private storage
|
|
4661
|
+
* file. The SDK logs a warning and returns `audio_id: null`.
|
|
4662
|
+
*/
|
|
4663
|
+
uploadViaStorage(file: File | Blob, uploadOptions?: {
|
|
4664
|
+
userId?: string;
|
|
4665
|
+
filename?: string;
|
|
4666
|
+
metadata?: Record<string, unknown>;
|
|
4667
|
+
onProgress?: (progress: number) => void;
|
|
4668
|
+
signal?: AbortSignal;
|
|
4669
|
+
}, requestOptions?: RequestOptions): Promise<ApiResponse<AudioUploadViaStorageResult>>;
|
|
4670
|
+
}
|
|
4671
|
+
|
|
4597
4672
|
/**
|
|
4598
4673
|
* Queue Service Module
|
|
4599
4674
|
*
|
|
@@ -6318,6 +6393,7 @@ declare class ScaleMule {
|
|
|
6318
6393
|
readonly graph: GraphService;
|
|
6319
6394
|
readonly functions: FunctionsService;
|
|
6320
6395
|
readonly photo: PhotoService;
|
|
6396
|
+
readonly audio: AudioService;
|
|
6321
6397
|
readonly flagContent: FlagContentService;
|
|
6322
6398
|
readonly creatorMaker: CreatorMakerService;
|
|
6323
6399
|
readonly compliance: ComplianceService;
|
|
@@ -6392,4 +6468,4 @@ declare class ScaleMule {
|
|
|
6392
6468
|
getClient(): ScaleMuleClient;
|
|
6393
6469
|
}
|
|
6394
6470
|
|
|
6395
|
-
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 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 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 };
|
|
6471
|
+
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 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.js
CHANGED
|
@@ -301,6 +301,7 @@ __export(index_exports, {
|
|
|
301
301
|
AgentToolsService: () => AgentToolsService,
|
|
302
302
|
AgentsService: () => AgentsService,
|
|
303
303
|
AnalyticsService: () => AnalyticsService,
|
|
304
|
+
AudioService: () => AudioService,
|
|
304
305
|
AuthService: () => AuthService,
|
|
305
306
|
BillingService: () => BillingService,
|
|
306
307
|
CacheService: () => CacheService,
|
|
@@ -6476,6 +6477,74 @@ var PhotoService = class extends ServiceModule {
|
|
|
6476
6477
|
}
|
|
6477
6478
|
};
|
|
6478
6479
|
|
|
6480
|
+
// src/services/audio.ts
|
|
6481
|
+
var AudioService = class extends ServiceModule {
|
|
6482
|
+
/**
|
|
6483
|
+
* @param storage Required for {@link uploadViaStorage}. Wired up by the
|
|
6484
|
+
* top-level {@link ScaleMule} constructor — most call sites should not
|
|
6485
|
+
* instantiate `AudioService` directly.
|
|
6486
|
+
*/
|
|
6487
|
+
constructor(client, storage) {
|
|
6488
|
+
super(client);
|
|
6489
|
+
this.storage = storage;
|
|
6490
|
+
this.basePath = "/v1/audios";
|
|
6491
|
+
}
|
|
6492
|
+
/**
|
|
6493
|
+
* Register a storage-uploaded audio asset with the audio service.
|
|
6494
|
+
* Idempotent — re-calling with the same `file_id` returns the existing
|
|
6495
|
+
* record.
|
|
6496
|
+
*/
|
|
6497
|
+
async register(args, options) {
|
|
6498
|
+
return this.post("/register", { file_id: args.fileId, sm_user_id: args.userId }, options);
|
|
6499
|
+
}
|
|
6500
|
+
/**
|
|
6501
|
+
* Upload a file to storage (browser → S3 direct, private, uncompressed)
|
|
6502
|
+
* and register it with the audio service.
|
|
6503
|
+
*
|
|
6504
|
+
* Mirrors `photo.uploadViaStorage()` / `video.uploadViaStorage()`. If
|
|
6505
|
+
* `register()` fails after a successful storage upload, the file is *not*
|
|
6506
|
+
* lost — the returned `file_id` is still valid as a generic private storage
|
|
6507
|
+
* file. The SDK logs a warning and returns `audio_id: null`.
|
|
6508
|
+
*/
|
|
6509
|
+
async uploadViaStorage(file, uploadOptions, requestOptions) {
|
|
6510
|
+
const uploadResult = await this.storage.uploadPrivate(file, {
|
|
6511
|
+
filename: uploadOptions?.filename,
|
|
6512
|
+
metadata: uploadOptions?.metadata,
|
|
6513
|
+
onProgress: uploadOptions?.onProgress,
|
|
6514
|
+
signal: uploadOptions?.signal
|
|
6515
|
+
});
|
|
6516
|
+
if (uploadResult.error || !uploadResult.data) {
|
|
6517
|
+
return { data: null, error: uploadResult.error };
|
|
6518
|
+
}
|
|
6519
|
+
const fileInfo = uploadResult.data;
|
|
6520
|
+
const fileId = fileInfo.id;
|
|
6521
|
+
const originalViewUrl = fileInfo.url ?? null;
|
|
6522
|
+
const registerResult = await this.register({ fileId, userId: uploadOptions?.userId }, requestOptions);
|
|
6523
|
+
if (registerResult.error || !registerResult.data) {
|
|
6524
|
+
console.warn(
|
|
6525
|
+
"[scalemule-sdk] audio.register() failed after storage upload; typed audio metadata unavailable.",
|
|
6526
|
+
registerResult.error
|
|
6527
|
+
);
|
|
6528
|
+
return {
|
|
6529
|
+
data: {
|
|
6530
|
+
file_id: fileId,
|
|
6531
|
+
audio_id: null,
|
|
6532
|
+
original_view_url: originalViewUrl
|
|
6533
|
+
},
|
|
6534
|
+
error: null
|
|
6535
|
+
};
|
|
6536
|
+
}
|
|
6537
|
+
return {
|
|
6538
|
+
data: {
|
|
6539
|
+
file_id: fileId,
|
|
6540
|
+
audio_id: registerResult.data.audio_id,
|
|
6541
|
+
original_view_url: originalViewUrl
|
|
6542
|
+
},
|
|
6543
|
+
error: null
|
|
6544
|
+
};
|
|
6545
|
+
}
|
|
6546
|
+
};
|
|
6547
|
+
|
|
6479
6548
|
// src/services/queue.ts
|
|
6480
6549
|
var DeadLetterApi = class extends ServiceModule {
|
|
6481
6550
|
constructor() {
|
|
@@ -7326,6 +7395,7 @@ var ScaleMule = class {
|
|
|
7326
7395
|
this.graph = new GraphService(this._client);
|
|
7327
7396
|
this.functions = new FunctionsService(this._client);
|
|
7328
7397
|
this.photo = new PhotoService(this._client, this.storage);
|
|
7398
|
+
this.audio = new AudioService(this._client, this.storage);
|
|
7329
7399
|
this.flagContent = new FlagContentService(this._client);
|
|
7330
7400
|
this.creatorMaker = new CreatorMakerService(this._client);
|
|
7331
7401
|
this.compliance = new ComplianceService(this._client);
|
|
@@ -7469,6 +7539,7 @@ var index_default = ScaleMule;
|
|
|
7469
7539
|
AgentToolsService,
|
|
7470
7540
|
AgentsService,
|
|
7471
7541
|
AnalyticsService,
|
|
7542
|
+
AudioService,
|
|
7472
7543
|
AuthService,
|
|
7473
7544
|
BillingService,
|
|
7474
7545
|
CacheService,
|
package/dist/index.mjs
CHANGED
|
@@ -6104,6 +6104,74 @@ var PhotoService = class extends ServiceModule {
|
|
|
6104
6104
|
}
|
|
6105
6105
|
};
|
|
6106
6106
|
|
|
6107
|
+
// src/services/audio.ts
|
|
6108
|
+
var AudioService = class extends ServiceModule {
|
|
6109
|
+
/**
|
|
6110
|
+
* @param storage Required for {@link uploadViaStorage}. Wired up by the
|
|
6111
|
+
* top-level {@link ScaleMule} constructor — most call sites should not
|
|
6112
|
+
* instantiate `AudioService` directly.
|
|
6113
|
+
*/
|
|
6114
|
+
constructor(client, storage) {
|
|
6115
|
+
super(client);
|
|
6116
|
+
this.storage = storage;
|
|
6117
|
+
this.basePath = "/v1/audios";
|
|
6118
|
+
}
|
|
6119
|
+
/**
|
|
6120
|
+
* Register a storage-uploaded audio asset with the audio service.
|
|
6121
|
+
* Idempotent — re-calling with the same `file_id` returns the existing
|
|
6122
|
+
* record.
|
|
6123
|
+
*/
|
|
6124
|
+
async register(args, options) {
|
|
6125
|
+
return this.post("/register", { file_id: args.fileId, sm_user_id: args.userId }, options);
|
|
6126
|
+
}
|
|
6127
|
+
/**
|
|
6128
|
+
* Upload a file to storage (browser → S3 direct, private, uncompressed)
|
|
6129
|
+
* and register it with the audio service.
|
|
6130
|
+
*
|
|
6131
|
+
* Mirrors `photo.uploadViaStorage()` / `video.uploadViaStorage()`. If
|
|
6132
|
+
* `register()` fails after a successful storage upload, the file is *not*
|
|
6133
|
+
* lost — the returned `file_id` is still valid as a generic private storage
|
|
6134
|
+
* file. The SDK logs a warning and returns `audio_id: null`.
|
|
6135
|
+
*/
|
|
6136
|
+
async uploadViaStorage(file, uploadOptions, requestOptions) {
|
|
6137
|
+
const uploadResult = await this.storage.uploadPrivate(file, {
|
|
6138
|
+
filename: uploadOptions?.filename,
|
|
6139
|
+
metadata: uploadOptions?.metadata,
|
|
6140
|
+
onProgress: uploadOptions?.onProgress,
|
|
6141
|
+
signal: uploadOptions?.signal
|
|
6142
|
+
});
|
|
6143
|
+
if (uploadResult.error || !uploadResult.data) {
|
|
6144
|
+
return { data: null, error: uploadResult.error };
|
|
6145
|
+
}
|
|
6146
|
+
const fileInfo = uploadResult.data;
|
|
6147
|
+
const fileId = fileInfo.id;
|
|
6148
|
+
const originalViewUrl = fileInfo.url ?? null;
|
|
6149
|
+
const registerResult = await this.register({ fileId, userId: uploadOptions?.userId }, requestOptions);
|
|
6150
|
+
if (registerResult.error || !registerResult.data) {
|
|
6151
|
+
console.warn(
|
|
6152
|
+
"[scalemule-sdk] audio.register() failed after storage upload; typed audio metadata unavailable.",
|
|
6153
|
+
registerResult.error
|
|
6154
|
+
);
|
|
6155
|
+
return {
|
|
6156
|
+
data: {
|
|
6157
|
+
file_id: fileId,
|
|
6158
|
+
audio_id: null,
|
|
6159
|
+
original_view_url: originalViewUrl
|
|
6160
|
+
},
|
|
6161
|
+
error: null
|
|
6162
|
+
};
|
|
6163
|
+
}
|
|
6164
|
+
return {
|
|
6165
|
+
data: {
|
|
6166
|
+
file_id: fileId,
|
|
6167
|
+
audio_id: registerResult.data.audio_id,
|
|
6168
|
+
original_view_url: originalViewUrl
|
|
6169
|
+
},
|
|
6170
|
+
error: null
|
|
6171
|
+
};
|
|
6172
|
+
}
|
|
6173
|
+
};
|
|
6174
|
+
|
|
6107
6175
|
// src/services/queue.ts
|
|
6108
6176
|
var DeadLetterApi = class extends ServiceModule {
|
|
6109
6177
|
constructor() {
|
|
@@ -6954,6 +7022,7 @@ var ScaleMule = class {
|
|
|
6954
7022
|
this.graph = new GraphService(this._client);
|
|
6955
7023
|
this.functions = new FunctionsService(this._client);
|
|
6956
7024
|
this.photo = new PhotoService(this._client, this.storage);
|
|
7025
|
+
this.audio = new AudioService(this._client, this.storage);
|
|
6957
7026
|
this.flagContent = new FlagContentService(this._client);
|
|
6958
7027
|
this.creatorMaker = new CreatorMakerService(this._client);
|
|
6959
7028
|
this.compliance = new ComplianceService(this._client);
|
|
@@ -7096,6 +7165,7 @@ export {
|
|
|
7096
7165
|
AgentToolsService,
|
|
7097
7166
|
AgentsService,
|
|
7098
7167
|
AnalyticsService,
|
|
7168
|
+
AudioService,
|
|
7099
7169
|
AuthService,
|
|
7100
7170
|
BillingService,
|
|
7101
7171
|
CacheService,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalemule/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.43",
|
|
4
4
|
"description": "Official TypeScript/JavaScript SDK for ScaleMule Backend-as-a-Service",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
34
34
|
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
35
35
|
"typecheck": "tsc --noEmit",
|
|
36
|
-
"prepublishOnly": "npm run build && npm test && npm run lint",
|
|
36
|
+
"prepublishOnly": "node -e \"const v=require('./package.json').version; if(!/^0\\.(0|1)\\.\\d+$/.test(v)){console.error('ERR: SDK '+v+' violates patch-only policy (0.0.x or 0.1.x only). See CONTRIBUTING.md SDK versioning section.');process.exit(1)}\" && npm run build && npm test && npm run lint",
|
|
37
37
|
"release": "npm run prepublishOnly && npm publish --access public"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|