@scalemule/sdk 0.0.74 → 0.0.75
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 +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +148 -3
- package/dist/index.mjs +136 -3
- package/package.json +3 -10
package/dist/index.d.mts
CHANGED
|
@@ -5308,6 +5308,34 @@ interface CommunityMapSubmissionInput {
|
|
|
5308
5308
|
idempotency_key: string;
|
|
5309
5309
|
proposal: CommunityMapProposal;
|
|
5310
5310
|
}
|
|
5311
|
+
interface CommunityMapOwnSubmission {
|
|
5312
|
+
id: string;
|
|
5313
|
+
area_id: string;
|
|
5314
|
+
status: CommunityMapSubmissionStatus;
|
|
5315
|
+
revision: number;
|
|
5316
|
+
editable: boolean;
|
|
5317
|
+
proposal: CommunityMapProposal;
|
|
5318
|
+
feature_id: string | null;
|
|
5319
|
+
created_at: string;
|
|
5320
|
+
media: {
|
|
5321
|
+
id: string;
|
|
5322
|
+
caption: string;
|
|
5323
|
+
attribution: string;
|
|
5324
|
+
content_type: string;
|
|
5325
|
+
status: string;
|
|
5326
|
+
}[];
|
|
5327
|
+
}
|
|
5328
|
+
interface CommunityMapOwnSubmissionPage extends CommunityMapPage<CommunityMapOwnSubmission> {
|
|
5329
|
+
reader_key: string;
|
|
5330
|
+
}
|
|
5331
|
+
interface CommunityMapSubmissionUpdate {
|
|
5332
|
+
expected_revision: number;
|
|
5333
|
+
proposal: CommunityMapProposal;
|
|
5334
|
+
consent: {
|
|
5335
|
+
version: string;
|
|
5336
|
+
accepted: boolean;
|
|
5337
|
+
};
|
|
5338
|
+
}
|
|
5311
5339
|
type CommunityMapReportReason = 'no-longer-exists' | 'incorrect-location' | 'incorrect-information' | 'inappropriate-media' | 'duplicate' | 'safety' | 'privacy-removal' | 'other';
|
|
5312
5340
|
interface CommunityMapReportInput {
|
|
5313
5341
|
reason: CommunityMapReportReason;
|
|
@@ -5411,10 +5439,13 @@ declare class CommunityMapsService extends ServiceModule {
|
|
|
5411
5439
|
listFeatures(slug: string, query?: CommunityMapFeatureQuery, options?: RequestOptions): Promise<ApiResponse<CommunityMapPage<CommunityMapFeature>>>;
|
|
5412
5440
|
getFeature(slug: string, id: string, options?: RequestOptions): Promise<ApiResponse<CommunityMapFeature>>;
|
|
5413
5441
|
createSubmission(slug: string, data: CommunityMapSubmissionInput, options?: RequestOptions): Promise<ApiResponse<CommunityMapReceipt>>;
|
|
5442
|
+
listOwnSubmissions(slug: string, after?: string, options?: RequestOptions): Promise<ApiResponse<CommunityMapOwnSubmissionPage>>;
|
|
5443
|
+
updateOwnSubmission(slug: string, id: string, data: CommunityMapSubmissionUpdate, options?: RequestOptions): Promise<ApiResponse<CommunityMapRevision>>;
|
|
5414
5444
|
uploadMedia(slug: string, submission: string, file: File | Blob, fields: {
|
|
5415
5445
|
caption: string;
|
|
5416
5446
|
attribution: string;
|
|
5417
5447
|
rights_confirmed: boolean;
|
|
5448
|
+
idempotency_key?: string;
|
|
5418
5449
|
consent_version: string;
|
|
5419
5450
|
}, options?: RequestOptions): Promise<ApiResponse<{
|
|
5420
5451
|
id: string;
|
|
@@ -8132,6 +8163,16 @@ declare class AgentSessionsService extends ServiceModule {
|
|
|
8132
8163
|
listArtifacts(sessionId: string, options?: RequestOptions): Promise<ApiResponse<SessionArtifact[]>>;
|
|
8133
8164
|
}
|
|
8134
8165
|
|
|
8166
|
+
declare function prepareCommunityMapAttachment(file: File): Promise<File>;
|
|
8167
|
+
interface MediaCaptureSession {
|
|
8168
|
+
stream: MediaStream;
|
|
8169
|
+
result: Promise<File | null>;
|
|
8170
|
+
stop(): void;
|
|
8171
|
+
cancel(): void;
|
|
8172
|
+
}
|
|
8173
|
+
/** CoralMeet capture limits: 15s video / 60s voice, bounded bytes, tracks always released. */
|
|
8174
|
+
declare function startMediaCapture(kind: 'video' | 'audio', signal?: AbortSignal): Promise<MediaCaptureSession>;
|
|
8175
|
+
|
|
8135
8176
|
/**
|
|
8136
8177
|
* Main entry point for the ScaleMule SDK.
|
|
8137
8178
|
*
|
|
@@ -8280,4 +8321,4 @@ declare class ScaleMule {
|
|
|
8280
8321
|
getClient(): ScaleMuleClient;
|
|
8281
8322
|
}
|
|
8282
8323
|
|
|
8283
|
-
export { type AcceptQuoteInput, type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CommunityMapArea, type CommunityMapCanonicalArea, type CommunityMapCollection, type CommunityMapCollectionConfig, type CommunityMapComment, type CommunityMapCommentInput, type CommunityMapCommentPage, type CommunityMapConsent, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapPage, type CommunityMapPosition, type CommunityMapPrecision, type CommunityMapPrivateReport, type CommunityMapPrivateSubmission, type CommunityMapProposal, type CommunityMapPublicContent, type CommunityMapQueueQuery, type CommunityMapReactionDefinition, type CommunityMapReceipt, type CommunityMapReportInput, type CommunityMapReportReason, type CommunityMapRevision, type CommunityMapSource, type CommunityMapSubmissionInput, type CommunityMapSubmissionPolicy, type CommunityMapSubmissionStatus, type CommunityMapView, type CommunityMapVote, CommunityMapsEditorialService, CommunityMapsGeographyService, CommunityMapsService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateLeadInput, type CreatePollInput, type CreateQuoteInput, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Lead, type Leaderboard, type LeaderboardEntry, LeaderboardService, LeadsService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialContentProjection, type SocialContentProjectionInput, type SocialDiscoveryCreatorInput, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdatePollInput, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type VoteState, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
8324
|
+
export { type AcceptQuoteInput, type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CommunityMapArea, type CommunityMapCanonicalArea, type CommunityMapCollection, type CommunityMapCollectionConfig, type CommunityMapComment, type CommunityMapCommentInput, type CommunityMapCommentPage, type CommunityMapConsent, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapOwnSubmission, type CommunityMapOwnSubmissionPage, type CommunityMapPage, type CommunityMapPosition, type CommunityMapPrecision, type CommunityMapPrivateReport, type CommunityMapPrivateSubmission, type CommunityMapProposal, type CommunityMapPublicContent, type CommunityMapQueueQuery, type CommunityMapReactionDefinition, type CommunityMapReceipt, type CommunityMapReportInput, type CommunityMapReportReason, type CommunityMapRevision, type CommunityMapSource, type CommunityMapSubmissionInput, type CommunityMapSubmissionPolicy, type CommunityMapSubmissionStatus, type CommunityMapSubmissionUpdate, type CommunityMapView, type CommunityMapVote, CommunityMapsEditorialService, CommunityMapsGeographyService, CommunityMapsService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateLeadInput, type CreatePollInput, type CreateQuoteInput, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Lead, type Leaderboard, type LeaderboardEntry, LeaderboardService, LeadsService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaCaptureSession, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialContentProjection, type SocialContentProjectionInput, type SocialDiscoveryCreatorInput, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdatePollInput, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type VoteState, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, prepareCommunityMapAttachment, readAnonymousId, resolveStrategy, startMediaCapture, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.d.ts
CHANGED
|
@@ -5308,6 +5308,34 @@ interface CommunityMapSubmissionInput {
|
|
|
5308
5308
|
idempotency_key: string;
|
|
5309
5309
|
proposal: CommunityMapProposal;
|
|
5310
5310
|
}
|
|
5311
|
+
interface CommunityMapOwnSubmission {
|
|
5312
|
+
id: string;
|
|
5313
|
+
area_id: string;
|
|
5314
|
+
status: CommunityMapSubmissionStatus;
|
|
5315
|
+
revision: number;
|
|
5316
|
+
editable: boolean;
|
|
5317
|
+
proposal: CommunityMapProposal;
|
|
5318
|
+
feature_id: string | null;
|
|
5319
|
+
created_at: string;
|
|
5320
|
+
media: {
|
|
5321
|
+
id: string;
|
|
5322
|
+
caption: string;
|
|
5323
|
+
attribution: string;
|
|
5324
|
+
content_type: string;
|
|
5325
|
+
status: string;
|
|
5326
|
+
}[];
|
|
5327
|
+
}
|
|
5328
|
+
interface CommunityMapOwnSubmissionPage extends CommunityMapPage<CommunityMapOwnSubmission> {
|
|
5329
|
+
reader_key: string;
|
|
5330
|
+
}
|
|
5331
|
+
interface CommunityMapSubmissionUpdate {
|
|
5332
|
+
expected_revision: number;
|
|
5333
|
+
proposal: CommunityMapProposal;
|
|
5334
|
+
consent: {
|
|
5335
|
+
version: string;
|
|
5336
|
+
accepted: boolean;
|
|
5337
|
+
};
|
|
5338
|
+
}
|
|
5311
5339
|
type CommunityMapReportReason = 'no-longer-exists' | 'incorrect-location' | 'incorrect-information' | 'inappropriate-media' | 'duplicate' | 'safety' | 'privacy-removal' | 'other';
|
|
5312
5340
|
interface CommunityMapReportInput {
|
|
5313
5341
|
reason: CommunityMapReportReason;
|
|
@@ -5411,10 +5439,13 @@ declare class CommunityMapsService extends ServiceModule {
|
|
|
5411
5439
|
listFeatures(slug: string, query?: CommunityMapFeatureQuery, options?: RequestOptions): Promise<ApiResponse<CommunityMapPage<CommunityMapFeature>>>;
|
|
5412
5440
|
getFeature(slug: string, id: string, options?: RequestOptions): Promise<ApiResponse<CommunityMapFeature>>;
|
|
5413
5441
|
createSubmission(slug: string, data: CommunityMapSubmissionInput, options?: RequestOptions): Promise<ApiResponse<CommunityMapReceipt>>;
|
|
5442
|
+
listOwnSubmissions(slug: string, after?: string, options?: RequestOptions): Promise<ApiResponse<CommunityMapOwnSubmissionPage>>;
|
|
5443
|
+
updateOwnSubmission(slug: string, id: string, data: CommunityMapSubmissionUpdate, options?: RequestOptions): Promise<ApiResponse<CommunityMapRevision>>;
|
|
5414
5444
|
uploadMedia(slug: string, submission: string, file: File | Blob, fields: {
|
|
5415
5445
|
caption: string;
|
|
5416
5446
|
attribution: string;
|
|
5417
5447
|
rights_confirmed: boolean;
|
|
5448
|
+
idempotency_key?: string;
|
|
5418
5449
|
consent_version: string;
|
|
5419
5450
|
}, options?: RequestOptions): Promise<ApiResponse<{
|
|
5420
5451
|
id: string;
|
|
@@ -8132,6 +8163,16 @@ declare class AgentSessionsService extends ServiceModule {
|
|
|
8132
8163
|
listArtifacts(sessionId: string, options?: RequestOptions): Promise<ApiResponse<SessionArtifact[]>>;
|
|
8133
8164
|
}
|
|
8134
8165
|
|
|
8166
|
+
declare function prepareCommunityMapAttachment(file: File): Promise<File>;
|
|
8167
|
+
interface MediaCaptureSession {
|
|
8168
|
+
stream: MediaStream;
|
|
8169
|
+
result: Promise<File | null>;
|
|
8170
|
+
stop(): void;
|
|
8171
|
+
cancel(): void;
|
|
8172
|
+
}
|
|
8173
|
+
/** CoralMeet capture limits: 15s video / 60s voice, bounded bytes, tracks always released. */
|
|
8174
|
+
declare function startMediaCapture(kind: 'video' | 'audio', signal?: AbortSignal): Promise<MediaCaptureSession>;
|
|
8175
|
+
|
|
8135
8176
|
/**
|
|
8136
8177
|
* Main entry point for the ScaleMule SDK.
|
|
8137
8178
|
*
|
|
@@ -8280,4 +8321,4 @@ declare class ScaleMule {
|
|
|
8280
8321
|
getClient(): ScaleMuleClient;
|
|
8281
8322
|
}
|
|
8282
8323
|
|
|
8283
|
-
export { type AcceptQuoteInput, type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CommunityMapArea, type CommunityMapCanonicalArea, type CommunityMapCollection, type CommunityMapCollectionConfig, type CommunityMapComment, type CommunityMapCommentInput, type CommunityMapCommentPage, type CommunityMapConsent, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapPage, type CommunityMapPosition, type CommunityMapPrecision, type CommunityMapPrivateReport, type CommunityMapPrivateSubmission, type CommunityMapProposal, type CommunityMapPublicContent, type CommunityMapQueueQuery, type CommunityMapReactionDefinition, type CommunityMapReceipt, type CommunityMapReportInput, type CommunityMapReportReason, type CommunityMapRevision, type CommunityMapSource, type CommunityMapSubmissionInput, type CommunityMapSubmissionPolicy, type CommunityMapSubmissionStatus, type CommunityMapView, type CommunityMapVote, CommunityMapsEditorialService, CommunityMapsGeographyService, CommunityMapsService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateLeadInput, type CreatePollInput, type CreateQuoteInput, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Lead, type Leaderboard, type LeaderboardEntry, LeaderboardService, LeadsService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialContentProjection, type SocialContentProjectionInput, type SocialDiscoveryCreatorInput, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdatePollInput, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type VoteState, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, readAnonymousId, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
8324
|
+
export { type AcceptQuoteInput, type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type AppointmentDepositValue, type Attachment, type Attendee, type AudioRegisterResult, AudioService, type AudioUploadViaStorageResult, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type BookingCompletionResult, BookingsService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CommunityMapArea, type CommunityMapCanonicalArea, type CommunityMapCollection, type CommunityMapCollectionConfig, type CommunityMapComment, type CommunityMapCommentInput, type CommunityMapCommentPage, type CommunityMapConsent, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapOwnSubmission, type CommunityMapOwnSubmissionPage, type CommunityMapPage, type CommunityMapPosition, type CommunityMapPrecision, type CommunityMapPrivateReport, type CommunityMapPrivateSubmission, type CommunityMapProposal, type CommunityMapPublicContent, type CommunityMapQueueQuery, type CommunityMapReactionDefinition, type CommunityMapReceipt, type CommunityMapReportInput, type CommunityMapReportReason, type CommunityMapRevision, type CommunityMapSource, type CommunityMapSubmissionInput, type CommunityMapSubmissionPolicy, type CommunityMapSubmissionStatus, type CommunityMapSubmissionUpdate, type CommunityMapView, type CommunityMapVote, CommunityMapsEditorialService, CommunityMapsGeographyService, CommunityMapsService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type ContentPolicy, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateLeadInput, type CreatePollInput, type CreateQuoteInput, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type CustomerStats, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DecisionBatchItem, type DecisionBatchResult, type DecisionEvaluateOptions, type DecisionOutcome, type DecisionProposedAction, type DecisionReceipt, type DecisionResult, type DecisionTraceLevel, type DecisionVersions, DecisionsService, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FileStatus, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, LEGACY_ANONYMOUS_ID_KEYS, type Lead, type Leaderboard, type LeaderboardEntry, LeaderboardService, LeadsService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, MEDIA_PRESETS, type MediaAsset, type MediaCaptureSession, type MediaKind, type MediaManifest, type MediaManifestOptions, type MediaPolicy, type MediaPreset, type MediaPresetSpec, MediaService, type MediaUploadEvent, type MediaUploadOptions, type MediaUploadPhase, type MediaUploadResult, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type Poll, type PollBallot, type PollChoice, type PollChoiceInput, type PollListOptions, type PollMedia, type PollMediaKind, type PollStatus, PollsService, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type Quote, type QuoteDeposit, type QuoteState, type ReadStatus, RealtimeService, type ReceiptVerification, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, STORAGE_KEYS, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialContentProjection, type SocialContentProjectionInput, type SocialDiscoveryCreatorInput, type SocialPolicyAction, type SocialPolicyBatchDecisionItem, type SocialPolicyBatchDecisionRequest, type SocialPolicyBatchDecisionResponse, type SocialPolicyBatchDecisionTarget, type SocialPolicyBlockRequest, type SocialPolicyContactRequest, type SocialPolicyContactRequestListItem, type SocialPolicyContactRequestQuery, type SocialPolicyContactRequestRequest, type SocialPolicyContext, type SocialPolicyDecision, type SocialPolicyDecisionLimits, type SocialPolicyDecisionRequest, type SocialPolicyDecisionResponse, type SocialPolicyIdentity, type SocialPolicyIdentityType, type SocialPolicyMuteRequest, type SocialPolicyPolicyPack, type SocialPolicyRelationship, type SocialPolicyRelationshipQuery, type SocialPolicyRelationshipRequest, type SocialPolicyReportRequest, SocialPolicyService, type SocialPolicySettings, type SocialPolicyUnblockRequest, type SocialPolicyUpdateSettingsRequest, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StorageSettings, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type TtsAccessMode, type TtsAudioInfo, type TtsJobStatus, type TtsListVoicesParams, TtsService, type TtsSpeechMetadata, type TtsSpeechProfile, type TtsSynthesizeParams, type TtsSynthesizeQueuedResult, type TtsSynthesizeReadyResult, type TtsSynthesizeResult, type TtsVoice, type TtsVoicesResponse, type UnreadCountResponse, type UpdateFlagRequest, type UpdatePollInput, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, type VoteState, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, prepareCommunityMapAttachment, readAnonymousId, resolveStrategy, startMediaCapture, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __esm = (fn, res) => function __init() {
|
|
7
9
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -18,6 +20,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
20
|
}
|
|
19
21
|
return to;
|
|
20
22
|
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
21
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
22
32
|
|
|
23
33
|
// src/services/upload-resume.ts
|
|
@@ -258,7 +268,7 @@ async function loadImageCompression() {
|
|
|
258
268
|
if (cachedImport === false) return null;
|
|
259
269
|
if (cachedImport) return cachedImport;
|
|
260
270
|
try {
|
|
261
|
-
const mod = await
|
|
271
|
+
const mod = await import("browser-image-compression");
|
|
262
272
|
cachedImport = mod.default || mod;
|
|
263
273
|
return cachedImport;
|
|
264
274
|
} catch {
|
|
@@ -382,8 +392,10 @@ __export(index_exports, {
|
|
|
382
392
|
normalizePhoneNumber: () => normalizePhoneNumber,
|
|
383
393
|
pollSharePercent: () => pollSharePercent,
|
|
384
394
|
pollVoterKey: () => pollVoterKey,
|
|
395
|
+
prepareCommunityMapAttachment: () => prepareCommunityMapAttachment,
|
|
385
396
|
readAnonymousId: () => readAnonymousId,
|
|
386
397
|
resolveStrategy: () => resolveStrategy,
|
|
398
|
+
startMediaCapture: () => startMediaCapture,
|
|
387
399
|
uploadMultipartToS3: () => uploadMultipartToS3,
|
|
388
400
|
uploadSingleToS3: () => uploadSingleToS3,
|
|
389
401
|
validateIP: () => validateIP
|
|
@@ -1690,7 +1702,7 @@ function asString(parent, key) {
|
|
|
1690
1702
|
return typeof value === "string" ? value : void 0;
|
|
1691
1703
|
}
|
|
1692
1704
|
|
|
1693
|
-
//
|
|
1705
|
+
// node_modules/@scalemule/ui/dist/phone/index.mjs
|
|
1694
1706
|
var PHONE_COUNTRIES = [
|
|
1695
1707
|
{ code: "US", name: "United States", dialCode: "+1" },
|
|
1696
1708
|
{ code: "CA", name: "Canada", dialCode: "+1" },
|
|
@@ -6951,6 +6963,15 @@ var CommunityMapsService = class extends ServiceModule {
|
|
|
6951
6963
|
createSubmission(slug, data, options) {
|
|
6952
6964
|
return this.post("/collections/" + segment(slug) + "/submissions", data, options);
|
|
6953
6965
|
}
|
|
6966
|
+
listOwnSubmissions(slug, after, options) {
|
|
6967
|
+
return this._get(
|
|
6968
|
+
"/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + segment(after) : ""),
|
|
6969
|
+
options
|
|
6970
|
+
);
|
|
6971
|
+
}
|
|
6972
|
+
updateOwnSubmission(slug, id, data, options) {
|
|
6973
|
+
return this.post("/collections/" + segment(slug) + "/submissions/" + segment(id), data, options);
|
|
6974
|
+
}
|
|
6954
6975
|
uploadMedia(slug, submission, file, fields, options) {
|
|
6955
6976
|
return this._upload(
|
|
6956
6977
|
"/collections/" + segment(slug) + "/submissions/" + segment(submission) + "/media",
|
|
@@ -6959,7 +6980,8 @@ var CommunityMapsService = class extends ServiceModule {
|
|
|
6959
6980
|
caption: fields.caption,
|
|
6960
6981
|
attribution: fields.attribution,
|
|
6961
6982
|
rights_confirmed: String(fields.rights_confirmed),
|
|
6962
|
-
consent_version: fields.consent_version
|
|
6983
|
+
consent_version: fields.consent_version,
|
|
6984
|
+
...fields.idempotency_key ? { idempotency_key: fields.idempotency_key } : {}
|
|
6963
6985
|
},
|
|
6964
6986
|
options
|
|
6965
6987
|
);
|
|
@@ -9114,6 +9136,127 @@ var AgentSessionsService = class extends ServiceModule {
|
|
|
9114
9136
|
}
|
|
9115
9137
|
};
|
|
9116
9138
|
|
|
9139
|
+
// src/browser-capture.ts
|
|
9140
|
+
init_upload_compression();
|
|
9141
|
+
async function prepareCommunityMapAttachment(file) {
|
|
9142
|
+
const types = [
|
|
9143
|
+
"image/jpeg",
|
|
9144
|
+
"image/png",
|
|
9145
|
+
"image/webp",
|
|
9146
|
+
"video/mp4",
|
|
9147
|
+
"video/quicktime",
|
|
9148
|
+
"video/webm",
|
|
9149
|
+
"audio/mpeg",
|
|
9150
|
+
"audio/mp4",
|
|
9151
|
+
"audio/wav",
|
|
9152
|
+
"audio/x-wav",
|
|
9153
|
+
"audio/ogg",
|
|
9154
|
+
"audio/webm"
|
|
9155
|
+
];
|
|
9156
|
+
if (!types.includes(file.type))
|
|
9157
|
+
throw new Error(
|
|
9158
|
+
"Choose JPEG, PNG or WebP photos, MP4/MOV/WebM video, or MP3/M4A/WAV/Ogg audio. For HEIC, export as JPEG first."
|
|
9159
|
+
);
|
|
9160
|
+
if (!file.size || file.size > 25 * 1024 * 1024)
|
|
9161
|
+
throw new Error("Choose a file up to 25 MiB. Record a shorter clip if needed.");
|
|
9162
|
+
if (!file.type.startsWith("image/")) return file;
|
|
9163
|
+
const compressed = await maybeCompressImage(
|
|
9164
|
+
file,
|
|
9165
|
+
{ maxWidth: 2400, maxHeight: 2400, maxSizeMB: 2, quality: 0.82 },
|
|
9166
|
+
"community-capture",
|
|
9167
|
+
null
|
|
9168
|
+
);
|
|
9169
|
+
const result = compressed ? new File(
|
|
9170
|
+
[compressed],
|
|
9171
|
+
file.name.replace(/\.[^.]+$/, "") + (compressed.type === "image/webp" ? ".webp" : ".jpg"),
|
|
9172
|
+
{ type: compressed.type, lastModified: file.lastModified }
|
|
9173
|
+
) : file;
|
|
9174
|
+
if (result.size > 8 * 1024 * 1024)
|
|
9175
|
+
throw new Error("This photo is too large. Choose a photo up to 8 MiB or use a smaller camera setting.");
|
|
9176
|
+
return result;
|
|
9177
|
+
}
|
|
9178
|
+
async function startMediaCapture(kind, signal) {
|
|
9179
|
+
const candidates = kind === "video" ? ["video/mp4;codecs=h264,aac", "video/mp4", "video/webm;codecs=vp8,opus", "video/webm"] : ["audio/mp4", "audio/webm;codecs=opus", "audio/ogg;codecs=opus", "audio/webm"];
|
|
9180
|
+
const mimeType = typeof MediaRecorder === "undefined" ? void 0 : candidates.find((t) => MediaRecorder.isTypeSupported(t));
|
|
9181
|
+
if (!mimeType || !navigator.mediaDevices?.getUserMedia)
|
|
9182
|
+
throw new Error("Recording is unavailable in this browser. Use the camera or choose a file instead.");
|
|
9183
|
+
signal?.throwIfAborted();
|
|
9184
|
+
const stream = await navigator.mediaDevices.getUserMedia(
|
|
9185
|
+
kind === "video" ? {
|
|
9186
|
+
audio: true,
|
|
9187
|
+
video: {
|
|
9188
|
+
facingMode: { ideal: "environment" },
|
|
9189
|
+
width: { ideal: 1280, max: 1280 },
|
|
9190
|
+
height: { ideal: 720, max: 720 },
|
|
9191
|
+
frameRate: { ideal: 24, max: 30 }
|
|
9192
|
+
}
|
|
9193
|
+
} : { audio: { channelCount: { ideal: 1 }, echoCancellation: true, noiseSuppression: true }, video: false }
|
|
9194
|
+
);
|
|
9195
|
+
const release = () => stream.getTracks().forEach((t) => t.stop());
|
|
9196
|
+
if (signal?.aborted) {
|
|
9197
|
+
release();
|
|
9198
|
+
signal.throwIfAborted();
|
|
9199
|
+
}
|
|
9200
|
+
let recorder;
|
|
9201
|
+
try {
|
|
9202
|
+
recorder = new MediaRecorder(stream, { mimeType, videoBitsPerSecond: 2e6, audioBitsPerSecond: 96e3 });
|
|
9203
|
+
} catch (e) {
|
|
9204
|
+
release();
|
|
9205
|
+
throw e;
|
|
9206
|
+
}
|
|
9207
|
+
let cancelled = false;
|
|
9208
|
+
let failure;
|
|
9209
|
+
let bytes = 0;
|
|
9210
|
+
const chunks = [];
|
|
9211
|
+
let timer;
|
|
9212
|
+
const stop = () => {
|
|
9213
|
+
if (recorder.state !== "inactive") recorder.stop();
|
|
9214
|
+
};
|
|
9215
|
+
const cancel = () => {
|
|
9216
|
+
cancelled = true;
|
|
9217
|
+
stop();
|
|
9218
|
+
release();
|
|
9219
|
+
};
|
|
9220
|
+
const result = new Promise((resolve, reject) => {
|
|
9221
|
+
const clean = () => {
|
|
9222
|
+
clearTimeout(timer);
|
|
9223
|
+
signal?.removeEventListener("abort", cancel);
|
|
9224
|
+
release();
|
|
9225
|
+
};
|
|
9226
|
+
recorder.ondataavailable = (event) => {
|
|
9227
|
+
bytes += event.data.size;
|
|
9228
|
+
if (bytes > 25 * 1024 * 1024) {
|
|
9229
|
+
failure = new Error("The recording is too large. Try a shorter clip.");
|
|
9230
|
+
stop();
|
|
9231
|
+
} else if (event.data.size) chunks.push(event.data);
|
|
9232
|
+
};
|
|
9233
|
+
recorder.onerror = () => {
|
|
9234
|
+
failure = new Error("Recording was interrupted. Try again or choose a file.");
|
|
9235
|
+
stop();
|
|
9236
|
+
};
|
|
9237
|
+
recorder.onstop = () => {
|
|
9238
|
+
clean();
|
|
9239
|
+
if (failure) reject(failure);
|
|
9240
|
+
else if (cancelled || !chunks.length) resolve(null);
|
|
9241
|
+
else {
|
|
9242
|
+
const type = recorder.mimeType.split(";")[0] || (kind === "audio" ? "audio/webm" : "video/webm");
|
|
9243
|
+
const extension = type.includes("mp4") ? kind === "audio" ? "m4a" : "mp4" : type.includes("ogg") ? "ogg" : "webm";
|
|
9244
|
+
resolve(new File(chunks, `community-${kind}-${Date.now()}.${extension}`, { type }));
|
|
9245
|
+
}
|
|
9246
|
+
chunks.length = 0;
|
|
9247
|
+
};
|
|
9248
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
9249
|
+
try {
|
|
9250
|
+
recorder.start(250);
|
|
9251
|
+
timer = setTimeout(stop, kind === "video" ? 15e3 : 6e4);
|
|
9252
|
+
} catch (error) {
|
|
9253
|
+
clean();
|
|
9254
|
+
reject(error);
|
|
9255
|
+
}
|
|
9256
|
+
});
|
|
9257
|
+
return { stream, result, stop, cancel };
|
|
9258
|
+
}
|
|
9259
|
+
|
|
9117
9260
|
// src/index.ts
|
|
9118
9261
|
var ScaleMule = class {
|
|
9119
9262
|
/** @deprecated Use `workspaces` instead */
|
|
@@ -9385,8 +9528,10 @@ var index_default = ScaleMule;
|
|
|
9385
9528
|
normalizePhoneNumber,
|
|
9386
9529
|
pollSharePercent,
|
|
9387
9530
|
pollVoterKey,
|
|
9531
|
+
prepareCommunityMapAttachment,
|
|
9388
9532
|
readAnonymousId,
|
|
9389
9533
|
resolveStrategy,
|
|
9534
|
+
startMediaCapture,
|
|
9390
9535
|
uploadMultipartToS3,
|
|
9391
9536
|
uploadSingleToS3,
|
|
9392
9537
|
validateIP
|
package/dist/index.mjs
CHANGED
|
@@ -246,7 +246,7 @@ async function loadImageCompression() {
|
|
|
246
246
|
if (cachedImport === false) return null;
|
|
247
247
|
if (cachedImport) return cachedImport;
|
|
248
248
|
try {
|
|
249
|
-
const mod = await
|
|
249
|
+
const mod = await import("browser-image-compression");
|
|
250
250
|
cachedImport = mod.default || mod;
|
|
251
251
|
return cachedImport;
|
|
252
252
|
} catch {
|
|
@@ -1578,7 +1578,7 @@ function asString(parent, key) {
|
|
|
1578
1578
|
return typeof value === "string" ? value : void 0;
|
|
1579
1579
|
}
|
|
1580
1580
|
|
|
1581
|
-
//
|
|
1581
|
+
// node_modules/@scalemule/ui/dist/phone/index.mjs
|
|
1582
1582
|
var PHONE_COUNTRIES = [
|
|
1583
1583
|
{ code: "US", name: "United States", dialCode: "+1" },
|
|
1584
1584
|
{ code: "CA", name: "Canada", dialCode: "+1" },
|
|
@@ -6839,6 +6839,15 @@ var CommunityMapsService = class extends ServiceModule {
|
|
|
6839
6839
|
createSubmission(slug, data, options) {
|
|
6840
6840
|
return this.post("/collections/" + segment(slug) + "/submissions", data, options);
|
|
6841
6841
|
}
|
|
6842
|
+
listOwnSubmissions(slug, after, options) {
|
|
6843
|
+
return this._get(
|
|
6844
|
+
"/collections/" + segment(slug) + "/submissions" + (after ? "?after=" + segment(after) : ""),
|
|
6845
|
+
options
|
|
6846
|
+
);
|
|
6847
|
+
}
|
|
6848
|
+
updateOwnSubmission(slug, id, data, options) {
|
|
6849
|
+
return this.post("/collections/" + segment(slug) + "/submissions/" + segment(id), data, options);
|
|
6850
|
+
}
|
|
6842
6851
|
uploadMedia(slug, submission, file, fields, options) {
|
|
6843
6852
|
return this._upload(
|
|
6844
6853
|
"/collections/" + segment(slug) + "/submissions/" + segment(submission) + "/media",
|
|
@@ -6847,7 +6856,8 @@ var CommunityMapsService = class extends ServiceModule {
|
|
|
6847
6856
|
caption: fields.caption,
|
|
6848
6857
|
attribution: fields.attribution,
|
|
6849
6858
|
rights_confirmed: String(fields.rights_confirmed),
|
|
6850
|
-
consent_version: fields.consent_version
|
|
6859
|
+
consent_version: fields.consent_version,
|
|
6860
|
+
...fields.idempotency_key ? { idempotency_key: fields.idempotency_key } : {}
|
|
6851
6861
|
},
|
|
6852
6862
|
options
|
|
6853
6863
|
);
|
|
@@ -9002,6 +9012,127 @@ var AgentSessionsService = class extends ServiceModule {
|
|
|
9002
9012
|
}
|
|
9003
9013
|
};
|
|
9004
9014
|
|
|
9015
|
+
// src/browser-capture.ts
|
|
9016
|
+
init_upload_compression();
|
|
9017
|
+
async function prepareCommunityMapAttachment(file) {
|
|
9018
|
+
const types = [
|
|
9019
|
+
"image/jpeg",
|
|
9020
|
+
"image/png",
|
|
9021
|
+
"image/webp",
|
|
9022
|
+
"video/mp4",
|
|
9023
|
+
"video/quicktime",
|
|
9024
|
+
"video/webm",
|
|
9025
|
+
"audio/mpeg",
|
|
9026
|
+
"audio/mp4",
|
|
9027
|
+
"audio/wav",
|
|
9028
|
+
"audio/x-wav",
|
|
9029
|
+
"audio/ogg",
|
|
9030
|
+
"audio/webm"
|
|
9031
|
+
];
|
|
9032
|
+
if (!types.includes(file.type))
|
|
9033
|
+
throw new Error(
|
|
9034
|
+
"Choose JPEG, PNG or WebP photos, MP4/MOV/WebM video, or MP3/M4A/WAV/Ogg audio. For HEIC, export as JPEG first."
|
|
9035
|
+
);
|
|
9036
|
+
if (!file.size || file.size > 25 * 1024 * 1024)
|
|
9037
|
+
throw new Error("Choose a file up to 25 MiB. Record a shorter clip if needed.");
|
|
9038
|
+
if (!file.type.startsWith("image/")) return file;
|
|
9039
|
+
const compressed = await maybeCompressImage(
|
|
9040
|
+
file,
|
|
9041
|
+
{ maxWidth: 2400, maxHeight: 2400, maxSizeMB: 2, quality: 0.82 },
|
|
9042
|
+
"community-capture",
|
|
9043
|
+
null
|
|
9044
|
+
);
|
|
9045
|
+
const result = compressed ? new File(
|
|
9046
|
+
[compressed],
|
|
9047
|
+
file.name.replace(/\.[^.]+$/, "") + (compressed.type === "image/webp" ? ".webp" : ".jpg"),
|
|
9048
|
+
{ type: compressed.type, lastModified: file.lastModified }
|
|
9049
|
+
) : file;
|
|
9050
|
+
if (result.size > 8 * 1024 * 1024)
|
|
9051
|
+
throw new Error("This photo is too large. Choose a photo up to 8 MiB or use a smaller camera setting.");
|
|
9052
|
+
return result;
|
|
9053
|
+
}
|
|
9054
|
+
async function startMediaCapture(kind, signal) {
|
|
9055
|
+
const candidates = kind === "video" ? ["video/mp4;codecs=h264,aac", "video/mp4", "video/webm;codecs=vp8,opus", "video/webm"] : ["audio/mp4", "audio/webm;codecs=opus", "audio/ogg;codecs=opus", "audio/webm"];
|
|
9056
|
+
const mimeType = typeof MediaRecorder === "undefined" ? void 0 : candidates.find((t) => MediaRecorder.isTypeSupported(t));
|
|
9057
|
+
if (!mimeType || !navigator.mediaDevices?.getUserMedia)
|
|
9058
|
+
throw new Error("Recording is unavailable in this browser. Use the camera or choose a file instead.");
|
|
9059
|
+
signal?.throwIfAborted();
|
|
9060
|
+
const stream = await navigator.mediaDevices.getUserMedia(
|
|
9061
|
+
kind === "video" ? {
|
|
9062
|
+
audio: true,
|
|
9063
|
+
video: {
|
|
9064
|
+
facingMode: { ideal: "environment" },
|
|
9065
|
+
width: { ideal: 1280, max: 1280 },
|
|
9066
|
+
height: { ideal: 720, max: 720 },
|
|
9067
|
+
frameRate: { ideal: 24, max: 30 }
|
|
9068
|
+
}
|
|
9069
|
+
} : { audio: { channelCount: { ideal: 1 }, echoCancellation: true, noiseSuppression: true }, video: false }
|
|
9070
|
+
);
|
|
9071
|
+
const release = () => stream.getTracks().forEach((t) => t.stop());
|
|
9072
|
+
if (signal?.aborted) {
|
|
9073
|
+
release();
|
|
9074
|
+
signal.throwIfAborted();
|
|
9075
|
+
}
|
|
9076
|
+
let recorder;
|
|
9077
|
+
try {
|
|
9078
|
+
recorder = new MediaRecorder(stream, { mimeType, videoBitsPerSecond: 2e6, audioBitsPerSecond: 96e3 });
|
|
9079
|
+
} catch (e) {
|
|
9080
|
+
release();
|
|
9081
|
+
throw e;
|
|
9082
|
+
}
|
|
9083
|
+
let cancelled = false;
|
|
9084
|
+
let failure;
|
|
9085
|
+
let bytes = 0;
|
|
9086
|
+
const chunks = [];
|
|
9087
|
+
let timer;
|
|
9088
|
+
const stop = () => {
|
|
9089
|
+
if (recorder.state !== "inactive") recorder.stop();
|
|
9090
|
+
};
|
|
9091
|
+
const cancel = () => {
|
|
9092
|
+
cancelled = true;
|
|
9093
|
+
stop();
|
|
9094
|
+
release();
|
|
9095
|
+
};
|
|
9096
|
+
const result = new Promise((resolve, reject) => {
|
|
9097
|
+
const clean = () => {
|
|
9098
|
+
clearTimeout(timer);
|
|
9099
|
+
signal?.removeEventListener("abort", cancel);
|
|
9100
|
+
release();
|
|
9101
|
+
};
|
|
9102
|
+
recorder.ondataavailable = (event) => {
|
|
9103
|
+
bytes += event.data.size;
|
|
9104
|
+
if (bytes > 25 * 1024 * 1024) {
|
|
9105
|
+
failure = new Error("The recording is too large. Try a shorter clip.");
|
|
9106
|
+
stop();
|
|
9107
|
+
} else if (event.data.size) chunks.push(event.data);
|
|
9108
|
+
};
|
|
9109
|
+
recorder.onerror = () => {
|
|
9110
|
+
failure = new Error("Recording was interrupted. Try again or choose a file.");
|
|
9111
|
+
stop();
|
|
9112
|
+
};
|
|
9113
|
+
recorder.onstop = () => {
|
|
9114
|
+
clean();
|
|
9115
|
+
if (failure) reject(failure);
|
|
9116
|
+
else if (cancelled || !chunks.length) resolve(null);
|
|
9117
|
+
else {
|
|
9118
|
+
const type = recorder.mimeType.split(";")[0] || (kind === "audio" ? "audio/webm" : "video/webm");
|
|
9119
|
+
const extension = type.includes("mp4") ? kind === "audio" ? "m4a" : "mp4" : type.includes("ogg") ? "ogg" : "webm";
|
|
9120
|
+
resolve(new File(chunks, `community-${kind}-${Date.now()}.${extension}`, { type }));
|
|
9121
|
+
}
|
|
9122
|
+
chunks.length = 0;
|
|
9123
|
+
};
|
|
9124
|
+
signal?.addEventListener("abort", cancel, { once: true });
|
|
9125
|
+
try {
|
|
9126
|
+
recorder.start(250);
|
|
9127
|
+
timer = setTimeout(stop, kind === "video" ? 15e3 : 6e4);
|
|
9128
|
+
} catch (error) {
|
|
9129
|
+
clean();
|
|
9130
|
+
reject(error);
|
|
9131
|
+
}
|
|
9132
|
+
});
|
|
9133
|
+
return { stream, result, stop, cancel };
|
|
9134
|
+
}
|
|
9135
|
+
|
|
9005
9136
|
// src/index.ts
|
|
9006
9137
|
var ScaleMule = class {
|
|
9007
9138
|
/** @deprecated Use `workspaces` instead */
|
|
@@ -9273,8 +9404,10 @@ export {
|
|
|
9273
9404
|
normalizePhoneNumber,
|
|
9274
9405
|
pollSharePercent,
|
|
9275
9406
|
pollVoterKey,
|
|
9407
|
+
prepareCommunityMapAttachment,
|
|
9276
9408
|
readAnonymousId,
|
|
9277
9409
|
resolveStrategy,
|
|
9410
|
+
startMediaCapture,
|
|
9278
9411
|
uploadMultipartToS3,
|
|
9279
9412
|
uploadSingleToS3,
|
|
9280
9413
|
validateIP
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalemule/sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.75",
|
|
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",
|
|
@@ -63,15 +63,8 @@
|
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@scalemule/ui": ">=0.0.1",
|
|
66
|
-
"semver": "^7.7.4"
|
|
67
|
-
|
|
68
|
-
"peerDependencies": {
|
|
69
|
-
"browser-image-compression": ">=2.0.0"
|
|
70
|
-
},
|
|
71
|
-
"peerDependenciesMeta": {
|
|
72
|
-
"browser-image-compression": {
|
|
73
|
-
"optional": true
|
|
74
|
-
}
|
|
66
|
+
"semver": "^7.7.4",
|
|
67
|
+
"browser-image-compression": "^2.0.2"
|
|
75
68
|
},
|
|
76
69
|
"devDependencies": {
|
|
77
70
|
"@scalemule/ui": ">=0.0.1",
|