@scalemule/sdk 0.0.36 → 0.0.37
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 +70 -1
- package/dist/index.d.ts +70 -1
- package/dist/index.js +78 -1
- package/dist/index.mjs +78 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1832,6 +1832,9 @@ declare class DataService extends ServiceModule {
|
|
|
1832
1832
|
* PATCH /messages/{id} → edit message
|
|
1833
1833
|
* DELETE /messages/{id} → delete message
|
|
1834
1834
|
* POST /messages/{id}/reactions → add reaction
|
|
1835
|
+
* POST /messages/{id}/pin → pin message
|
|
1836
|
+
* DELETE /messages/{id}/pin → unpin message
|
|
1837
|
+
* GET /conversations/{id}/pins → list pinned messages
|
|
1835
1838
|
* POST /conversations/{id}/typing → send typing indicator
|
|
1836
1839
|
* POST /conversations/{id}/read → mark as read
|
|
1837
1840
|
* GET /conversations/{id}/read-status → get read status
|
|
@@ -1875,6 +1878,8 @@ interface ChatMessage {
|
|
|
1875
1878
|
latest_reply_at?: string;
|
|
1876
1879
|
reply_user_ids?: string[];
|
|
1877
1880
|
is_thread_broadcast?: boolean;
|
|
1881
|
+
is_pinned?: boolean;
|
|
1882
|
+
pinned_at?: string;
|
|
1878
1883
|
}
|
|
1879
1884
|
interface ReadStatus {
|
|
1880
1885
|
user_id: string;
|
|
@@ -1886,6 +1891,15 @@ interface ChatReaction {
|
|
|
1886
1891
|
message_id: string;
|
|
1887
1892
|
created_at: string;
|
|
1888
1893
|
}
|
|
1894
|
+
interface MessagePin {
|
|
1895
|
+
message_id: string;
|
|
1896
|
+
conversation_id: string;
|
|
1897
|
+
pinned_by_user_id: string;
|
|
1898
|
+
pinned_at: string;
|
|
1899
|
+
}
|
|
1900
|
+
interface PinnedMessagesResponse {
|
|
1901
|
+
pins: MessagePin[];
|
|
1902
|
+
}
|
|
1889
1903
|
declare class ChatService extends ServiceModule {
|
|
1890
1904
|
protected basePath: string;
|
|
1891
1905
|
createConversation(data: {
|
|
@@ -1924,6 +1938,11 @@ declare class ChatService extends ServiceModule {
|
|
|
1924
1938
|
addReaction(messageId: string, data: {
|
|
1925
1939
|
emoji: string;
|
|
1926
1940
|
}, options?: RequestOptions): Promise<ApiResponse<ChatReaction>>;
|
|
1941
|
+
pinMessage(messageId: string, options?: RequestOptions): Promise<ApiResponse<MessagePin>>;
|
|
1942
|
+
unpinMessage(messageId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
1943
|
+
unpinned: boolean;
|
|
1944
|
+
}>>;
|
|
1945
|
+
getPinnedMessages(conversationId: string, options?: RequestOptions): Promise<ApiResponse<PinnedMessagesResponse>>;
|
|
1927
1946
|
sendTyping(conversationId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
1928
1947
|
sent: boolean;
|
|
1929
1948
|
}>>;
|
|
@@ -2271,7 +2290,12 @@ declare class ReferralsService extends ServiceModule {
|
|
|
2271
2290
|
|
|
2272
2291
|
interface Customer {
|
|
2273
2292
|
id: string;
|
|
2293
|
+
sm_application_id?: string;
|
|
2294
|
+
account_id?: string;
|
|
2295
|
+
sm_user_id?: string;
|
|
2296
|
+
billing_mode?: 'test' | 'live';
|
|
2274
2297
|
stripe_customer_id?: string;
|
|
2298
|
+
stripe_account_id?: string | null;
|
|
2275
2299
|
email: string;
|
|
2276
2300
|
metadata?: Record<string, unknown>;
|
|
2277
2301
|
created_at: string;
|
|
@@ -2291,6 +2315,10 @@ interface Subscription {
|
|
|
2291
2315
|
interface Invoice {
|
|
2292
2316
|
id: string;
|
|
2293
2317
|
customer_id: string;
|
|
2318
|
+
sm_application_id?: string;
|
|
2319
|
+
account_id?: string;
|
|
2320
|
+
billing_mode?: 'test' | 'live';
|
|
2321
|
+
stripe_account_id?: string | null;
|
|
2294
2322
|
stripe_invoice_id?: string;
|
|
2295
2323
|
amount_due: number;
|
|
2296
2324
|
amount_paid: number;
|
|
@@ -2310,6 +2338,10 @@ interface UsageSummary$1 {
|
|
|
2310
2338
|
interface PaymentMethod {
|
|
2311
2339
|
id: string;
|
|
2312
2340
|
customer_id: string;
|
|
2341
|
+
sm_application_id?: string;
|
|
2342
|
+
account_id?: string;
|
|
2343
|
+
billing_mode?: 'test' | 'live';
|
|
2344
|
+
stripe_account_id?: string | null;
|
|
2313
2345
|
stripe_payment_method_id?: string;
|
|
2314
2346
|
type: string;
|
|
2315
2347
|
last4?: string;
|
|
@@ -2319,6 +2351,30 @@ interface PaymentMethod {
|
|
|
2319
2351
|
is_default: boolean;
|
|
2320
2352
|
created_at: string;
|
|
2321
2353
|
}
|
|
2354
|
+
/**
|
|
2355
|
+
* Identifies the target account for an account-scoped billing call.
|
|
2356
|
+
* `billing_mode` defaults to the application's configured mode if omitted.
|
|
2357
|
+
*/
|
|
2358
|
+
interface AccountScopedBillingRequest {
|
|
2359
|
+
account_id: string;
|
|
2360
|
+
billing_mode?: 'test' | 'live';
|
|
2361
|
+
}
|
|
2362
|
+
interface PortalSession {
|
|
2363
|
+
url: string;
|
|
2364
|
+
expires_at: string;
|
|
2365
|
+
}
|
|
2366
|
+
interface AttachPaymentMethodRequest {
|
|
2367
|
+
stripe_payment_method_id: string;
|
|
2368
|
+
set_default?: boolean;
|
|
2369
|
+
}
|
|
2370
|
+
interface InvoiceListParams {
|
|
2371
|
+
limit?: number;
|
|
2372
|
+
cursor?: string;
|
|
2373
|
+
}
|
|
2374
|
+
interface InvoiceListResponse {
|
|
2375
|
+
data: Invoice[];
|
|
2376
|
+
next_cursor?: string | null;
|
|
2377
|
+
}
|
|
2322
2378
|
interface ConnectedAccount {
|
|
2323
2379
|
id: string;
|
|
2324
2380
|
email: string;
|
|
@@ -2466,14 +2522,27 @@ interface ConnectedSubscriptionListParams extends PaginationParams {
|
|
|
2466
2522
|
declare class BillingService extends ServiceModule {
|
|
2467
2523
|
protected basePath: string;
|
|
2468
2524
|
private retiredSurface;
|
|
2525
|
+
/** @deprecated Use `getAccountCustomer({ account_id })`. Targets the user-scoped legacy endpoint. */
|
|
2469
2526
|
createCustomer(data: {
|
|
2470
2527
|
email: string;
|
|
2471
2528
|
name?: string;
|
|
2472
2529
|
}, options?: RequestOptions): Promise<ApiResponse<Customer>>;
|
|
2530
|
+
/** @deprecated Use `attachAccountPaymentMethod({ account_id }, ...)`. Targets the user-scoped legacy endpoint. */
|
|
2473
2531
|
addPaymentMethod(data: {
|
|
2474
2532
|
type: string;
|
|
2475
2533
|
token: string;
|
|
2476
2534
|
}, options?: RequestOptions): Promise<ApiResponse<PaymentMethod>>;
|
|
2535
|
+
private accountBase;
|
|
2536
|
+
getAccountCustomer(req: AccountScopedBillingRequest, options?: RequestOptions): Promise<ApiResponse<Customer>>;
|
|
2537
|
+
listAccountPaymentMethods(req: AccountScopedBillingRequest, options?: RequestOptions): Promise<ApiResponse<PaymentMethod[]>>;
|
|
2538
|
+
attachAccountPaymentMethod(req: AccountScopedBillingRequest, body: AttachPaymentMethodRequest, options?: RequestOptions): Promise<ApiResponse<PaymentMethod>>;
|
|
2539
|
+
detachAccountPaymentMethod(req: AccountScopedBillingRequest, paymentMethodId: string, options?: RequestOptions): Promise<ApiResponse<void>>;
|
|
2540
|
+
setDefaultAccountPaymentMethod(req: AccountScopedBillingRequest, paymentMethodId: string, options?: RequestOptions): Promise<ApiResponse<PaymentMethod>>;
|
|
2541
|
+
listAccountInvoices(req: AccountScopedBillingRequest, params?: InvoiceListParams, options?: RequestOptions): Promise<ApiResponse<InvoiceListResponse>>;
|
|
2542
|
+
getAccountInvoice(req: AccountScopedBillingRequest, invoiceId: string, options?: RequestOptions): Promise<ApiResponse<Invoice>>;
|
|
2543
|
+
createAccountPortalSession(req: AccountScopedBillingRequest, body?: {
|
|
2544
|
+
return_url?: string;
|
|
2545
|
+
}, options?: RequestOptions): Promise<ApiResponse<PortalSession>>;
|
|
2477
2546
|
subscribe(data: {
|
|
2478
2547
|
customer_id: string;
|
|
2479
2548
|
plan_id: string;
|
|
@@ -6052,4 +6121,4 @@ declare class ScaleMule {
|
|
|
6052
6121
|
getClient(): ScaleMuleClient;
|
|
6053
6122
|
}
|
|
6054
6123
|
|
|
6055
|
-
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type 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 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 Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
6124
|
+
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.d.ts
CHANGED
|
@@ -1832,6 +1832,9 @@ declare class DataService extends ServiceModule {
|
|
|
1832
1832
|
* PATCH /messages/{id} → edit message
|
|
1833
1833
|
* DELETE /messages/{id} → delete message
|
|
1834
1834
|
* POST /messages/{id}/reactions → add reaction
|
|
1835
|
+
* POST /messages/{id}/pin → pin message
|
|
1836
|
+
* DELETE /messages/{id}/pin → unpin message
|
|
1837
|
+
* GET /conversations/{id}/pins → list pinned messages
|
|
1835
1838
|
* POST /conversations/{id}/typing → send typing indicator
|
|
1836
1839
|
* POST /conversations/{id}/read → mark as read
|
|
1837
1840
|
* GET /conversations/{id}/read-status → get read status
|
|
@@ -1875,6 +1878,8 @@ interface ChatMessage {
|
|
|
1875
1878
|
latest_reply_at?: string;
|
|
1876
1879
|
reply_user_ids?: string[];
|
|
1877
1880
|
is_thread_broadcast?: boolean;
|
|
1881
|
+
is_pinned?: boolean;
|
|
1882
|
+
pinned_at?: string;
|
|
1878
1883
|
}
|
|
1879
1884
|
interface ReadStatus {
|
|
1880
1885
|
user_id: string;
|
|
@@ -1886,6 +1891,15 @@ interface ChatReaction {
|
|
|
1886
1891
|
message_id: string;
|
|
1887
1892
|
created_at: string;
|
|
1888
1893
|
}
|
|
1894
|
+
interface MessagePin {
|
|
1895
|
+
message_id: string;
|
|
1896
|
+
conversation_id: string;
|
|
1897
|
+
pinned_by_user_id: string;
|
|
1898
|
+
pinned_at: string;
|
|
1899
|
+
}
|
|
1900
|
+
interface PinnedMessagesResponse {
|
|
1901
|
+
pins: MessagePin[];
|
|
1902
|
+
}
|
|
1889
1903
|
declare class ChatService extends ServiceModule {
|
|
1890
1904
|
protected basePath: string;
|
|
1891
1905
|
createConversation(data: {
|
|
@@ -1924,6 +1938,11 @@ declare class ChatService extends ServiceModule {
|
|
|
1924
1938
|
addReaction(messageId: string, data: {
|
|
1925
1939
|
emoji: string;
|
|
1926
1940
|
}, options?: RequestOptions): Promise<ApiResponse<ChatReaction>>;
|
|
1941
|
+
pinMessage(messageId: string, options?: RequestOptions): Promise<ApiResponse<MessagePin>>;
|
|
1942
|
+
unpinMessage(messageId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
1943
|
+
unpinned: boolean;
|
|
1944
|
+
}>>;
|
|
1945
|
+
getPinnedMessages(conversationId: string, options?: RequestOptions): Promise<ApiResponse<PinnedMessagesResponse>>;
|
|
1927
1946
|
sendTyping(conversationId: string, options?: RequestOptions): Promise<ApiResponse<{
|
|
1928
1947
|
sent: boolean;
|
|
1929
1948
|
}>>;
|
|
@@ -2271,7 +2290,12 @@ declare class ReferralsService extends ServiceModule {
|
|
|
2271
2290
|
|
|
2272
2291
|
interface Customer {
|
|
2273
2292
|
id: string;
|
|
2293
|
+
sm_application_id?: string;
|
|
2294
|
+
account_id?: string;
|
|
2295
|
+
sm_user_id?: string;
|
|
2296
|
+
billing_mode?: 'test' | 'live';
|
|
2274
2297
|
stripe_customer_id?: string;
|
|
2298
|
+
stripe_account_id?: string | null;
|
|
2275
2299
|
email: string;
|
|
2276
2300
|
metadata?: Record<string, unknown>;
|
|
2277
2301
|
created_at: string;
|
|
@@ -2291,6 +2315,10 @@ interface Subscription {
|
|
|
2291
2315
|
interface Invoice {
|
|
2292
2316
|
id: string;
|
|
2293
2317
|
customer_id: string;
|
|
2318
|
+
sm_application_id?: string;
|
|
2319
|
+
account_id?: string;
|
|
2320
|
+
billing_mode?: 'test' | 'live';
|
|
2321
|
+
stripe_account_id?: string | null;
|
|
2294
2322
|
stripe_invoice_id?: string;
|
|
2295
2323
|
amount_due: number;
|
|
2296
2324
|
amount_paid: number;
|
|
@@ -2310,6 +2338,10 @@ interface UsageSummary$1 {
|
|
|
2310
2338
|
interface PaymentMethod {
|
|
2311
2339
|
id: string;
|
|
2312
2340
|
customer_id: string;
|
|
2341
|
+
sm_application_id?: string;
|
|
2342
|
+
account_id?: string;
|
|
2343
|
+
billing_mode?: 'test' | 'live';
|
|
2344
|
+
stripe_account_id?: string | null;
|
|
2313
2345
|
stripe_payment_method_id?: string;
|
|
2314
2346
|
type: string;
|
|
2315
2347
|
last4?: string;
|
|
@@ -2319,6 +2351,30 @@ interface PaymentMethod {
|
|
|
2319
2351
|
is_default: boolean;
|
|
2320
2352
|
created_at: string;
|
|
2321
2353
|
}
|
|
2354
|
+
/**
|
|
2355
|
+
* Identifies the target account for an account-scoped billing call.
|
|
2356
|
+
* `billing_mode` defaults to the application's configured mode if omitted.
|
|
2357
|
+
*/
|
|
2358
|
+
interface AccountScopedBillingRequest {
|
|
2359
|
+
account_id: string;
|
|
2360
|
+
billing_mode?: 'test' | 'live';
|
|
2361
|
+
}
|
|
2362
|
+
interface PortalSession {
|
|
2363
|
+
url: string;
|
|
2364
|
+
expires_at: string;
|
|
2365
|
+
}
|
|
2366
|
+
interface AttachPaymentMethodRequest {
|
|
2367
|
+
stripe_payment_method_id: string;
|
|
2368
|
+
set_default?: boolean;
|
|
2369
|
+
}
|
|
2370
|
+
interface InvoiceListParams {
|
|
2371
|
+
limit?: number;
|
|
2372
|
+
cursor?: string;
|
|
2373
|
+
}
|
|
2374
|
+
interface InvoiceListResponse {
|
|
2375
|
+
data: Invoice[];
|
|
2376
|
+
next_cursor?: string | null;
|
|
2377
|
+
}
|
|
2322
2378
|
interface ConnectedAccount {
|
|
2323
2379
|
id: string;
|
|
2324
2380
|
email: string;
|
|
@@ -2466,14 +2522,27 @@ interface ConnectedSubscriptionListParams extends PaginationParams {
|
|
|
2466
2522
|
declare class BillingService extends ServiceModule {
|
|
2467
2523
|
protected basePath: string;
|
|
2468
2524
|
private retiredSurface;
|
|
2525
|
+
/** @deprecated Use `getAccountCustomer({ account_id })`. Targets the user-scoped legacy endpoint. */
|
|
2469
2526
|
createCustomer(data: {
|
|
2470
2527
|
email: string;
|
|
2471
2528
|
name?: string;
|
|
2472
2529
|
}, options?: RequestOptions): Promise<ApiResponse<Customer>>;
|
|
2530
|
+
/** @deprecated Use `attachAccountPaymentMethod({ account_id }, ...)`. Targets the user-scoped legacy endpoint. */
|
|
2473
2531
|
addPaymentMethod(data: {
|
|
2474
2532
|
type: string;
|
|
2475
2533
|
token: string;
|
|
2476
2534
|
}, options?: RequestOptions): Promise<ApiResponse<PaymentMethod>>;
|
|
2535
|
+
private accountBase;
|
|
2536
|
+
getAccountCustomer(req: AccountScopedBillingRequest, options?: RequestOptions): Promise<ApiResponse<Customer>>;
|
|
2537
|
+
listAccountPaymentMethods(req: AccountScopedBillingRequest, options?: RequestOptions): Promise<ApiResponse<PaymentMethod[]>>;
|
|
2538
|
+
attachAccountPaymentMethod(req: AccountScopedBillingRequest, body: AttachPaymentMethodRequest, options?: RequestOptions): Promise<ApiResponse<PaymentMethod>>;
|
|
2539
|
+
detachAccountPaymentMethod(req: AccountScopedBillingRequest, paymentMethodId: string, options?: RequestOptions): Promise<ApiResponse<void>>;
|
|
2540
|
+
setDefaultAccountPaymentMethod(req: AccountScopedBillingRequest, paymentMethodId: string, options?: RequestOptions): Promise<ApiResponse<PaymentMethod>>;
|
|
2541
|
+
listAccountInvoices(req: AccountScopedBillingRequest, params?: InvoiceListParams, options?: RequestOptions): Promise<ApiResponse<InvoiceListResponse>>;
|
|
2542
|
+
getAccountInvoice(req: AccountScopedBillingRequest, invoiceId: string, options?: RequestOptions): Promise<ApiResponse<Invoice>>;
|
|
2543
|
+
createAccountPortalSession(req: AccountScopedBillingRequest, body?: {
|
|
2544
|
+
return_url?: string;
|
|
2545
|
+
}, options?: RequestOptions): Promise<ApiResponse<PortalSession>>;
|
|
2477
2546
|
subscribe(data: {
|
|
2478
2547
|
customer_id: string;
|
|
2479
2548
|
plan_id: string;
|
|
@@ -6052,4 +6121,4 @@ declare class ScaleMule {
|
|
|
6052
6121
|
getClient(): ScaleMuleClient;
|
|
6053
6122
|
}
|
|
6054
6123
|
|
|
6055
|
-
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type 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 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 Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
|
6124
|
+
export { type AccountBalance, type AccountSwitcherPrivacy, AccountsService, type ActiveUsers, type ActivityItem, AgentAuthService, AgentModelsService, type AgentProfile, AgentProjectsService, type AgentResponse, type AgentSecurityPolicy, AgentSessionsService, type AgentSigningKey, type AgentToken, type AgentToolEntitlement, AgentToolsService, type Workspace as AgentWorkspace, AgentsService, type AggregateOptions, type AggregateResult, type AnalyticsEvent, AnalyticsService, type ApiError, type ApiKey, type ApiResponse, type Appeal, type Application, type Attachment, type Attendee, type AuditLog, type AuthRegisterAgentRequest, type AuthRegisterAgentResponse, AuthService, type AuthSession, type AuthUser, type BackupCodes, BillingService, type CacheEntry, CacheService, type CalendarEvent, type CallParticipant, type CallSession, type CatalogEntry, CatalogService, type ChatMessage, type ChatReaction, ChatService, type ClaimResult, type Client, type ClientContext, type Collection, type Comment, CommunicationService, type CompletedPart, ComplianceService, type CompressionConfig, ConferenceService, type ConferenceSettings, type ConnectedAccount, type ConnectedAccountSubscription, type ConnectedSetupIntentResponse, type ConnectedSubscriptionListParams, type ConnectionStatus, type ContentFlag, type Conversation, type CostReportDay, type CreateProjectInput as CreateCreatorProjectInput, type CreateFlagRequest, type CreateRuleRequest, type CreateSegmentRequest, type CreateSessionResponse, type CreateVariantRequest, type GenerationJob as CreatorJob, CreatorMakerService, type GenerationOutput as CreatorOutput, type CreatorProject, type CreatorUsage, type Credential, type CredentialScope, type Customer, type DataAccessPolicy, type DataExport, DataService, type DataSource, type DeadLetterJob, type DeviceInfo, type DirectoryUser, type DirectoryUserDetail, type DirectoryUsersListResponse, type Document, type ErrorCode, ErrorCodes, type EventAggregation, EventsService, type FileInfo, type FlagAuditEntry, type FlagCheck, type FlagCondition, FlagContentService, type FlagDefinition, type FlagDetail, type FlagEnvironment, type FlagEvaluation, type FlagSegment, type FlagVariant, FlagsService, type FollowStatus, type FunctionExecution, type FunctionMetrics, FunctionsService, type Funnel, type FunnelConversion, type GdprRequest, type GenerateInput, type GrantInfo, type GraphEdge, type GraphNode, GraphService, IdentityService, type IdentityType, type IncomingRequestLike, type Invoice, type JobExecution, type JobStats, type JoinCallResponse, type KnownAccount, type KnownAccountDisplay, type Leaderboard, type LeaderboardEntry, LeaderboardService, type Like, type ListNotificationsParams, type Listing, ListingsService, type LogEntry, type LogInput, type LogQueryParams, type LogQueryResponse, type LogRecord, LoggerService, type LoginActivitySummary, type LoginDeviceInfo, type LoginHistoryEntry, type LoginRiskInfo, type MessageCallback, type MessagePin, type MessageStatus, type MetricDataPoint, type MfaStatus, type Model, type ModelEntitlement, type ModelPricing, type ModelProvider, type UsageSummary as ModelUsageSummary, type MultipartCompleteResponse, type MultipartConfig, type MultipartPartUrl, type MultipartPartUrlsResponse, type MultipartStartResponse, type NetworkClass, type Notification, type NotificationListResponse, NotificationsService, type OAuthProvider, type OAuthUrl, OrchestratorService, PHOTO_BREAKPOINTS, type PaginatedResponse, type PaginationMetadata, type PaginationParams, type PartResult, type PartUrl, type Participant, type Payment, type PaymentListParams, type PaymentMethod, type PaymentStatusResponse, type Payout, type PayoutSchedule, type PermissionCheck, type PermissionMatrix, PermissionsService, type PhotoInfo, PhotoService, type PinnedMessagesResponse, type Pipeline, type PipelineVersion, type Policy, type PresenceCallback, type PresenceEvent, type PresignedUploadResponse, type Price, type Product, type Project, type ProjectDocument, type ProjectGrant, type ProjectMember, type PushApiFetcher, type PushPreferences, type PushSettings, type PushSubscriptionInfo, type PushToken, type PushTokenAssociationResult, type PushTopic, type QueryFilter, type QueryOptions, type QuerySort, type QueueJob, QueueService, type ReadStatus, RealtimeService, type RedeemResult, type ReferralAnalytics, type ReferralCampaign, type ReferralProfile, type ReferralStats, ReferralsService, type Refund, type RegisterAgentRequest, type RegisterAgentResponse, type RegisterPushTokenData, type RequestOptions, type ResolvedReferral, type ResumeSession, type Role, type RuntimeTemplate, type RuntimeTemplateVersion, type S3MultipartOptions, type S3MultipartResult, type S3SingleUploadOptions, type S3SingleUploadResult, type S3UploadProgress, ScaleMule, ScaleMuleClient, type ScaleMuleConfig, type SchedulerJob, SchedulerService, type SearchResult, SearchService, type SearchUsersParams, type SecurityLayers, type ServerlessFunction, type ServiceHealth, ServiceModule, type Session, type SessionArtifact, type SessionInfo, type SessionLog, type SessionPoolEntry, type Severity, type ShareLink, type ShortestPathResult, type SignedUrlResponse, type SocialPost, SocialService, type SocialUser, type SsoConfig, type StatusCallback, type StorageAdapter, StorageService, type StrategyResult, type StylePreset, type SubmitResult, type Subscription, type TargetingRule, type Task, type TaskAttempt, type TaskTransition, type Team, type TeamInvitation, type TeamMember, TeamsService, type TelemetryPayload, type Tool, type ToolCapability, type ToolIntegration, type TopEvent, type TotpSetup, type Transaction, type TransactionListParams, type TransactionSummary, type TransactionSummaryParams, type Transfer, type TransformOptions, type TransformResult, type TraversalResult, type UnreadCountResponse, type UpdateFlagRequest, type UpdateRuleRequest, type UpdateSegmentRequest, type UpdateVariantRequest, type UploadCompleteResponse, type UploadEngineConfig, type UploadFailureReport, type UploadFailureReportResponse, type UploadOptions, type UploadPlan, UploadResumeStore, type UploadStrategy, UploadTelemetry, type UploadTelemetryConfig, type UploadTelemetryEvent, type UpsertEnvironmentRequest, type UsageRecord, type UsageSummary$1 as UsageSummary, type UserRank, type VideoInfo, VideoService, type VideoUploadOptions, WEB_PUSH_SERVICE_WORKER, WebPushManager, type WebPushManagerOptions, type WebPushSubscriptionData, type Webhook, WebhooksService, type WebrtcStats, type Workflow, type WorkflowExecution, type Workspace$1 as Workspace, type WorkspaceInvitation, type WorkspaceMember, WorkspacesService, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, extractClientContext, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, resolveStrategy, uploadMultipartToS3, uploadSingleToS3, validateIP };
|
package/dist/index.js
CHANGED
|
@@ -4352,6 +4352,18 @@ var ChatService = class extends ServiceModule {
|
|
|
4352
4352
|
return this.post(`/messages/${messageId}/reactions`, data, options);
|
|
4353
4353
|
}
|
|
4354
4354
|
// --------------------------------------------------------------------------
|
|
4355
|
+
// Pins
|
|
4356
|
+
// --------------------------------------------------------------------------
|
|
4357
|
+
async pinMessage(messageId, options) {
|
|
4358
|
+
return this.post(`/messages/${messageId}/pin`, void 0, options);
|
|
4359
|
+
}
|
|
4360
|
+
async unpinMessage(messageId, options) {
|
|
4361
|
+
return this.del(`/messages/${messageId}/pin`, options);
|
|
4362
|
+
}
|
|
4363
|
+
async getPinnedMessages(conversationId, options) {
|
|
4364
|
+
return this._get(`/conversations/${conversationId}/pins`, options);
|
|
4365
|
+
}
|
|
4366
|
+
// --------------------------------------------------------------------------
|
|
4355
4367
|
// Typing & Read Receipts
|
|
4356
4368
|
// --------------------------------------------------------------------------
|
|
4357
4369
|
async sendTyping(conversationId, options) {
|
|
@@ -4570,15 +4582,80 @@ var BillingService = class extends ServiceModule {
|
|
|
4570
4582
|
);
|
|
4571
4583
|
}
|
|
4572
4584
|
// --------------------------------------------------------------------------
|
|
4573
|
-
// Customers
|
|
4585
|
+
// Customers (legacy user-scoped — deprecated in favor of account-scoped)
|
|
4574
4586
|
// --------------------------------------------------------------------------
|
|
4587
|
+
/** @deprecated Use `getAccountCustomer({ account_id })`. Targets the user-scoped legacy endpoint. */
|
|
4575
4588
|
async createCustomer(data, options) {
|
|
4576
4589
|
return this.post("/customers", data, options);
|
|
4577
4590
|
}
|
|
4591
|
+
/** @deprecated Use `attachAccountPaymentMethod({ account_id }, ...)`. Targets the user-scoped legacy endpoint. */
|
|
4578
4592
|
async addPaymentMethod(data, options) {
|
|
4579
4593
|
return this.post("/payment-methods", data, options);
|
|
4580
4594
|
}
|
|
4581
4595
|
// --------------------------------------------------------------------------
|
|
4596
|
+
// Account-Scoped Billing (v2 — ADR-2026-04-25)
|
|
4597
|
+
//
|
|
4598
|
+
// The customer/payment-method/invoice record set belongs to an `app_account`
|
|
4599
|
+
// (typically a `customer_org`), not to a single user. These methods target
|
|
4600
|
+
// the `/v1/billing/accounts/{account_id}/*` endpoints described in
|
|
4601
|
+
// openapi/scalemule-money-billing-v1.yaml.
|
|
4602
|
+
// --------------------------------------------------------------------------
|
|
4603
|
+
accountBase(accountId) {
|
|
4604
|
+
return `/v1/billing/accounts/${encodeURIComponent(accountId)}`;
|
|
4605
|
+
}
|
|
4606
|
+
async getAccountCustomer(req, options) {
|
|
4607
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/customer`, {
|
|
4608
|
+
billing_mode: req.billing_mode
|
|
4609
|
+
});
|
|
4610
|
+
return this.client.get(path, options);
|
|
4611
|
+
}
|
|
4612
|
+
async listAccountPaymentMethods(req, options) {
|
|
4613
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/payment-methods`, {
|
|
4614
|
+
billing_mode: req.billing_mode
|
|
4615
|
+
});
|
|
4616
|
+
return this.client.get(path, options);
|
|
4617
|
+
}
|
|
4618
|
+
async attachAccountPaymentMethod(req, body, options) {
|
|
4619
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/payment-methods`, {
|
|
4620
|
+
billing_mode: req.billing_mode
|
|
4621
|
+
});
|
|
4622
|
+
return this.client.post(path, body, options);
|
|
4623
|
+
}
|
|
4624
|
+
async detachAccountPaymentMethod(req, paymentMethodId, options) {
|
|
4625
|
+
const path = this.withQuery(
|
|
4626
|
+
`${this.accountBase(req.account_id)}/payment-methods/${encodeURIComponent(paymentMethodId)}`,
|
|
4627
|
+
{ billing_mode: req.billing_mode }
|
|
4628
|
+
);
|
|
4629
|
+
return this.client.del(path, options);
|
|
4630
|
+
}
|
|
4631
|
+
async setDefaultAccountPaymentMethod(req, paymentMethodId, options) {
|
|
4632
|
+
const path = this.withQuery(
|
|
4633
|
+
`${this.accountBase(req.account_id)}/payment-methods/${encodeURIComponent(paymentMethodId)}/default`,
|
|
4634
|
+
{ billing_mode: req.billing_mode }
|
|
4635
|
+
);
|
|
4636
|
+
return this.client.put(path, void 0, options);
|
|
4637
|
+
}
|
|
4638
|
+
async listAccountInvoices(req, params, options) {
|
|
4639
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices`, {
|
|
4640
|
+
billing_mode: req.billing_mode,
|
|
4641
|
+
limit: params?.limit,
|
|
4642
|
+
cursor: params?.cursor
|
|
4643
|
+
});
|
|
4644
|
+
return this.client.get(path, options);
|
|
4645
|
+
}
|
|
4646
|
+
async getAccountInvoice(req, invoiceId, options) {
|
|
4647
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices/${encodeURIComponent(invoiceId)}`, {
|
|
4648
|
+
billing_mode: req.billing_mode
|
|
4649
|
+
});
|
|
4650
|
+
return this.client.get(path, options);
|
|
4651
|
+
}
|
|
4652
|
+
async createAccountPortalSession(req, body, options) {
|
|
4653
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/portal-session`, {
|
|
4654
|
+
billing_mode: req.billing_mode
|
|
4655
|
+
});
|
|
4656
|
+
return this.client.post(path, body ?? {}, options);
|
|
4657
|
+
}
|
|
4658
|
+
// --------------------------------------------------------------------------
|
|
4582
4659
|
// Subscriptions
|
|
4583
4660
|
// --------------------------------------------------------------------------
|
|
4584
4661
|
async subscribe(data, options) {
|
package/dist/index.mjs
CHANGED
|
@@ -3980,6 +3980,18 @@ var ChatService = class extends ServiceModule {
|
|
|
3980
3980
|
return this.post(`/messages/${messageId}/reactions`, data, options);
|
|
3981
3981
|
}
|
|
3982
3982
|
// --------------------------------------------------------------------------
|
|
3983
|
+
// Pins
|
|
3984
|
+
// --------------------------------------------------------------------------
|
|
3985
|
+
async pinMessage(messageId, options) {
|
|
3986
|
+
return this.post(`/messages/${messageId}/pin`, void 0, options);
|
|
3987
|
+
}
|
|
3988
|
+
async unpinMessage(messageId, options) {
|
|
3989
|
+
return this.del(`/messages/${messageId}/pin`, options);
|
|
3990
|
+
}
|
|
3991
|
+
async getPinnedMessages(conversationId, options) {
|
|
3992
|
+
return this._get(`/conversations/${conversationId}/pins`, options);
|
|
3993
|
+
}
|
|
3994
|
+
// --------------------------------------------------------------------------
|
|
3983
3995
|
// Typing & Read Receipts
|
|
3984
3996
|
// --------------------------------------------------------------------------
|
|
3985
3997
|
async sendTyping(conversationId, options) {
|
|
@@ -4198,15 +4210,80 @@ var BillingService = class extends ServiceModule {
|
|
|
4198
4210
|
);
|
|
4199
4211
|
}
|
|
4200
4212
|
// --------------------------------------------------------------------------
|
|
4201
|
-
// Customers
|
|
4213
|
+
// Customers (legacy user-scoped — deprecated in favor of account-scoped)
|
|
4202
4214
|
// --------------------------------------------------------------------------
|
|
4215
|
+
/** @deprecated Use `getAccountCustomer({ account_id })`. Targets the user-scoped legacy endpoint. */
|
|
4203
4216
|
async createCustomer(data, options) {
|
|
4204
4217
|
return this.post("/customers", data, options);
|
|
4205
4218
|
}
|
|
4219
|
+
/** @deprecated Use `attachAccountPaymentMethod({ account_id }, ...)`. Targets the user-scoped legacy endpoint. */
|
|
4206
4220
|
async addPaymentMethod(data, options) {
|
|
4207
4221
|
return this.post("/payment-methods", data, options);
|
|
4208
4222
|
}
|
|
4209
4223
|
// --------------------------------------------------------------------------
|
|
4224
|
+
// Account-Scoped Billing (v2 — ADR-2026-04-25)
|
|
4225
|
+
//
|
|
4226
|
+
// The customer/payment-method/invoice record set belongs to an `app_account`
|
|
4227
|
+
// (typically a `customer_org`), not to a single user. These methods target
|
|
4228
|
+
// the `/v1/billing/accounts/{account_id}/*` endpoints described in
|
|
4229
|
+
// openapi/scalemule-money-billing-v1.yaml.
|
|
4230
|
+
// --------------------------------------------------------------------------
|
|
4231
|
+
accountBase(accountId) {
|
|
4232
|
+
return `/v1/billing/accounts/${encodeURIComponent(accountId)}`;
|
|
4233
|
+
}
|
|
4234
|
+
async getAccountCustomer(req, options) {
|
|
4235
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/customer`, {
|
|
4236
|
+
billing_mode: req.billing_mode
|
|
4237
|
+
});
|
|
4238
|
+
return this.client.get(path, options);
|
|
4239
|
+
}
|
|
4240
|
+
async listAccountPaymentMethods(req, options) {
|
|
4241
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/payment-methods`, {
|
|
4242
|
+
billing_mode: req.billing_mode
|
|
4243
|
+
});
|
|
4244
|
+
return this.client.get(path, options);
|
|
4245
|
+
}
|
|
4246
|
+
async attachAccountPaymentMethod(req, body, options) {
|
|
4247
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/payment-methods`, {
|
|
4248
|
+
billing_mode: req.billing_mode
|
|
4249
|
+
});
|
|
4250
|
+
return this.client.post(path, body, options);
|
|
4251
|
+
}
|
|
4252
|
+
async detachAccountPaymentMethod(req, paymentMethodId, options) {
|
|
4253
|
+
const path = this.withQuery(
|
|
4254
|
+
`${this.accountBase(req.account_id)}/payment-methods/${encodeURIComponent(paymentMethodId)}`,
|
|
4255
|
+
{ billing_mode: req.billing_mode }
|
|
4256
|
+
);
|
|
4257
|
+
return this.client.del(path, options);
|
|
4258
|
+
}
|
|
4259
|
+
async setDefaultAccountPaymentMethod(req, paymentMethodId, options) {
|
|
4260
|
+
const path = this.withQuery(
|
|
4261
|
+
`${this.accountBase(req.account_id)}/payment-methods/${encodeURIComponent(paymentMethodId)}/default`,
|
|
4262
|
+
{ billing_mode: req.billing_mode }
|
|
4263
|
+
);
|
|
4264
|
+
return this.client.put(path, void 0, options);
|
|
4265
|
+
}
|
|
4266
|
+
async listAccountInvoices(req, params, options) {
|
|
4267
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices`, {
|
|
4268
|
+
billing_mode: req.billing_mode,
|
|
4269
|
+
limit: params?.limit,
|
|
4270
|
+
cursor: params?.cursor
|
|
4271
|
+
});
|
|
4272
|
+
return this.client.get(path, options);
|
|
4273
|
+
}
|
|
4274
|
+
async getAccountInvoice(req, invoiceId, options) {
|
|
4275
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/invoices/${encodeURIComponent(invoiceId)}`, {
|
|
4276
|
+
billing_mode: req.billing_mode
|
|
4277
|
+
});
|
|
4278
|
+
return this.client.get(path, options);
|
|
4279
|
+
}
|
|
4280
|
+
async createAccountPortalSession(req, body, options) {
|
|
4281
|
+
const path = this.withQuery(`${this.accountBase(req.account_id)}/portal-session`, {
|
|
4282
|
+
billing_mode: req.billing_mode
|
|
4283
|
+
});
|
|
4284
|
+
return this.client.post(path, body ?? {}, options);
|
|
4285
|
+
}
|
|
4286
|
+
// --------------------------------------------------------------------------
|
|
4210
4287
|
// Subscriptions
|
|
4211
4288
|
// --------------------------------------------------------------------------
|
|
4212
4289
|
async subscribe(data, options) {
|