import { CompletionModel, DcAnswerLength, DcChatbotStatus, DcContentType, DcPublicListingCategory, OrganizationUserRole, QuestionSuggestionMethod, UserType } from "../CommonTypes"; import { RequestedChatBots } from "../CommonTypes/RequestedChatBotsEnum"; export interface RequestBase { } export declare namespace ReqTypes { interface DoesUserExistRequest extends RequestBase { emailOrUserName: string; } interface CreateChatBotRequest extends RequestBase { adminNotes: string; name: string; description: string; /** * If this is undefined it means logo has not been changed * If this is empty string, it means logo has been deleted * Otherwise, it means logo has been changed */ avatarBase64?: string; avatarExtension?: "png" | "jpg"; temperature: number; answers: { answerLength: DcAnswerLength; citeSources: boolean; model: CompletionModel; enableAccessToSources: boolean; firstMessage: string; questionSuggestionMethod: QuestionSuggestionMethod; /** * If questionSuggestionMethod is @see QuestionSuggestionMethod.Disabled, this will be null. * Otherwise, this will be the list of suggested questions. */ questionPlaceHolder: string; customModelInstructions: string; customSuggestedQuestions: string[]; /** * * If this is 1, it means 100% semantic. if 0 , it means 100% keyword * */ semanticRate: number; rerankingEnabled: boolean; replaceSystemPrompt: boolean; autoAddContext: boolean; showExportButtonInChat: boolean; showFeedbackPopUpInChat: boolean; }; documentGroups: { name: string; documentIds: string[]; }[]; whiteLabel: { enabled: boolean; /** * If this is undefined it means logo has not been changed * If this is empty string, it means logo has been deleted * Otherwise, it means logo has been changed */ logoBase64?: string; logoExtension?: "png" | "jpg"; /** * 7 digit hex color code , including the hash */ color: string; darkModeColor: string; pageTitle: string; ctaDescriptionText: string; ctaUrlText: string; ctaUrl: string; disclaimer: string; }; sharing: { link: { enabled: boolean; publicListingCategory: DcPublicListingCategory[]; publicListingCreatedBy: string; publicListingEnabled: boolean; }; embed: { enabled: boolean; /** * If empty, it means allow everyone * Otherwise, it means allow the given domains */ domains: string[]; }; team: { enabled: boolean; }; }; limits: { enabled: boolean; monthlyMaxQuestions: number; }; } interface EditChatBotRequest extends CreateChatBotRequest { id: string; } interface QueryChatBotRequest extends RequestBase { sessionId: string; chatbotId: string; question: string; } interface GetChatBotsRequest extends RequestBase { requestedBots: RequestedChatBots; page: number; pageSize: number; status?: DcChatbotStatus[]; sharing?: ChatBotSharingFilter; onlyFavorites?: boolean; createdBy?: string[]; search?: string; sortByName?: 'asc' | 'desc'; sortByStatus?: 'asc' | 'desc'; } interface ChatBotSharingFilter extends RequestBase { embedEnabled: boolean; linkEnabled: boolean; teamEnabled: boolean; } interface GetChatbotRequest extends RequestBase { chatbotId: string; } interface InitChatRequest extends RequestBase { chatbotId: string; /** * Can be a maximum of 3000 characters */ additionalContext?: string; /** * URL for embedding the chatbot */ embedUrl?: string; } interface GetChatBotDocumentsRequest extends RequestBase { chatbotId: string; } interface GetUserDocumentsRequest extends RequestBase { page: number; pageSize: number; status?: DcChatbotStatus[]; contentTypes?: DcContentType[]; search?: string; sortByName?: 'asc' | 'desc'; sortByType?: 'asc' | 'desc'; sortByStatus?: 'asc' | 'desc'; relevantChatBotIds?: string[]; } interface GetChatBotForChatRequest extends RequestBase { chatbotId: string; } interface DeleteChatBotRequest extends RequestBase { chatbotId: string; } interface UpdateChatBotFavoriteStatusRequest extends RequestBase { chatbotId: string; isFavorite: boolean; } interface GetChatBotIdAndStatusesForUserRequest extends RequestBase { chatbotIds: string[]; } interface GetChatBotEmbedingDomainsRequest extends RequestBase { chatbotId: string; } interface GetDocumentIdAndStatusesForUserRequest extends RequestBase { documentIds: string[]; } interface GetUserInfoRequest extends RequestBase { /** * If this is true, it means this request was sent right after a checkout session, and a webhook will be awaited for up to 5 seconds for this request to be responded */ isPostCheckout?: boolean; } interface SetCompletedOnBoardingRequest extends RequestBase { completed: boolean; } interface SignupRequest extends RequestBase { email: string; password: string; } interface SendResetPasswordEmailRequest extends RequestBase { email: string; } interface IsPasswordResetTokenValidRequest extends RequestBase { token: string; } interface ResetPasswordRequest extends RequestBase { token: string; newPassword: string; } interface UpsertOrganizationUserRequest extends RequestBase { users: { emailOrUserName: string; organizationUserRole: OrganizationUserRole; }[]; organizationId: string; } /** * The sent request's form's meta will have following properties, * organizationData: OrganizationData; * organizationLogoDeleted: boolean * customCSS: string; * fileName will be "organizationLogo" */ interface SetOrganizationDataRequest extends RequestBase { } interface GetOrganizationUsersRequest extends RequestBase { organizationId: string; } /** * This endpoint is meant to be used by nuxt backend. */ interface CreateUserForExternalSignupRequest extends RequestBase { userType: UserType; fullName: string; emailAddress: string; emailHash: string; } interface GetChatBotForEmbedRequest extends RequestBase { chatbotId: string; } /** * Meta will be DcDocument[]; * If there are types documents which has files, added file's key will be DcDocument's id */ interface AddDocumentsRequest extends FormData { } /** * Fails if either document does not exist or the user does not have access to it */ interface DeleteDocumentsRequest extends RequestBase { documentIds: string[]; } interface RenameDocumentsRequest extends RequestBase { documents: { newName: string; documentId: string; }[]; } interface DownloadDocumentRequest extends RequestBase { documentId: string; } interface SigninWithPasswordRequest extends RequestBase { emailOrUserName: string; password: string; } interface GetPlansRequest extends RequestBase { } interface GetAccountUsagesRequest extends RequestBase { } interface UpdatePlanRequest extends RequestBase { /** * If this corresponds to the trial id, doesn't send a url back, only sets planChosen to true. */ targetPlanId: string; referrerId?: string; } interface GetBillingPortalUrlRequest extends RequestBase { } /** * Cancels the renewal upon the next billing date, if the user has a subscription */ interface CancelSubscriptionRequest extends RequestBase { } interface RateAnswerRequest extends RequestBase { messageId: string; ratedUp: boolean; comments?: string; isNotTrue?: boolean; isNotHelpful?: boolean; hasInconsistentLanguage?: boolean; } interface GetChatbotSessionsRequest extends RequestBase { chatbotId: string; } interface GetChatbotAnalyticsRequest extends RequestBase { } interface UpsertAzureOpenAiCredentialsRequest extends RequestBase { endpoint: string; /** * Sending a key means modifying the key, if exists. */ key?: string; model: CompletionModel; } interface GetAzureOpenAiCredentialsRequest extends RequestBase { } interface EditChatBotShareOptionsRequest extends RequestBase { id: string; team: boolean; link: boolean; embed: boolean; } interface EditChatbotLimitsOptionsRequest extends RequestBase { id: string; enabled: boolean; monthlyMaxQuestions: number; } interface EditChatbotVisibleUrlRequest extends RequestBase { id: string; visibleUrl: string[]; } interface EditChatbotWidgetUrlRequest extends RequestBase { id: string; widgetUrl?: string; } interface DuplicateChatbotRequest extends RequestBase { id: string; } interface EnforceDataResidencyRequest extends RequestBase { enforce: boolean; } interface GetOrganizationCssByChatBotIdRequest extends RequestBase { chatbotId: string; } interface UpsertGoogleDriveIntegrationRequest extends RequestBase { refreshToken: string; folderFileIds: string[]; } interface RemoveGoogleDriveFolderRequest extends RequestBase { folderDocFileId: string; } interface RemoveGoogleDriveIntegrationRequest extends RequestBase { } interface SetCTAUsedInSessionRequest extends RequestBase { sessionId: string; } interface SendDeleteAccountEmailRequest extends RequestBase { } interface SynchronizeGoogleDriveFoldersRequest extends RequestBase { folderDocFileIds: string[]; } interface ModifyChatSessionContextRequest extends RequestBase { sessionId: string; /** * Can be a maximum of 3000 characters. Sending this will override the current context. */ context: string; } interface GetCompletionModelsRequest extends RequestBase { } interface GenerateApiKeyRequest extends RequestBase { } interface RevokeApiKeyRequest extends RequestBase { } interface GetMaskedApiKeyRequest extends RequestBase { } interface GetChatBotAndSessionBySessionIdRequest extends RequestBase { sessionId: string; } interface GenerateAnalyticsReportRequest extends RequestBase { chatbotId: string; /** * YYYY-MM-DD */ startDate: string; /** * YYYY-MM-DD */ endDate: string; } interface ListAnalyticsReportsRequest extends RequestBase { chatbotId: string; } interface GetAnalyticsReportRequest extends RequestBase { analyticsReportId: string; } interface GetChatBotPermissionsRequest extends RequestBase { chatbotId: string; } interface UpdateChatBotPermissionsRequest extends RequestBase { chatbotId: string; permissions: Array<{ userId: string; accessLevel: string | null; }>; } interface GetChatBotVisibleUrlRequest extends RequestBase { chatbotId: string; } interface GetOverviewRequest extends RequestBase { } interface GetTestimonialSubmissionsRequest extends RequestBase { } interface CreateTestimonialSubmissionRequest extends RequestBase { emailAddress: string; platform: string; reward: string; testimonialText?: string | null; } interface GetPaymentProvidersRequest extends RequestBase { } }