44 lines
1.9 KiB
TypeScript
44 lines
1.9 KiB
TypeScript
import { type ExpungeAllContentsOut } from "../models/expungeAllContentsOut";
|
|
import { type ListResponseMessageOut } from "../models/listResponseMessageOut";
|
|
import { type MessageOut } from "../models/messageOut";
|
|
import { type MessagePrecheckIn } from "../models/messagePrecheckIn";
|
|
import { type MessagePrecheckOut } from "../models/messagePrecheckOut";
|
|
import { MessagePoller } from "./messagePoller";
|
|
import { type SvixRequestContext } from "../request";
|
|
import { type MessageIn } from "../models/messageIn";
|
|
export interface MessageListOptions {
|
|
limit?: number;
|
|
iterator?: string | null;
|
|
channel?: string;
|
|
before?: Date | null;
|
|
after?: Date | null;
|
|
withContent?: boolean;
|
|
tag?: string;
|
|
eventTypes?: string[];
|
|
}
|
|
export interface MessageCreateOptions {
|
|
withContent?: boolean;
|
|
idempotencyKey?: string;
|
|
}
|
|
export interface MessageExpungeAllContentsOptions {
|
|
idempotencyKey?: string;
|
|
}
|
|
export interface MessagePrecheckOptions {
|
|
idempotencyKey?: string;
|
|
}
|
|
export interface MessageGetOptions {
|
|
withContent?: boolean;
|
|
}
|
|
export declare class Message {
|
|
private readonly requestCtx;
|
|
constructor(requestCtx: SvixRequestContext);
|
|
get poller(): MessagePoller;
|
|
list(appId: string, options?: MessageListOptions): Promise<ListResponseMessageOut>;
|
|
create(appId: string, messageIn: MessageIn, options?: MessageCreateOptions): Promise<MessageOut>;
|
|
expungeAllContents(appId: string, options?: MessageExpungeAllContentsOptions): Promise<ExpungeAllContentsOut>;
|
|
precheck(appId: string, messagePrecheckIn: MessagePrecheckIn, options?: MessagePrecheckOptions): Promise<MessagePrecheckOut>;
|
|
get(appId: string, msgId: string, options?: MessageGetOptions): Promise<MessageOut>;
|
|
expungeContent(appId: string, msgId: string): Promise<void>;
|
|
}
|
|
export declare function messageInRaw(eventType: string, payload: string, contentType?: string): MessageIn;
|