@scalemule/sdk 0.0.80 → 0.0.81

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 CHANGED
@@ -6208,6 +6208,149 @@ declare class WebhooksService extends ServiceModule {
6208
6208
  }>>;
6209
6209
  }
6210
6210
 
6211
+ /**
6212
+ * Newsletters Service Module
6213
+ *
6214
+ * Reader-side newsletter subscriptions with compliance-grade consent
6215
+ * evidence. The gateway records the reader's IP, browser, device fingerprint
6216
+ * and location on every call, so sign-ups made from the reader's browser
6217
+ * carry their own proof. Server-side apps forwarding a reader request must
6218
+ * use the server helper in `@scalemule/nextjs` so the reader's evidence (not
6219
+ * the server's) is recorded.
6220
+ *
6221
+ * Routes (all under /v1/newsletters):
6222
+ * GET /lists → active lists + consent text to show
6223
+ * POST /lists/{slug}/subscriptions → sign up (double opt-in email)
6224
+ * POST /subscriptions/confirm → confirm from the email link token
6225
+ * POST /unsubscribe → opt out with an unsubscribe token
6226
+ * GET /preferences?token= → preference centre (email-only readers)
6227
+ * PUT /preferences?token= → change cadence / pause / resume
6228
+ * GET /me/subscriptions → signed-in reader's subscriptions
6229
+ * PUT /me/subscriptions → signed-in reader changes
6230
+ */
6231
+
6232
+ /** `edition` = one email per published edition. Lists choose which they offer. */
6233
+ type NewsletterCadence = 'daily' | 'weekly' | 'edition' | (string & NonNullable<unknown>);
6234
+ /** A list a form can offer, with the consent text the form must display. */
6235
+ interface NewsletterList {
6236
+ id: string;
6237
+ slug: string;
6238
+ name: string;
6239
+ description: string | null;
6240
+ kind: 'digest' | 'campaign' | 'announcement';
6241
+ channels: string[];
6242
+ cadence_options: NewsletterCadence[];
6243
+ default_cadence: NewsletterCadence;
6244
+ default_timezone: string;
6245
+ double_opt_in_required: boolean;
6246
+ /** Show `consent_text` next to an unticked checkbox; null when no policy is published. */
6247
+ policy: {
6248
+ version: string;
6249
+ consent_text: string;
6250
+ privacy_policy_url: string | null;
6251
+ } | null;
6252
+ }
6253
+ interface NewsletterSubscribeInput {
6254
+ email?: string;
6255
+ /** Must be true: the reader ticked an unticked consent box. */
6256
+ consent: true;
6257
+ channel?: 'email';
6258
+ cadence?: NewsletterCadence;
6259
+ /** IANA timezone, e.g. `America/Los_Angeles`. */
6260
+ timezone?: string;
6261
+ /** Where the form lives, e.g. `footer`, `article_inline`. */
6262
+ collection_point?: string;
6263
+ collection_url?: string;
6264
+ placement?: string;
6265
+ /** What the reader was looking at, e.g. an article path. */
6266
+ origin_ref?: string;
6267
+ locale?: string;
6268
+ }
6269
+ /**
6270
+ * Sign-up result. `check_email` is returned whether or not the address was
6271
+ * new (no account enumeration); `active` only when the list skips double
6272
+ * opt-in.
6273
+ */
6274
+ type NewsletterSubscribeResult = {
6275
+ status: 'check_email';
6276
+ } | {
6277
+ status: 'active';
6278
+ /** The signed-in reader's verified address was already subscribed. */
6279
+ already_subscribed?: boolean;
6280
+ list?: {
6281
+ slug: string;
6282
+ name: string;
6283
+ };
6284
+ cadence: NewsletterCadence;
6285
+ next_delivery_at?: string | null;
6286
+ };
6287
+ interface NewsletterConfirmResult {
6288
+ status: 'active';
6289
+ already_confirmed: boolean;
6290
+ list: {
6291
+ slug: string;
6292
+ name: string;
6293
+ };
6294
+ cadence: NewsletterCadence;
6295
+ next_delivery_at?: string | null;
6296
+ /** Preference-centre link for this reader (bearer token inside: do not log). */
6297
+ manage_url?: string;
6298
+ placement: string | null;
6299
+ origin_ref: string | null;
6300
+ }
6301
+ interface NewsletterSubscription {
6302
+ subscription_id: string;
6303
+ list_id: string;
6304
+ slug: string;
6305
+ name: string;
6306
+ cadence_options: NewsletterCadence[];
6307
+ channel: string;
6308
+ cadence: NewsletterCadence;
6309
+ timezone: string;
6310
+ status: 'active' | 'unconfirmed' | 'paused' | 'unsubscribed' | 'suppressed';
6311
+ confirmed_at: string | null;
6312
+ next_delivery_at: string | null;
6313
+ /** Send back as `expected_revision`; a stale value is rejected with 409. */
6314
+ revision: number;
6315
+ }
6316
+ interface NewsletterPreferenceChange {
6317
+ subscription_id: string;
6318
+ expected_revision: number;
6319
+ cadence?: NewsletterCadence;
6320
+ timezone?: string;
6321
+ /** false pauses or unsubscribes, true resumes. */
6322
+ active?: boolean;
6323
+ }
6324
+ declare class NewslettersService extends ServiceModule {
6325
+ protected basePath: string;
6326
+ /** Active lists of this application, with the consent text each form must show. */
6327
+ lists(options?: RequestOptions): Promise<ApiResponse<{
6328
+ lists: NewsletterList[];
6329
+ }>>;
6330
+ /** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
6331
+ subscribe(slug: string, input: NewsletterSubscribeInput, options?: RequestOptions): Promise<ApiResponse<NewsletterSubscribeResult>>;
6332
+ /** Confirms a sign-up with the token from the confirmation email link. */
6333
+ confirm(token: string, options?: RequestOptions): Promise<ApiResponse<NewsletterConfirmResult>>;
6334
+ /** Opts out with the token from an unsubscribe link. Always succeeds for a well-formed token. */
6335
+ unsubscribe(token: string, reason?: string, options?: RequestOptions): Promise<ApiResponse<{
6336
+ unsubscribed: boolean;
6337
+ }>>;
6338
+ /** Preference centre for readers without an account (token from the manage link). */
6339
+ preferences(token: string, options?: RequestOptions): Promise<ApiResponse<{
6340
+ subscriptions: NewsletterSubscription[];
6341
+ }>>;
6342
+ updatePreferences(token: string, changes: NewsletterPreferenceChange[], options?: RequestOptions): Promise<ApiResponse<{
6343
+ subscriptions: NewsletterSubscription[];
6344
+ }>>;
6345
+ /** The signed-in reader's subscriptions (verified account email only). */
6346
+ mySubscriptions(options?: RequestOptions): Promise<ApiResponse<{
6347
+ subscriptions: NewsletterSubscription[];
6348
+ }>>;
6349
+ updateMySubscriptions(changes: NewsletterPreferenceChange[], options?: RequestOptions): Promise<ApiResponse<{
6350
+ subscriptions: NewsletterSubscription[];
6351
+ }>>;
6352
+ }
6353
+
6211
6354
  /**
6212
6355
  * Search Service Module
6213
6356
  *
@@ -8532,6 +8675,7 @@ declare class ScaleMule {
8532
8675
  readonly search: SearchService;
8533
8676
  readonly logger: LoggerService;
8534
8677
  readonly webhooks: WebhooksService;
8678
+ readonly newsletters: NewslettersService;
8535
8679
  readonly leaderboard: LeaderboardService;
8536
8680
  readonly listings: ListingsService;
8537
8681
  readonly communityMaps: CommunityMapsService;
@@ -8618,4 +8762,4 @@ declare class ScaleMule {
8618
8762
  getClient(): ScaleMuleClient;
8619
8763
  }
8620
8764
 
8621
- 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 CommunityMapDevicePosition, type CommunityMapDevicePositionMethod, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapMediaReceipt, type CommunityMapOwnSubmission, type CommunityMapOwnSubmissionPage, type CommunityMapPage, type CommunityMapPhotoCapture, 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 CommunityValueOutcome, 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, ExperimentAssignment, 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 IntelligenceAction, type IntelligenceCache, type IntelligenceChangePage, type IntelligenceClaim, type IntelligenceEvent, type IntelligenceKind, type IntelligenceRecordPage, type IntelligenceRelease, type IntelligenceReleaseReceipt, type IntelligenceSection, type IntelligenceSource, type IntelligenceStatus, type IntelligenceVerification, 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 LocalBriefing, type LocalIntelligencePreferences, type LocalIntelligenceRecord, LocalIntelligenceService, 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, applyIntelligenceChanges, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, devicePositionPayload, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, prepareCommunityMapAttachment, readAnonymousId, resolveStrategy, startMediaCapture, uploadMultipartToS3, uploadSingleToS3, validateIP };
8765
+ 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 CommunityMapDevicePosition, type CommunityMapDevicePositionMethod, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapMediaReceipt, type CommunityMapOwnSubmission, type CommunityMapOwnSubmissionPage, type CommunityMapPage, type CommunityMapPhotoCapture, 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 CommunityValueOutcome, 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, ExperimentAssignment, 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 IntelligenceAction, type IntelligenceCache, type IntelligenceChangePage, type IntelligenceClaim, type IntelligenceEvent, type IntelligenceKind, type IntelligenceRecordPage, type IntelligenceRelease, type IntelligenceReleaseReceipt, type IntelligenceSection, type IntelligenceSource, type IntelligenceStatus, type IntelligenceVerification, 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 LocalBriefing, type LocalIntelligencePreferences, type LocalIntelligenceRecord, LocalIntelligenceService, 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 NewsletterCadence, type NewsletterConfirmResult, type NewsletterList, type NewsletterPreferenceChange, type NewsletterSubscribeInput, type NewsletterSubscribeResult, type NewsletterSubscription, NewslettersService, 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, applyIntelligenceChanges, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, devicePositionPayload, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, prepareCommunityMapAttachment, readAnonymousId, resolveStrategy, startMediaCapture, uploadMultipartToS3, uploadSingleToS3, validateIP };
package/dist/index.d.ts CHANGED
@@ -6208,6 +6208,149 @@ declare class WebhooksService extends ServiceModule {
6208
6208
  }>>;
6209
6209
  }
6210
6210
 
6211
+ /**
6212
+ * Newsletters Service Module
6213
+ *
6214
+ * Reader-side newsletter subscriptions with compliance-grade consent
6215
+ * evidence. The gateway records the reader's IP, browser, device fingerprint
6216
+ * and location on every call, so sign-ups made from the reader's browser
6217
+ * carry their own proof. Server-side apps forwarding a reader request must
6218
+ * use the server helper in `@scalemule/nextjs` so the reader's evidence (not
6219
+ * the server's) is recorded.
6220
+ *
6221
+ * Routes (all under /v1/newsletters):
6222
+ * GET /lists → active lists + consent text to show
6223
+ * POST /lists/{slug}/subscriptions → sign up (double opt-in email)
6224
+ * POST /subscriptions/confirm → confirm from the email link token
6225
+ * POST /unsubscribe → opt out with an unsubscribe token
6226
+ * GET /preferences?token= → preference centre (email-only readers)
6227
+ * PUT /preferences?token= → change cadence / pause / resume
6228
+ * GET /me/subscriptions → signed-in reader's subscriptions
6229
+ * PUT /me/subscriptions → signed-in reader changes
6230
+ */
6231
+
6232
+ /** `edition` = one email per published edition. Lists choose which they offer. */
6233
+ type NewsletterCadence = 'daily' | 'weekly' | 'edition' | (string & NonNullable<unknown>);
6234
+ /** A list a form can offer, with the consent text the form must display. */
6235
+ interface NewsletterList {
6236
+ id: string;
6237
+ slug: string;
6238
+ name: string;
6239
+ description: string | null;
6240
+ kind: 'digest' | 'campaign' | 'announcement';
6241
+ channels: string[];
6242
+ cadence_options: NewsletterCadence[];
6243
+ default_cadence: NewsletterCadence;
6244
+ default_timezone: string;
6245
+ double_opt_in_required: boolean;
6246
+ /** Show `consent_text` next to an unticked checkbox; null when no policy is published. */
6247
+ policy: {
6248
+ version: string;
6249
+ consent_text: string;
6250
+ privacy_policy_url: string | null;
6251
+ } | null;
6252
+ }
6253
+ interface NewsletterSubscribeInput {
6254
+ email?: string;
6255
+ /** Must be true: the reader ticked an unticked consent box. */
6256
+ consent: true;
6257
+ channel?: 'email';
6258
+ cadence?: NewsletterCadence;
6259
+ /** IANA timezone, e.g. `America/Los_Angeles`. */
6260
+ timezone?: string;
6261
+ /** Where the form lives, e.g. `footer`, `article_inline`. */
6262
+ collection_point?: string;
6263
+ collection_url?: string;
6264
+ placement?: string;
6265
+ /** What the reader was looking at, e.g. an article path. */
6266
+ origin_ref?: string;
6267
+ locale?: string;
6268
+ }
6269
+ /**
6270
+ * Sign-up result. `check_email` is returned whether or not the address was
6271
+ * new (no account enumeration); `active` only when the list skips double
6272
+ * opt-in.
6273
+ */
6274
+ type NewsletterSubscribeResult = {
6275
+ status: 'check_email';
6276
+ } | {
6277
+ status: 'active';
6278
+ /** The signed-in reader's verified address was already subscribed. */
6279
+ already_subscribed?: boolean;
6280
+ list?: {
6281
+ slug: string;
6282
+ name: string;
6283
+ };
6284
+ cadence: NewsletterCadence;
6285
+ next_delivery_at?: string | null;
6286
+ };
6287
+ interface NewsletterConfirmResult {
6288
+ status: 'active';
6289
+ already_confirmed: boolean;
6290
+ list: {
6291
+ slug: string;
6292
+ name: string;
6293
+ };
6294
+ cadence: NewsletterCadence;
6295
+ next_delivery_at?: string | null;
6296
+ /** Preference-centre link for this reader (bearer token inside: do not log). */
6297
+ manage_url?: string;
6298
+ placement: string | null;
6299
+ origin_ref: string | null;
6300
+ }
6301
+ interface NewsletterSubscription {
6302
+ subscription_id: string;
6303
+ list_id: string;
6304
+ slug: string;
6305
+ name: string;
6306
+ cadence_options: NewsletterCadence[];
6307
+ channel: string;
6308
+ cadence: NewsletterCadence;
6309
+ timezone: string;
6310
+ status: 'active' | 'unconfirmed' | 'paused' | 'unsubscribed' | 'suppressed';
6311
+ confirmed_at: string | null;
6312
+ next_delivery_at: string | null;
6313
+ /** Send back as `expected_revision`; a stale value is rejected with 409. */
6314
+ revision: number;
6315
+ }
6316
+ interface NewsletterPreferenceChange {
6317
+ subscription_id: string;
6318
+ expected_revision: number;
6319
+ cadence?: NewsletterCadence;
6320
+ timezone?: string;
6321
+ /** false pauses or unsubscribes, true resumes. */
6322
+ active?: boolean;
6323
+ }
6324
+ declare class NewslettersService extends ServiceModule {
6325
+ protected basePath: string;
6326
+ /** Active lists of this application, with the consent text each form must show. */
6327
+ lists(options?: RequestOptions): Promise<ApiResponse<{
6328
+ lists: NewsletterList[];
6329
+ }>>;
6330
+ /** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
6331
+ subscribe(slug: string, input: NewsletterSubscribeInput, options?: RequestOptions): Promise<ApiResponse<NewsletterSubscribeResult>>;
6332
+ /** Confirms a sign-up with the token from the confirmation email link. */
6333
+ confirm(token: string, options?: RequestOptions): Promise<ApiResponse<NewsletterConfirmResult>>;
6334
+ /** Opts out with the token from an unsubscribe link. Always succeeds for a well-formed token. */
6335
+ unsubscribe(token: string, reason?: string, options?: RequestOptions): Promise<ApiResponse<{
6336
+ unsubscribed: boolean;
6337
+ }>>;
6338
+ /** Preference centre for readers without an account (token from the manage link). */
6339
+ preferences(token: string, options?: RequestOptions): Promise<ApiResponse<{
6340
+ subscriptions: NewsletterSubscription[];
6341
+ }>>;
6342
+ updatePreferences(token: string, changes: NewsletterPreferenceChange[], options?: RequestOptions): Promise<ApiResponse<{
6343
+ subscriptions: NewsletterSubscription[];
6344
+ }>>;
6345
+ /** The signed-in reader's subscriptions (verified account email only). */
6346
+ mySubscriptions(options?: RequestOptions): Promise<ApiResponse<{
6347
+ subscriptions: NewsletterSubscription[];
6348
+ }>>;
6349
+ updateMySubscriptions(changes: NewsletterPreferenceChange[], options?: RequestOptions): Promise<ApiResponse<{
6350
+ subscriptions: NewsletterSubscription[];
6351
+ }>>;
6352
+ }
6353
+
6211
6354
  /**
6212
6355
  * Search Service Module
6213
6356
  *
@@ -8532,6 +8675,7 @@ declare class ScaleMule {
8532
8675
  readonly search: SearchService;
8533
8676
  readonly logger: LoggerService;
8534
8677
  readonly webhooks: WebhooksService;
8678
+ readonly newsletters: NewslettersService;
8535
8679
  readonly leaderboard: LeaderboardService;
8536
8680
  readonly listings: ListingsService;
8537
8681
  readonly communityMaps: CommunityMapsService;
@@ -8618,4 +8762,4 @@ declare class ScaleMule {
8618
8762
  getClient(): ScaleMuleClient;
8619
8763
  }
8620
8764
 
8621
- 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 CommunityMapDevicePosition, type CommunityMapDevicePositionMethod, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapMediaReceipt, type CommunityMapOwnSubmission, type CommunityMapOwnSubmissionPage, type CommunityMapPage, type CommunityMapPhotoCapture, 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 CommunityValueOutcome, 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, ExperimentAssignment, 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 IntelligenceAction, type IntelligenceCache, type IntelligenceChangePage, type IntelligenceClaim, type IntelligenceEvent, type IntelligenceKind, type IntelligenceRecordPage, type IntelligenceRelease, type IntelligenceReleaseReceipt, type IntelligenceSection, type IntelligenceSource, type IntelligenceStatus, type IntelligenceVerification, 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 LocalBriefing, type LocalIntelligencePreferences, type LocalIntelligenceRecord, LocalIntelligenceService, 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, applyIntelligenceChanges, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, devicePositionPayload, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, prepareCommunityMapAttachment, readAnonymousId, resolveStrategy, startMediaCapture, uploadMultipartToS3, uploadSingleToS3, validateIP };
8765
+ 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 CommunityMapDevicePosition, type CommunityMapDevicePositionMethod, type CommunityMapEditorialCollection, type CommunityMapEditorialComment, type CommunityMapEditorialFeature, type CommunityMapEditorialMedia, type CommunityMapFeature, type CommunityMapFeatureDraft, type CommunityMapFeatureQuery, type CommunityMapFeatureStatus, type CommunityMapGeometry, type CommunityMapMedia, type CommunityMapMediaReceipt, type CommunityMapOwnSubmission, type CommunityMapOwnSubmissionPage, type CommunityMapPage, type CommunityMapPhotoCapture, 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 CommunityValueOutcome, 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, ExperimentAssignment, 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 IntelligenceAction, type IntelligenceCache, type IntelligenceChangePage, type IntelligenceClaim, type IntelligenceEvent, type IntelligenceKind, type IntelligenceRecordPage, type IntelligenceRelease, type IntelligenceReleaseReceipt, type IntelligenceSection, type IntelligenceSource, type IntelligenceStatus, type IntelligenceVerification, 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 LocalBriefing, type LocalIntelligencePreferences, type LocalIntelligenceRecord, LocalIntelligenceService, 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 NewsletterCadence, type NewsletterConfirmResult, type NewsletterList, type NewsletterPreferenceChange, type NewsletterSubscribeInput, type NewsletterSubscribeResult, type NewsletterSubscription, NewslettersService, 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, applyIntelligenceChanges, buildClientContextHeaders, calculateTotalParts, canPerform, createUploadPlan, ScaleMule as default, detectNetworkClass, devicePositionPayload, ensureAnonymousId, extractClientContext, generateAnonymousId, generateUploadSessionId, getMeasuredBandwidthMbps, getPartRange, hasMinRoleLevel, pollSharePercent, pollVoterKey, prepareCommunityMapAttachment, readAnonymousId, resolveStrategy, startMediaCapture, uploadMultipartToS3, uploadSingleToS3, validateIP };
package/dist/index.js CHANGED
@@ -346,6 +346,7 @@ __export(index_exports, {
346
346
  MAX_EXPERIMENTS_PER_EVENT: () => MAX_EXPERIMENTS_PER_EVENT,
347
347
  MEDIA_PRESETS: () => MEDIA_PRESETS,
348
348
  MediaService: () => MediaService,
349
+ NewslettersService: () => NewslettersService,
349
350
  NotificationsService: () => NotificationsService,
350
351
  OrchestratorService: () => OrchestratorService,
351
352
  PHONE_COUNTRIES: () => PHONE_COUNTRIES,
@@ -7520,6 +7521,52 @@ var WebhooksService = class extends ServiceModule {
7520
7521
  }
7521
7522
  };
7522
7523
 
7524
+ // src/services/newsletters.ts
7525
+ var NewslettersService = class extends ServiceModule {
7526
+ constructor() {
7527
+ super(...arguments);
7528
+ this.basePath = "/v1/newsletters";
7529
+ }
7530
+ /** Active lists of this application, with the consent text each form must show. */
7531
+ async lists(options) {
7532
+ return this._get("/lists", options);
7533
+ }
7534
+ /** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
7535
+ async subscribe(slug, input, options) {
7536
+ return this.post(
7537
+ `/lists/${encodeURIComponent(slug)}/subscriptions`,
7538
+ { channel: "email", ...input },
7539
+ { skipRetry: true, ...options }
7540
+ );
7541
+ }
7542
+ /** Confirms a sign-up with the token from the confirmation email link. */
7543
+ async confirm(token, options) {
7544
+ return this.post("/subscriptions/confirm", { token }, options);
7545
+ }
7546
+ /** Opts out with the token from an unsubscribe link. Always succeeds for a well-formed token. */
7547
+ async unsubscribe(token, reason, options) {
7548
+ return this.post("/unsubscribe", reason ? { token, reason } : { token }, options);
7549
+ }
7550
+ /** Preference centre for readers without an account (token from the manage link). */
7551
+ async preferences(token, options) {
7552
+ return this._get(this.withQuery("/preferences", { token }), options);
7553
+ }
7554
+ async updatePreferences(token, changes, options) {
7555
+ return this.put(
7556
+ this.withQuery("/preferences", { token }),
7557
+ { changes },
7558
+ options
7559
+ );
7560
+ }
7561
+ /** The signed-in reader's subscriptions (verified account email only). */
7562
+ async mySubscriptions(options) {
7563
+ return this._get("/me/subscriptions", options);
7564
+ }
7565
+ async updateMySubscriptions(changes, options) {
7566
+ return this.put("/me/subscriptions", { changes }, options);
7567
+ }
7568
+ };
7569
+
7523
7570
  // src/services/search.ts
7524
7571
  var SearchService = class extends ServiceModule {
7525
7572
  constructor() {
@@ -9473,6 +9520,7 @@ var ScaleMule = class {
9473
9520
  this.search = new SearchService(this._client);
9474
9521
  this.logger = new LoggerService(this._client);
9475
9522
  this.webhooks = new WebhooksService(this._client);
9523
+ this.newsletters = new NewslettersService(this._client);
9476
9524
  this.leaderboard = new LeaderboardService(this._client);
9477
9525
  this.listings = new ListingsService(this._client);
9478
9526
  this.communityMaps = new CommunityMapsService(this._client);
@@ -9662,6 +9710,7 @@ var index_default = ScaleMule;
9662
9710
  MAX_EXPERIMENTS_PER_EVENT,
9663
9711
  MEDIA_PRESETS,
9664
9712
  MediaService,
9713
+ NewslettersService,
9665
9714
  NotificationsService,
9666
9715
  OrchestratorService,
9667
9716
  PHONE_COUNTRIES,
package/dist/index.mjs CHANGED
@@ -7383,6 +7383,52 @@ var WebhooksService = class extends ServiceModule {
7383
7383
  }
7384
7384
  };
7385
7385
 
7386
+ // src/services/newsletters.ts
7387
+ var NewslettersService = class extends ServiceModule {
7388
+ constructor() {
7389
+ super(...arguments);
7390
+ this.basePath = "/v1/newsletters";
7391
+ }
7392
+ /** Active lists of this application, with the consent text each form must show. */
7393
+ async lists(options) {
7394
+ return this._get("/lists", options);
7395
+ }
7396
+ /** Signs a reader up. Call from the reader's browser so their own evidence is recorded. */
7397
+ async subscribe(slug, input, options) {
7398
+ return this.post(
7399
+ `/lists/${encodeURIComponent(slug)}/subscriptions`,
7400
+ { channel: "email", ...input },
7401
+ { skipRetry: true, ...options }
7402
+ );
7403
+ }
7404
+ /** Confirms a sign-up with the token from the confirmation email link. */
7405
+ async confirm(token, options) {
7406
+ return this.post("/subscriptions/confirm", { token }, options);
7407
+ }
7408
+ /** Opts out with the token from an unsubscribe link. Always succeeds for a well-formed token. */
7409
+ async unsubscribe(token, reason, options) {
7410
+ return this.post("/unsubscribe", reason ? { token, reason } : { token }, options);
7411
+ }
7412
+ /** Preference centre for readers without an account (token from the manage link). */
7413
+ async preferences(token, options) {
7414
+ return this._get(this.withQuery("/preferences", { token }), options);
7415
+ }
7416
+ async updatePreferences(token, changes, options) {
7417
+ return this.put(
7418
+ this.withQuery("/preferences", { token }),
7419
+ { changes },
7420
+ options
7421
+ );
7422
+ }
7423
+ /** The signed-in reader's subscriptions (verified account email only). */
7424
+ async mySubscriptions(options) {
7425
+ return this._get("/me/subscriptions", options);
7426
+ }
7427
+ async updateMySubscriptions(changes, options) {
7428
+ return this.put("/me/subscriptions", { changes }, options);
7429
+ }
7430
+ };
7431
+
7386
7432
  // src/services/search.ts
7387
7433
  var SearchService = class extends ServiceModule {
7388
7434
  constructor() {
@@ -9336,6 +9382,7 @@ var ScaleMule = class {
9336
9382
  this.search = new SearchService(this._client);
9337
9383
  this.logger = new LoggerService(this._client);
9338
9384
  this.webhooks = new WebhooksService(this._client);
9385
+ this.newsletters = new NewslettersService(this._client);
9339
9386
  this.leaderboard = new LeaderboardService(this._client);
9340
9387
  this.listings = new ListingsService(this._client);
9341
9388
  this.communityMaps = new CommunityMapsService(this._client);
@@ -9524,6 +9571,7 @@ export {
9524
9571
  MAX_EXPERIMENTS_PER_EVENT,
9525
9572
  MEDIA_PRESETS,
9526
9573
  MediaService,
9574
+ NewslettersService,
9527
9575
  NotificationsService,
9528
9576
  OrchestratorService,
9529
9577
  PHONE_COUNTRIES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scalemule/sdk",
3
- "version": "0.0.80",
3
+ "version": "0.0.81",
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",