mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 17:26:23 +02:00
Merge branch 'dev' of https://github.com/MODSetter/SurfSense into dev
This commit is contained in:
commit
8301e0169c
71 changed files with 2889 additions and 732 deletions
|
|
@ -1,19 +1,53 @@
|
|||
import { z } from "zod";
|
||||
|
||||
/**
|
||||
* Toggle public share
|
||||
* Snapshot info
|
||||
*/
|
||||
export const togglePublicShareRequest = z.object({
|
||||
thread_id: z.number(),
|
||||
enabled: z.boolean(),
|
||||
export const snapshotInfo = z.object({
|
||||
id: z.number(),
|
||||
share_token: z.string(),
|
||||
public_url: z.string(),
|
||||
created_at: z.string(),
|
||||
message_count: z.number(),
|
||||
});
|
||||
|
||||
export const togglePublicShareResponse = z.object({
|
||||
enabled: z.boolean(),
|
||||
public_url: z.string().nullable(),
|
||||
share_token: z.string().nullable(),
|
||||
/**
|
||||
* Create snapshot
|
||||
*/
|
||||
export const createSnapshotRequest = z.object({
|
||||
thread_id: z.number(),
|
||||
});
|
||||
|
||||
export const createSnapshotResponse = z.object({
|
||||
snapshot_id: z.number(),
|
||||
share_token: z.string(),
|
||||
public_url: z.string(),
|
||||
is_new: z.boolean(),
|
||||
});
|
||||
|
||||
/**
|
||||
* List snapshots
|
||||
*/
|
||||
export const listSnapshotsRequest = z.object({
|
||||
thread_id: z.number(),
|
||||
});
|
||||
|
||||
export const listSnapshotsResponse = z.object({
|
||||
snapshots: z.array(snapshotInfo),
|
||||
});
|
||||
|
||||
/**
|
||||
* Delete snapshot
|
||||
*/
|
||||
export const deleteSnapshotRequest = z.object({
|
||||
thread_id: z.number(),
|
||||
snapshot_id: z.number(),
|
||||
});
|
||||
|
||||
// Type exports
|
||||
export type TogglePublicShareRequest = z.infer<typeof togglePublicShareRequest>;
|
||||
export type TogglePublicShareResponse = z.infer<typeof togglePublicShareResponse>;
|
||||
export type SnapshotInfo = z.infer<typeof snapshotInfo>;
|
||||
export type CreateSnapshotRequest = z.infer<typeof createSnapshotRequest>;
|
||||
export type CreateSnapshotResponse = z.infer<typeof createSnapshotResponse>;
|
||||
export type ListSnapshotsRequest = z.infer<typeof listSnapshotsRequest>;
|
||||
export type ListSnapshotsResponse = z.infer<typeof listSnapshotsResponse>;
|
||||
export type DeleteSnapshotRequest = z.infer<typeof deleteSnapshotRequest>;
|
||||
|
|
|
|||
|
|
@ -203,6 +203,46 @@ export const listGoogleDriveFoldersResponse = z.object({
|
|||
items: z.array(googleDriveItem),
|
||||
});
|
||||
|
||||
/**
|
||||
* Slack channel with bot membership status
|
||||
*/
|
||||
export const slackChannel = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
is_private: z.boolean(),
|
||||
is_member: z.boolean(),
|
||||
});
|
||||
|
||||
/**
|
||||
* List Slack channels
|
||||
*/
|
||||
export const listSlackChannelsRequest = z.object({
|
||||
connector_id: z.number(),
|
||||
});
|
||||
|
||||
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>;
|
||||
|
|
@ -223,3 +263,9 @@ export type ListGitHubRepositoriesResponse = z.infer<typeof listGitHubRepositori
|
|||
export type ListGoogleDriveFoldersRequest = z.infer<typeof listGoogleDriveFoldersRequest>;
|
||||
export type ListGoogleDriveFoldersResponse = z.infer<typeof listGoogleDriveFoldersResponse>;
|
||||
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>;
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ export const getPublicChatResponse = z.object({
|
|||
});
|
||||
|
||||
/**
|
||||
* Clone public chat (init)
|
||||
* Clone public chat
|
||||
*/
|
||||
export const clonePublicChatRequest = z.object({
|
||||
share_token: z.string(),
|
||||
|
|
@ -48,19 +48,6 @@ export const clonePublicChatRequest = z.object({
|
|||
export const clonePublicChatResponse = z.object({
|
||||
thread_id: z.number(),
|
||||
search_space_id: z.number(),
|
||||
share_token: z.string(),
|
||||
});
|
||||
|
||||
/**
|
||||
* Complete clone
|
||||
*/
|
||||
export const completeCloneRequest = z.object({
|
||||
thread_id: z.number(),
|
||||
});
|
||||
|
||||
export const completeCloneResponse = z.object({
|
||||
status: z.string(),
|
||||
message_count: z.number(),
|
||||
});
|
||||
|
||||
// Type exports
|
||||
|
|
@ -71,5 +58,3 @@ export type GetPublicChatRequest = z.infer<typeof getPublicChatRequest>;
|
|||
export type GetPublicChatResponse = z.infer<typeof getPublicChatResponse>;
|
||||
export type ClonePublicChatRequest = z.infer<typeof clonePublicChatRequest>;
|
||||
export type ClonePublicChatResponse = z.infer<typeof clonePublicChatResponse>;
|
||||
export type CompleteCloneRequest = z.infer<typeof completeCloneRequest>;
|
||||
export type CompleteCloneResponse = z.infer<typeof completeCloneResponse>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue