CipherStreamWeb converted to use Vite

This commit is contained in:
2025-08-13 23:31:29 -04:00
parent 70f9adb930
commit c9bddfa74d
120 changed files with 13931 additions and 3 deletions

View File

@@ -0,0 +1,40 @@
import type { CipherInfo } from "@/models/CipherInfo";
import type { AutokeyProps } from "@/models/MonoSubstitutionProps";
import api from "@/util/AxiosUtil";
import { useMutation, useQuery } from "@tanstack/react-query";
export function useGetAutokeyInfo(){
return useQuery({
queryKey: [ "Autokey", "Info" ],
queryFn: async () => {
const response = await api.get(`${import.meta.env.VITE_API_URL}/autokey`);
return response.data as CipherInfo;
}
});
}
export function useEncodeAutokey(){
return useMutation({
mutationKey: [ "Autokey", "Encode" ],
scope: { id: "Autokey Encode" },
mutationFn: async (props: AutokeyProps) => {
const response = await api.post(`${import.meta.env.VITE_API_URL}/autokey/encode`, props);
return response.data as AutokeyProps;
}
});
}
export function useDecodeAutokey(){
return useMutation({
mutationKey: [ "Autokey", "Decode" ],
scope: { id: "Autokey Decode" },
mutationFn: async (props: AutokeyProps) => {
const response = await api.post(`${import.meta.env.VITE_API_URL}/autokey/decode`, props);
return response.data as AutokeyProps;
}
});
}