mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-04 22:02:16 +02:00
feat: implement Discord channel fetching with permission handling in connector UI
This commit is contained in:
parent
47eaa705bf
commit
ff4a574248
4 changed files with 493 additions and 8 deletions
|
|
@ -222,6 +222,27 @@ export const listSlackChannelsRequest = z.object({
|
|||
|
||||
export const listSlackChannelsResponse = z.array(slackChannel);
|
||||
|
||||
/**
|
||||
* Discord channel with indexing permission info
|
||||
*/
|
||||
export const discordChannel = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
type: z.enum(["text", "announcement"]),
|
||||
position: z.number(),
|
||||
category_id: z.string().nullable().optional(),
|
||||
can_index: z.boolean(),
|
||||
});
|
||||
|
||||
/**
|
||||
* List Discord channels
|
||||
*/
|
||||
export const listDiscordChannelsRequest = z.object({
|
||||
connector_id: z.number(),
|
||||
});
|
||||
|
||||
export const listDiscordChannelsResponse = z.array(discordChannel);
|
||||
|
||||
// Inferred types
|
||||
export type SearchSourceConnectorType = z.infer<typeof searchSourceConnectorTypeEnum>;
|
||||
export type SearchSourceConnector = z.infer<typeof searchSourceConnector>;
|
||||
|
|
@ -245,3 +266,6 @@ export type GoogleDriveItem = z.infer<typeof googleDriveItem>;
|
|||
export type SlackChannel = z.infer<typeof slackChannel>;
|
||||
export type ListSlackChannelsRequest = z.infer<typeof listSlackChannelsRequest>;
|
||||
export type ListSlackChannelsResponse = z.infer<typeof listSlackChannelsResponse>;
|
||||
export type DiscordChannel = z.infer<typeof discordChannel>;
|
||||
export type ListDiscordChannelsRequest = z.infer<typeof listDiscordChannelsRequest>;
|
||||
export type ListDiscordChannelsResponse = z.infer<typeof listDiscordChannelsResponse>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue