export type BulkDeleteSelfMessagesScope = 'selected' | 'inaccessible_only'; export type BulkDeleteSelfMessagesGuildFilterMode = 'exclude' | 'include_only'; export type SnowflakeType = unknown | number; export type PasswordType = string; export type WebAuthnAuthenticationResponse = {id: string, rawId: string, type: 'public-key', authenticatorAttachment?: ('cross-platform' | 'platform') | undefined, clientExtensionResults: {appid?: boolean | undefined, credProps?: ({rk?: boolean | undefined} | {[key: string]: unknown}) | undefined, hmacCreateSecret?: boolean | undefined} | {[key: string]: unknown}, response: {clientDataJSON: string, authenticatorData: string, signature: string, userHandle?: string | undefined} | {[key: string]: unknown}} | {[key: string]: unknown}; export type BulkDeleteSelfMessagesRequest = {scope?: BulkDeleteSelfMessagesScope | undefined, include_dms?: boolean | undefined, include_dms_closed?: boolean | undefined, include_group_dms?: boolean | undefined, include_guilds?: boolean | undefined, guild_filter_mode?: BulkDeleteSelfMessagesGuildFilterMode | undefined, excluded_guild_ids?: Array | undefined, included_guild_ids?: Array | undefined, start_date?: (string | null) | undefined, end_date?: (string | null) | undefined, password?: PasswordType | undefined, mfa_method?: ('totp' | 'webauthn' | 'email_code') | undefined, mfa_code?: string | undefined, email_code_ticket?: string | undefined, email_code?: string | undefined, webauthn_response?: WebAuthnAuthenticationResponse | undefined, webauthn_challenge?: string | undefined}; export type CreateApiUsersMeMessagesBulkDeleteMineArgs = {body: BulkDeleteSelfMessagesRequest}; export type CreateApiUsersMeMessagesBulkDeleteMineOptions = {baseUrl?: string | undefined, sessionToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete my messages with optional filters * * POST /users/@me/messages/bulk-delete-mine */ export const createApiUsersMeMessagesBulkDeleteMine = async (args: CreateApiUsersMeMessagesBulkDeleteMineArgs, options?: CreateApiUsersMeMessagesBulkDeleteMineOptions) => { const {baseUrl = "https://web.fluxer.app/api/v1", fetch: fetchFn = fetch, sessionToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (sessionToken !== undefined) headers.set("Authorization", sessionToken) const url = `${baseUrl.replace(/\/+$/, '')}/users/@me/messages/bulk-delete-mine${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };