Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/conat/hub/api/messages.ts
1712 views
1
import { authFirst } from "./util";
2
import {
3
type ApiMessagesGet,
4
type MessageMe,
5
} from "@cocalc/util/db-schema/messages";
6
7
export interface Messages {
8
send: (opts: {
9
account_id?: string;
10
// to_ids-- account_id's or email addresses of users with accounts
11
to_ids: string[];
12
// short plain text formatted subject
13
subject: string;
14
// longer markdown formatted body
15
body: string;
16
reply_id?: number;
17
}) => Promise<number>;
18
19
get: (opts: ApiMessagesGet) => Promise<MessageMe[]>;
20
}
21
22
export const messages = {
23
send: authFirst,
24
get: authFirst,
25
};
26
27