方法
create
create( body: { applicationId: string; title?: null | string },): Promise< { data: { applicationId: string; createdAt: string; id: string; participants: { banExpires: null | string; banned: null | boolean; banReason: null | string; createdAt: string; email: string; emailVerified: boolean; id: string; image: null | string; name: string; role: null | string; updatedAt: string; }[]; title: null | string; updatedAt: string; }; },> 参数
- body: { applicationId: string; title?: null | string }
返回 Promise<
{
data: {
applicationId: string;
createdAt: string;
id: string;
participants: {
banExpires: null
| string;
banned: null | boolean;
banReason: null | string;
createdAt: string;
email: string;
emailVerified: boolean;
id: string;
image: null | string;
name: string;
role: null | string;
updatedAt: string;
}[];
title: null
| string;
updatedAt: string;
};
},
>
delete
delete(id: string): Promise<{ data: { id: string } }> 返回 Promise<{ data: { id: string } }>
getById
getById( threadId: string,): Promise< { data: { applicationId: string; createdAt: string; id: string; participants: { banExpires: null | string; banned: null | boolean; banReason: null | string; createdAt: string; email: string; emailVerified: boolean; id: string; image: null | string; name: string; role: null | string; updatedAt: string; }[]; title: null | string; updatedAt: string; }; },> 返回 Promise<
{
data: {
applicationId: string;
createdAt: string;
id: string;
participants: {
banExpires: null
| string;
banned: null | boolean;
banReason: null | string;
createdAt: string;
email: string;
emailVerified: boolean;
id: string;
image: null | string;
name: string;
role: null | string;
updatedAt: string;
}[];
title: null
| string;
updatedAt: string;
};
},
>
listByApplication
listByApplication( applicationId: string,): Promise< { data: { applicationId: string; createdAt: string; id: string; title: null | string; updatedAt: string; }[]; },> 返回 Promise<
{
data: {
applicationId: string;
createdAt: string;
id: string;
title: null
| string;
updatedAt: string;
}[];
},
>
update
update( id: string, body: { title: null | string },): Promise< { data: { applicationId: string; createdAt: string; id: string; participants: { banExpires: null | string; banned: null | boolean; banReason: null | string; createdAt: string; email: string; emailVerified: boolean; id: string; image: null | string; name: string; role: null | string; updatedAt: string; }[]; title: null | string; updatedAt: string; }; },> 参数
- id: string
- body: { title: null | string }
返回 Promise<
{
data: {
applicationId: string;
createdAt: string;
id: string;
participants: {
banExpires: null
| string;
banned: null | boolean;
banReason: null | string;
createdAt: string;
email: string;
emailVerified: boolean;
id: string;
image: null | string;
name: string;
role: null | string;
updatedAt: string;
}[];
title: null
| string;
updatedAt: string;
};
},
>
新建对话
applicationId
必传,因为对话总是归属于某个应用程序。title
是可选的。如果不传,则服务端会暂时将其置空,待产生第一条消息时,会自动生成一条短标题。