import type { ActivityStore } from "./activity-log.js"; import { type EmbedLayoutCounts, type EmbedLayoutInput, type EmbedPresentationReview, type NormalizedEmbedPresentation } from "./embed-layout.js"; import type { DiscordClient } from "./discord-client.js"; import { InteractionLimiter } from "./interaction-limiter.js"; import { type OperationReceipt, type OperationStore } from "./operation-store.js"; import { type DiscordPermissionName } from "./permissions.js"; import type { ScopePolicy } from "./policy.js"; import type { RequestOptions } from "./types.js"; export declare const EMBED_MESSAGE_ACTIONS: readonly ["create", "edit"]; export type EmbedMessageAction = typeof EMBED_MESSAGE_ACTIONS[number]; export type EmbedMessageContentIntentStatus = "disabled" | "enabled" | "unknown"; declare const PRIVACY_OMITTED_FIELDS: readonly ["attachmentUrls", "embedLayouts", "embedText", "messageContent", "mentionProfiles", "nonce", "notificationUserIds", "parsedUserMentionIds", "rawOperationKey", "rawPayloads", "replyAuthorId"]; export interface EmbedMessageRequest { action: EmbedMessageAction; channelId: string; content?: string; embeds: readonly EmbedLayoutInput[]; messageId?: string; notifyReplyAuthor?: boolean; notifyUserIds?: readonly string[]; operationKey: string; replyToMessageId?: string; } export interface NormalizedEmbedMessageRequest { action: EmbedMessageAction; channelId: string; messageId: string | null; notifyReplyAuthor: boolean; notifyUserIds: string[]; operationKey: string; operationKeyHash: string; presentation: NormalizedEmbedPresentation; replyToMessageId: string | null; review: EmbedPresentationReview; } export interface EmbedMessagePrivacyProjection { durableRecords: "content-free"; omittedFields: typeof PRIVACY_OMITTED_FIELDS; planPersistence: "none"; rawPayloads: "omitted"; } export interface EmbedMessagePermissionEvidence { administrator: boolean; appliedRoleIds: string[]; canReadMessages: true; confidence: "complete"; effectivePermissionNames: DiscordPermissionName[]; effectivePermissions: string; permissionSourceChannelId: string; privateThreadAccess: "lookup-succeeded" | "not-applicable"; requiredPermissionNames: DiscordPermissionName[]; } export interface EmbedMessagePlan { action: EmbedMessageAction; applicationId: string; botId: string; channel: { guildId: string; id: string; parentId: string | null; type: number; }; createdAt: string; current: { flags: number; messageId: string; parsedUserMentionIds: string[]; pinned: boolean; presentation: NormalizedEmbedPresentation; preview: string; timestamp: string; } | null; digest: string; guild: { id: string; name: string; }; messageContentIntent: "enabled"; notificationUserIds: string[]; notifyReplyAuthor: boolean; operationKeyHash: string; permission: EmbedMessagePermissionEvidence; privacy: EmbedMessagePrivacyProjection; reply: { authorId: string; messageId: string; type: number; } | null; schemaVersion: number; status: "already-current" | "planned"; target: { aggregateCharacters: number; contentCharacters: number; counts: EmbedLayoutCounts; messageId: string | null; presentation: NormalizedEmbedPresentation; preview: string; requestBytes: number; suppressedUserMentionIds: string[]; }; warnings: string[]; writeRequired: boolean; } export interface EmbedMessageResult { action: EmbedMessageAction; activityId: string | null; channelId: string; guildId: string; messageId: string; operationKeyHash: string; planDigest: string; readbackMatched: true; responseMatched: true; schemaVersion: number; status: "already-current" | "completed"; url: string; } export type EmbedMessageVerificationReason = "message-missing" | "message-state-mismatch" | "operation-failed" | "operation-not-found" | "operation-pending" | "operation-uncertain" | "receipt-target-mismatch" | "request-mismatch"; export interface EmbedMessageVerificationResult { action: EmbedMessageAction; activityId: string | null; channelId: string; guildId: string | null; messageId: string | null; operationKeyHash: string; planDigest: string | null; readbackMatched: boolean; reason: EmbedMessageVerificationReason | null; receiptStatus: OperationReceipt["status"] | null; requestMatched: boolean; schemaVersion: number; status: "blocked" | "drifted" | "not-found" | "verified"; timestamp: string | null; url: string | null; } export interface EmbedMessageServiceClient extends Pick { } export interface EmbedMessageServiceOptions { activityStore: ActivityStore; client: EmbedMessageServiceClient; clock?: () => Date; limiter: InteractionLimiter; operationStore: OperationStore; planKey?: Uint8Array; policy: ScopePolicy; randomId?: () => string; verificationKey?: Uint8Array; } export declare function normalizeEmbedMessageRequest(request: EmbedMessageRequest): NormalizedEmbedMessageRequest; export declare function embedMessageNonce(channelId: string, operationKey: string): string; export declare function embedMessageVerificationKey(token: string): Uint8Array; export declare function embedMessageRequestDigest(key: Uint8Array, applicationId: string, botId: string, request: NormalizedEmbedMessageRequest): string; export declare class EmbedMessageService { #private; constructor(options: EmbedMessageServiceOptions); plan(applicationId: string, botId: string, intent: EmbedMessageContentIntentStatus, request: EmbedMessageRequest, options?: RequestOptions): Promise; verify(applicationId: string, botId: string, intent: EmbedMessageContentIntentStatus, request: EmbedMessageRequest, options?: RequestOptions): Promise; execute(applicationId: string, botId: string, intent: EmbedMessageContentIntentStatus, request: EmbedMessageRequest, expectedDigest: string, options?: RequestOptions): Promise; } export {}; //# sourceMappingURL=embed-message-service.d.ts.map