63 lines
1.5 KiB
TypeScript
63 lines
1.5 KiB
TypeScript
import imageInputFileToBase64 from "./media/imageInputFileToBase64";
|
|
import imageInputToBase64 from "./media/imageInputToBase64";
|
|
import inputFileToBase64 from "./media/inputFileToBase64";
|
|
import getAccessToken from "./auth/google/getAccessToken";
|
|
import getGithubAccessToken from "./auth/github/getAccessToken";
|
|
import logout from "./auth/logout";
|
|
import fetchApi from "./fetch";
|
|
import clientFetch from "./fetch";
|
|
import serializeQuery from "../package-shared/utils/serialize-query";
|
|
import serializeCookies from "../package-shared/utils/serialize-cookies";
|
|
import EJSON from "../package-shared/utils/ejson";
|
|
import numberfy from "../package-shared/utils/numberfy";
|
|
import slugify from "../package-shared/utils/slugify";
|
|
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
////////////////////////////////////////
|
|
|
|
/**
|
|
* Media Functions Object
|
|
*/
|
|
const media = {
|
|
imageInputToBase64: imageInputToBase64,
|
|
imageInputFileToBase64: imageInputFileToBase64,
|
|
inputFileToBase64: inputFileToBase64,
|
|
};
|
|
|
|
/**
|
|
* User Auth Object
|
|
*/
|
|
const auth = {
|
|
google: {
|
|
getAccessToken: getAccessToken,
|
|
},
|
|
github: {
|
|
getAccessToken: getGithubAccessToken,
|
|
},
|
|
logout: logout,
|
|
};
|
|
|
|
const utils = {
|
|
serializeQuery,
|
|
serializeCookies,
|
|
EJSON,
|
|
numberfy,
|
|
slugify,
|
|
};
|
|
|
|
/**
|
|
* Fetch
|
|
*/
|
|
const fetch = {
|
|
fetchApi,
|
|
clientFetch,
|
|
};
|
|
|
|
/**
|
|
* Main Export
|
|
*/
|
|
const datasquirelClient = { media, auth, fetch, utils };
|
|
|
|
export default datasquirelClient;
|