@scalemule/sdk 0.0.16 → 0.0.19
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 +92 -1
- package/dist/index.d.ts +92 -1
- package/dist/index.js +411 -7
- package/dist/index.mjs +409 -7
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -881,6 +881,21 @@ interface UploadCompleteResponse {
|
|
|
881
881
|
already_completed: boolean;
|
|
882
882
|
scan_queued: boolean;
|
|
883
883
|
}
|
|
884
|
+
interface UploadFailureReport {
|
|
885
|
+
fileId: string;
|
|
886
|
+
completionToken: string;
|
|
887
|
+
step: string;
|
|
888
|
+
errorCode: string;
|
|
889
|
+
errorMessage?: string;
|
|
890
|
+
httpStatus?: number;
|
|
891
|
+
attempt?: number;
|
|
892
|
+
diagnostics?: Record<string, unknown>;
|
|
893
|
+
}
|
|
894
|
+
interface UploadFailureReportResponse {
|
|
895
|
+
file_id: string;
|
|
896
|
+
recorded: boolean;
|
|
897
|
+
upload_status: string;
|
|
898
|
+
}
|
|
884
899
|
interface MultipartStartResponse {
|
|
885
900
|
upload_session_id: string;
|
|
886
901
|
file_id: string;
|
|
@@ -947,6 +962,7 @@ declare class StorageService extends ServiceModule {
|
|
|
947
962
|
getUploadUrl(filename: string, contentType: string, options?: {
|
|
948
963
|
isPublic?: boolean;
|
|
949
964
|
expiresIn?: number;
|
|
965
|
+
sizeBytes?: number;
|
|
950
966
|
metadata?: Record<string, unknown>;
|
|
951
967
|
}, requestOptions?: RequestOptions): Promise<ApiResponse<PresignedUploadResponse>>;
|
|
952
968
|
/**
|
|
@@ -957,6 +973,11 @@ declare class StorageService extends ServiceModule {
|
|
|
957
973
|
sizeBytes?: number;
|
|
958
974
|
checksum?: string;
|
|
959
975
|
}, requestOptions?: RequestOptions): Promise<ApiResponse<UploadCompleteResponse>>;
|
|
976
|
+
/**
|
|
977
|
+
* Persist a structured client-side upload failure against a file record.
|
|
978
|
+
* Best used by split-upload clients that call getUploadUrl() manually.
|
|
979
|
+
*/
|
|
980
|
+
reportUploadFailure(params: UploadFailureReport, requestOptions?: RequestOptions): Promise<ApiResponse<UploadFailureReportResponse>>;
|
|
960
981
|
/** Start a multipart upload session. */
|
|
961
982
|
startMultipartUpload(params: {
|
|
962
983
|
filename: string;
|
|
@@ -1050,6 +1071,7 @@ declare class StorageService extends ServiceModule {
|
|
|
1050
1071
|
private defaultChunkSize;
|
|
1051
1072
|
private defaultConcurrency;
|
|
1052
1073
|
private maybeCompress;
|
|
1074
|
+
private reportUploadFailureBestEffort;
|
|
1053
1075
|
private getOrCreateTelemetry;
|
|
1054
1076
|
/** Build RequestOptions with X-Upload-Session-Id header for cross-boundary correlation */
|
|
1055
1077
|
private withSessionHeader;
|
|
@@ -1252,6 +1274,75 @@ declare function getPartRange(partNumber: number, chunkSize: number, totalSize:
|
|
|
1252
1274
|
size: number;
|
|
1253
1275
|
};
|
|
1254
1276
|
|
|
1277
|
+
/**
|
|
1278
|
+
* Standalone S3 upload utilities for browser environments.
|
|
1279
|
+
*
|
|
1280
|
+
* These functions handle the client-side portion of presigned URL uploads:
|
|
1281
|
+
* - Single PUT for small files (with retry + stall detection)
|
|
1282
|
+
* - Multipart chunked upload for large files (parallel parts, per-chunk retry, ETag collection)
|
|
1283
|
+
*
|
|
1284
|
+
* Used by any app that gets presigned URLs from the server and needs to upload to S3.
|
|
1285
|
+
* The server-side proxy routes are app-specific; these utilities are app-agnostic.
|
|
1286
|
+
*/
|
|
1287
|
+
interface S3UploadProgress {
|
|
1288
|
+
loaded: number;
|
|
1289
|
+
total: number;
|
|
1290
|
+
percentage: number;
|
|
1291
|
+
}
|
|
1292
|
+
interface S3SingleUploadOptions {
|
|
1293
|
+
onProgress?: (progress: S3UploadProgress) => void;
|
|
1294
|
+
signal?: AbortSignal;
|
|
1295
|
+
/** Max retries per attempt (default: 3) */
|
|
1296
|
+
maxRetries?: number;
|
|
1297
|
+
/** Stall timeout in ms — abort if no progress for this long (default: 45000) */
|
|
1298
|
+
stallTimeoutMs?: number;
|
|
1299
|
+
}
|
|
1300
|
+
interface S3SingleUploadResult {
|
|
1301
|
+
success: boolean;
|
|
1302
|
+
error?: string;
|
|
1303
|
+
}
|
|
1304
|
+
interface MultipartPartUrl {
|
|
1305
|
+
partNumber: number;
|
|
1306
|
+
url: string;
|
|
1307
|
+
}
|
|
1308
|
+
interface MultipartConfig {
|
|
1309
|
+
partSizeBytes: number;
|
|
1310
|
+
totalParts: number;
|
|
1311
|
+
partUrls: MultipartPartUrl[];
|
|
1312
|
+
/** Fetch fresh URLs when needed (e.g., on 403 expiry). App provides this via its proxy route. */
|
|
1313
|
+
fetchMoreUrls?: (partNumbers: number[]) => Promise<MultipartPartUrl[] | null>;
|
|
1314
|
+
}
|
|
1315
|
+
interface S3MultipartOptions {
|
|
1316
|
+
onProgress?: (progress: S3UploadProgress) => void;
|
|
1317
|
+
signal?: AbortSignal;
|
|
1318
|
+
/** Max concurrent part uploads (default: 3) */
|
|
1319
|
+
concurrency?: number;
|
|
1320
|
+
/** Max retries per part (default: 3) */
|
|
1321
|
+
maxRetries?: number;
|
|
1322
|
+
/** Stall timeout in ms — retry part if no progress for this long (default: none) */
|
|
1323
|
+
stallTimeoutMs?: number;
|
|
1324
|
+
}
|
|
1325
|
+
interface PartResult {
|
|
1326
|
+
partNumber: number;
|
|
1327
|
+
etag: string;
|
|
1328
|
+
}
|
|
1329
|
+
interface S3MultipartResult {
|
|
1330
|
+
success: boolean;
|
|
1331
|
+
parts?: PartResult[];
|
|
1332
|
+
error?: string;
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Upload a file to S3 via a single presigned PUT.
|
|
1336
|
+
* Includes retry on 5xx/network errors and stall detection.
|
|
1337
|
+
*/
|
|
1338
|
+
declare function uploadSingleToS3(url: string, file: File | Blob, options?: S3SingleUploadOptions): Promise<S3SingleUploadResult>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Upload a file to S3 using multipart chunked upload.
|
|
1341
|
+
* Splits the file into chunks, uploads in parallel with per-chunk retry,
|
|
1342
|
+
* collects ETags for completion.
|
|
1343
|
+
*/
|
|
1344
|
+
declare function uploadMultipartToS3(file: File | Blob, config: MultipartConfig, options?: S3MultipartOptions): Promise<S3MultipartResult>;
|
|
1345
|
+
|
|
1255
1346
|
/**
|
|
1256
1347
|
* Realtime Service Module
|
|
1257
1348
|
*
|
|
@@ -5152,4 +5243,4 @@ declare class ScaleMule {
|
|
|
5152
5243
|
getClient(): ScaleMuleClient;
|
|
5153
5244
|
}
|
|
5154
5245
|
|
|
5155
|
-
export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, validateIP };
|
|
5246
|
+
export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.d.ts
CHANGED
|
@@ -881,6 +881,21 @@ interface UploadCompleteResponse {
|
|
|
881
881
|
already_completed: boolean;
|
|
882
882
|
scan_queued: boolean;
|
|
883
883
|
}
|
|
884
|
+
interface UploadFailureReport {
|
|
885
|
+
fileId: string;
|
|
886
|
+
completionToken: string;
|
|
887
|
+
step: string;
|
|
888
|
+
errorCode: string;
|
|
889
|
+
errorMessage?: string;
|
|
890
|
+
httpStatus?: number;
|
|
891
|
+
attempt?: number;
|
|
892
|
+
diagnostics?: Record<string, unknown>;
|
|
893
|
+
}
|
|
894
|
+
interface UploadFailureReportResponse {
|
|
895
|
+
file_id: string;
|
|
896
|
+
recorded: boolean;
|
|
897
|
+
upload_status: string;
|
|
898
|
+
}
|
|
884
899
|
interface MultipartStartResponse {
|
|
885
900
|
upload_session_id: string;
|
|
886
901
|
file_id: string;
|
|
@@ -947,6 +962,7 @@ declare class StorageService extends ServiceModule {
|
|
|
947
962
|
getUploadUrl(filename: string, contentType: string, options?: {
|
|
948
963
|
isPublic?: boolean;
|
|
949
964
|
expiresIn?: number;
|
|
965
|
+
sizeBytes?: number;
|
|
950
966
|
metadata?: Record<string, unknown>;
|
|
951
967
|
}, requestOptions?: RequestOptions): Promise<ApiResponse<PresignedUploadResponse>>;
|
|
952
968
|
/**
|
|
@@ -957,6 +973,11 @@ declare class StorageService extends ServiceModule {
|
|
|
957
973
|
sizeBytes?: number;
|
|
958
974
|
checksum?: string;
|
|
959
975
|
}, requestOptions?: RequestOptions): Promise<ApiResponse<UploadCompleteResponse>>;
|
|
976
|
+
/**
|
|
977
|
+
* Persist a structured client-side upload failure against a file record.
|
|
978
|
+
* Best used by split-upload clients that call getUploadUrl() manually.
|
|
979
|
+
*/
|
|
980
|
+
reportUploadFailure(params: UploadFailureReport, requestOptions?: RequestOptions): Promise<ApiResponse<UploadFailureReportResponse>>;
|
|
960
981
|
/** Start a multipart upload session. */
|
|
961
982
|
startMultipartUpload(params: {
|
|
962
983
|
filename: string;
|
|
@@ -1050,6 +1071,7 @@ declare class StorageService extends ServiceModule {
|
|
|
1050
1071
|
private defaultChunkSize;
|
|
1051
1072
|
private defaultConcurrency;
|
|
1052
1073
|
private maybeCompress;
|
|
1074
|
+
private reportUploadFailureBestEffort;
|
|
1053
1075
|
private getOrCreateTelemetry;
|
|
1054
1076
|
/** Build RequestOptions with X-Upload-Session-Id header for cross-boundary correlation */
|
|
1055
1077
|
private withSessionHeader;
|
|
@@ -1252,6 +1274,75 @@ declare function getPartRange(partNumber: number, chunkSize: number, totalSize:
|
|
|
1252
1274
|
size: number;
|
|
1253
1275
|
};
|
|
1254
1276
|
|
|
1277
|
+
/**
|
|
1278
|
+
* Standalone S3 upload utilities for browser environments.
|
|
1279
|
+
*
|
|
1280
|
+
* These functions handle the client-side portion of presigned URL uploads:
|
|
1281
|
+
* - Single PUT for small files (with retry + stall detection)
|
|
1282
|
+
* - Multipart chunked upload for large files (parallel parts, per-chunk retry, ETag collection)
|
|
1283
|
+
*
|
|
1284
|
+
* Used by any app that gets presigned URLs from the server and needs to upload to S3.
|
|
1285
|
+
* The server-side proxy routes are app-specific; these utilities are app-agnostic.
|
|
1286
|
+
*/
|
|
1287
|
+
interface S3UploadProgress {
|
|
1288
|
+
loaded: number;
|
|
1289
|
+
total: number;
|
|
1290
|
+
percentage: number;
|
|
1291
|
+
}
|
|
1292
|
+
interface S3SingleUploadOptions {
|
|
1293
|
+
onProgress?: (progress: S3UploadProgress) => void;
|
|
1294
|
+
signal?: AbortSignal;
|
|
1295
|
+
/** Max retries per attempt (default: 3) */
|
|
1296
|
+
maxRetries?: number;
|
|
1297
|
+
/** Stall timeout in ms — abort if no progress for this long (default: 45000) */
|
|
1298
|
+
stallTimeoutMs?: number;
|
|
1299
|
+
}
|
|
1300
|
+
interface S3SingleUploadResult {
|
|
1301
|
+
success: boolean;
|
|
1302
|
+
error?: string;
|
|
1303
|
+
}
|
|
1304
|
+
interface MultipartPartUrl {
|
|
1305
|
+
partNumber: number;
|
|
1306
|
+
url: string;
|
|
1307
|
+
}
|
|
1308
|
+
interface MultipartConfig {
|
|
1309
|
+
partSizeBytes: number;
|
|
1310
|
+
totalParts: number;
|
|
1311
|
+
partUrls: MultipartPartUrl[];
|
|
1312
|
+
/** Fetch fresh URLs when needed (e.g., on 403 expiry). App provides this via its proxy route. */
|
|
1313
|
+
fetchMoreUrls?: (partNumbers: number[]) => Promise<MultipartPartUrl[] | null>;
|
|
1314
|
+
}
|
|
1315
|
+
interface S3MultipartOptions {
|
|
1316
|
+
onProgress?: (progress: S3UploadProgress) => void;
|
|
1317
|
+
signal?: AbortSignal;
|
|
1318
|
+
/** Max concurrent part uploads (default: 3) */
|
|
1319
|
+
concurrency?: number;
|
|
1320
|
+
/** Max retries per part (default: 3) */
|
|
1321
|
+
maxRetries?: number;
|
|
1322
|
+
/** Stall timeout in ms — retry part if no progress for this long (default: none) */
|
|
1323
|
+
stallTimeoutMs?: number;
|
|
1324
|
+
}
|
|
1325
|
+
interface PartResult {
|
|
1326
|
+
partNumber: number;
|
|
1327
|
+
etag: string;
|
|
1328
|
+
}
|
|
1329
|
+
interface S3MultipartResult {
|
|
1330
|
+
success: boolean;
|
|
1331
|
+
parts?: PartResult[];
|
|
1332
|
+
error?: string;
|
|
1333
|
+
}
|
|
1334
|
+
/**
|
|
1335
|
+
* Upload a file to S3 via a single presigned PUT.
|
|
1336
|
+
* Includes retry on 5xx/network errors and stall detection.
|
|
1337
|
+
*/
|
|
1338
|
+
declare function uploadSingleToS3(url: string, file: File | Blob, options?: S3SingleUploadOptions): Promise<S3SingleUploadResult>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Upload a file to S3 using multipart chunked upload.
|
|
1341
|
+
* Splits the file into chunks, uploads in parallel with per-chunk retry,
|
|
1342
|
+
* collects ETags for completion.
|
|
1343
|
+
*/
|
|
1344
|
+
declare function uploadMultipartToS3(file: File | Blob, config: MultipartConfig, options?: S3MultipartOptions): Promise<S3MultipartResult>;
|
|
1345
|
+
|
|
1255
1346
|
/**
|
|
1256
1347
|
* Realtime Service Module
|
|
1257
1348
|
*
|
|
@@ -5152,4 +5243,4 @@ declare class ScaleMule {
|
|
|
5152
5243
|
getClient(): ScaleMuleClient;
|
|
5153
5244
|
}
|
|
5154
5245
|
|
|
5155
|
-
export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, validateIP };
|
|
5246
|
+
export { type AccountBalance, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushToken, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RequestOptions, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type Severity, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type Webhook, WebhooksService, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|