import { CompletionModel, DcAnswerLength, DcChatbotStatus, DcContentType, DcPublicListingCategory, OrganizationUserRole, QuestionSuggestionMethod, UserType, } from "../CommonTypes"; import { RequestedChatBots } from "../CommonTypes/RequestedChatBotsEnum"; export interface RequestBase {} export namespace ReqTypes { export interface DoesUserExistRequest extends RequestBase { emailOrUserName: string; } export 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 }; } export interface EditChatBotRequest extends CreateChatBotRequest { id: string; } export interface QueryChatBotRequest extends RequestBase { sessionId: string; chatbotId: string; question: string; } export 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'; } export interface ChatBotSharingFilter extends RequestBase { embedEnabled: boolean; linkEnabled: boolean; teamEnabled: boolean; } export interface GetChatbotRequest extends RequestBase { chatbotId: string; } export interface InitChatRequest extends RequestBase { chatbotId: string; /** * Can be a maximum of 3000 characters */ additionalContext?: string; /** * URL for embedding the chatbot */ embedUrl?: string; } export interface GetChatBotDocumentsRequest extends RequestBase { chatbotId: string; } export 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[]; } export interface GetChatBotForChatRequest extends RequestBase { chatbotId: string; } export interface DeleteChatBotRequest extends RequestBase { chatbotId: string; } export interface UpdateChatBotFavoriteStatusRequest extends RequestBase { chatbotId: string; isFavorite: boolean; } export interface GetChatBotIdAndStatusesForUserRequest extends RequestBase { chatbotIds: string[]; } export interface GetChatBotEmbedingDomainsRequest extends RequestBase { chatbotId: string; } export interface GetDocumentIdAndStatusesForUserRequest extends RequestBase { documentIds: string[]; } export 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; } export interface SetCompletedOnBoardingRequest extends RequestBase { completed: boolean; } export interface SignupRequest extends RequestBase { email: string; password: string; } export interface SendResetPasswordEmailRequest extends RequestBase { email: string; } export interface IsPasswordResetTokenValidRequest extends RequestBase { token: string; } export interface ResetPasswordRequest extends RequestBase { token: string; newPassword: string; } export interface UpsertOrganizationUserRequest extends RequestBase { users: { // either the emailaddress or the username should be sent 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" */ export interface SetOrganizationDataRequest extends RequestBase {} export interface GetOrganizationUsersRequest extends RequestBase { organizationId: string; } /** * This endpoint is meant to be used by nuxt backend. */ export interface CreateUserForExternalSignupRequest extends RequestBase { userType: UserType; fullName: string; emailAddress: string; emailHash: string; } export 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 */ export interface AddDocumentsRequest extends FormData {} /** * Fails if either document does not exist or the user does not have access to it */ export interface DeleteDocumentsRequest extends RequestBase { documentIds: string[]; } export interface RenameDocumentsRequest extends RequestBase { documents: { newName: string; documentId: string; }[]; } export interface DownloadDocumentRequest extends RequestBase { documentId: string; } export interface SigninWithPasswordRequest extends RequestBase { emailOrUserName: string; password: string; } export interface GetPlansRequest extends RequestBase {} export interface GetAccountUsagesRequest extends RequestBase {} export 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; } export interface GetBillingPortalUrlRequest extends RequestBase {} /** * Cancels the renewal upon the next billing date, if the user has a subscription */ export interface CancelSubscriptionRequest extends RequestBase {} export interface RateAnswerRequest extends RequestBase { messageId: string; ratedUp: boolean; comments?: string; isNotTrue?: boolean; isNotHelpful?: boolean; hasInconsistentLanguage?: boolean; } //only for superadmins and admins export interface GetChatbotSessionsRequest extends RequestBase { chatbotId: string; } //only for superadmins and admins export interface GetChatbotAnalyticsRequest extends RequestBase {} export interface UpsertAzureOpenAiCredentialsRequest extends RequestBase { endpoint: string; /** * Sending a key means modifying the key, if exists. */ key?: string; model: CompletionModel; } export interface GetAzureOpenAiCredentialsRequest extends RequestBase {} export interface EditChatBotShareOptionsRequest extends RequestBase{ id: string; team: boolean; link: boolean; embed: boolean; } export interface EditChatbotLimitsOptionsRequest extends RequestBase{ id: string; enabled: boolean; monthlyMaxQuestions: number; } export interface EditChatbotVisibleUrlRequest extends RequestBase{ id: string; visibleUrl: string[]; } export interface EditChatbotWidgetUrlRequest extends RequestBase{ id: string; widgetUrl?: string; } export interface DuplicateChatbotRequest extends RequestBase{ id: string; } export interface EnforceDataResidencyRequest extends RequestBase{ enforce: boolean; } export interface GetOrganizationCssByChatBotIdRequest extends RequestBase{ chatbotId: string; } export interface UpsertGoogleDriveIntegrationRequest extends RequestBase{ refreshToken: string; folderFileIds: string[]; } export interface RemoveGoogleDriveFolderRequest extends RequestBase{ folderDocFileId: string; } export interface RemoveGoogleDriveIntegrationRequest extends RequestBase{}; export interface SetCTAUsedInSessionRequest extends RequestBase{ sessionId: string; } export interface SendDeleteAccountEmailRequest extends RequestBase{} export interface SynchronizeGoogleDriveFoldersRequest extends RequestBase{ folderDocFileIds: string[]; } export interface ModifyChatSessionContextRequest extends RequestBase { sessionId: string; /** * Can be a maximum of 3000 characters. Sending this will override the current context. */ context: string; } export interface GetCompletionModelsRequest extends RequestBase{} export interface GenerateApiKeyRequest extends RequestBase{} export interface RevokeApiKeyRequest extends RequestBase{} export interface GetMaskedApiKeyRequest extends RequestBase{} export interface GetChatBotAndSessionBySessionIdRequest extends RequestBase{ sessionId: string; } export interface GenerateAnalyticsReportRequest extends RequestBase{ chatbotId: string; /** * YYYY-MM-DD */ startDate: string; /** * YYYY-MM-DD */ endDate: string; } export interface ListAnalyticsReportsRequest extends RequestBase{ chatbotId: string; } export interface GetAnalyticsReportRequest extends RequestBase{ analyticsReportId: string; } export interface GetChatBotPermissionsRequest extends RequestBase { chatbotId: string; } export interface UpdateChatBotPermissionsRequest extends RequestBase { chatbotId: string; permissions: Array<{ userId: string; accessLevel: string | null; }>; } export interface GetChatBotVisibleUrlRequest extends RequestBase { chatbotId: string; } export interface GetOverviewRequest extends RequestBase {} export interface GetTestimonialSubmissionsRequest extends RequestBase {} export interface CreateTestimonialSubmissionRequest extends RequestBase { emailAddress: string; platform: string; reward: string; testimonialText?: string | null; } export interface GetPaymentProvidersRequest extends RequestBase {} }