mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-29 05:36:13 +01:00
Build/Refactor: lint pre-commit hook and reformat repo to spec (#314)
* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook * refactor: reformat files * build: put full eslintrc back with all rules
This commit is contained in:
parent
8d75b25104
commit
7fdc862042
157 changed files with 4836 additions and 2403 deletions
|
|
@ -6,17 +6,21 @@ export function getConversations(pageNumber: string): Promise<t.TGetConversation
|
|||
return request.get(endpoints.conversations(pageNumber));
|
||||
}
|
||||
|
||||
export function abortRequestWithMessage(endpoint: string, abortKey: string, message: string): Promise<void> {
|
||||
return request.post(endpoints.abortRequest(endpoint), { arg: {abortKey, message} });
|
||||
export function abortRequestWithMessage(
|
||||
endpoint: string,
|
||||
abortKey: string,
|
||||
message: string
|
||||
): Promise<void> {
|
||||
return request.post(endpoints.abortRequest(endpoint), { arg: { abortKey, message } });
|
||||
}
|
||||
|
||||
export function deleteConversation(payload: t.TDeleteConversationRequest) {
|
||||
//todo: this should be a DELETE request
|
||||
return request.post(endpoints.deleteConversation(), {arg: payload});
|
||||
return request.post(endpoints.deleteConversation(), { arg: payload });
|
||||
}
|
||||
|
||||
export function clearAllConversations(): Promise<unknown> {
|
||||
return request.post(endpoints.deleteConversation(), {arg: {}});
|
||||
return request.post(endpoints.deleteConversation(), { arg: {} });
|
||||
}
|
||||
|
||||
export function getMessagesByConvoId(id: string): Promise<t.TMessage[]> {
|
||||
|
|
@ -30,7 +34,7 @@ export function getConversationById(id: string): Promise<t.TConversation> {
|
|||
export function updateConversation(
|
||||
payload: t.TUpdateConversationRequest
|
||||
): Promise<t.TUpdateConversationResponse> {
|
||||
return request.post(endpoints.updateConversation(), {arg: payload});
|
||||
return request.post(endpoints.updateConversation(), { arg: payload });
|
||||
}
|
||||
|
||||
export function getPresets(): Promise<t.TPreset[]> {
|
||||
|
|
@ -57,42 +61,45 @@ export function getUser(): Promise<t.TUser> {
|
|||
return request.get(endpoints.user());
|
||||
}
|
||||
|
||||
export const searchConversations = async(q: string, pageNumber: string): Promise<t.TSearchResults> => {
|
||||
export const searchConversations = async (
|
||||
q: string,
|
||||
pageNumber: string
|
||||
): Promise<t.TSearchResults> => {
|
||||
return request.get(endpoints.search(q, pageNumber));
|
||||
}
|
||||
};
|
||||
|
||||
export const getAIEndpoints = () => {
|
||||
return request.get(endpoints.aiEndpoints());
|
||||
}
|
||||
};
|
||||
|
||||
export const updateTokenCount = (text: string) => {
|
||||
return request.post(endpoints.tokenizer(), {arg: text});
|
||||
}
|
||||
export const updateTokenCount = (text: string) => {
|
||||
return request.post(endpoints.tokenizer(), { arg: text });
|
||||
};
|
||||
|
||||
export const login = (payload: t.TLoginUser) => {
|
||||
return request.post(endpoints.login(), payload);
|
||||
}
|
||||
};
|
||||
|
||||
export const logout = () => {
|
||||
return request.post(endpoints.logout());
|
||||
}
|
||||
};
|
||||
|
||||
export const register = (payload: t.TRegisterUser) => {
|
||||
return request.post(endpoints.register(), payload);
|
||||
}
|
||||
};
|
||||
|
||||
export const refreshToken = () => {
|
||||
return request.post(endpoints.refreshToken());
|
||||
}
|
||||
};
|
||||
|
||||
export const getLoginGoogle = () => {
|
||||
return request.get(endpoints.loginGoogle());
|
||||
}
|
||||
};
|
||||
|
||||
export const requestPasswordReset = (payload: t.TRequestPasswordReset) => {
|
||||
return request.post(endpoints.requestPasswordReset(), payload);
|
||||
}
|
||||
};
|
||||
|
||||
export const resetPassword = (payload: t.TResetPassword) => {
|
||||
return request.post(endpoints.resetPassword(), payload);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue