Updates
This commit is contained in:
-13
@@ -1,13 +0,0 @@
|
||||
type Param = {
|
||||
clientId: string;
|
||||
redirectUrl: string;
|
||||
setLoading?: (arg0: boolean) => void;
|
||||
scopes?: string[];
|
||||
};
|
||||
/**
|
||||
* Login with Github Function
|
||||
* ===============================================================================
|
||||
* @description This function uses github api to login a user with datasquirel
|
||||
*/
|
||||
export default function getAccessToken({ clientId, redirectUrl, setLoading, scopes, }: Param): void;
|
||||
export {};
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
interface GoogleGetAccessTokenFunctionParams {
|
||||
clientId: string;
|
||||
triggerPrompt?: boolean;
|
||||
setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
}
|
||||
/**
|
||||
* Login with Google Function
|
||||
* ===============================================================================
|
||||
* @description This function uses google identity api to login a user with datasquirel
|
||||
*/
|
||||
export default function getAccessToken(params: GoogleGetAccessTokenFunctionParams): Promise<string>;
|
||||
/**
|
||||
* # Google Login Function
|
||||
*/
|
||||
export declare function googleLogin({ google, clientId, setLoading, triggerPrompt, }: GoogleGetAccessTokenFunctionParams & {
|
||||
google: any;
|
||||
}): Promise<unknown>;
|
||||
export {};
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Login with Google Function
|
||||
* ===============================================================================
|
||||
* @description This function uses google identity api to login a user with datasquirel
|
||||
*/
|
||||
export default function logout(params?: {
|
||||
googleClientId?: any;
|
||||
}): Promise<boolean>;
|
||||
Vendored
-9
@@ -1,9 +0,0 @@
|
||||
import { APILoginFunctionReturn } from "../../package-shared/types";
|
||||
/**
|
||||
* Client Setup After Login
|
||||
* ===============================================================================
|
||||
* @description This function sets local storage variables like `csrf` after a user
|
||||
* is logged in. Use this in conjunction with the `datasquirel.user.loginUser`
|
||||
* function
|
||||
*/
|
||||
export default function postLogin(res: APILoginFunctionReturn): boolean;
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
type FetchApiOptions = {
|
||||
method: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "post" | "get" | "delete" | "put" | "patch";
|
||||
body?: object | string;
|
||||
headers?: FetchHeader;
|
||||
};
|
||||
type FetchHeader = HeadersInit & {
|
||||
[key: string]: string | null;
|
||||
};
|
||||
export type FetchApiReturn = {
|
||||
success: boolean;
|
||||
payload: any;
|
||||
msg?: string;
|
||||
[key: string]: any;
|
||||
};
|
||||
/**
|
||||
* # Fetch API
|
||||
*/
|
||||
export default function fetchApi(url: string, options?: FetchApiOptions, csrf?: boolean,
|
||||
/** Key to use to grab local Storage csrf value. */
|
||||
localStorageCSRFKey?: string): Promise<any>;
|
||||
export {};
|
||||
Vendored
-55
@@ -1,55 +0,0 @@
|
||||
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 serializeQuery from "../package-shared/utils/serialize-query";
|
||||
import serializeCookies from "../package-shared/utils/serialize-cookies";
|
||||
import numberfy from "../package-shared/utils/numberfy";
|
||||
import slugify from "../package-shared/utils/slugify";
|
||||
import postLogin from "./auth/post-login";
|
||||
import deserializeQuery from "../package-shared/utils/deserialize-query";
|
||||
import debugLog from "../package-shared/utils/logging/debug-log";
|
||||
/**
|
||||
* Main Export
|
||||
*/
|
||||
declare const datasquirelClient: {
|
||||
media: {
|
||||
imageInputToBase64: typeof imageInputToBase64;
|
||||
imageInputFileToBase64: typeof imageInputFileToBase64;
|
||||
inputFileToBase64: typeof inputFileToBase64;
|
||||
};
|
||||
auth: {
|
||||
google: {
|
||||
getAccessToken: typeof getAccessToken;
|
||||
};
|
||||
github: {
|
||||
getAccessToken: typeof getGithubAccessToken;
|
||||
};
|
||||
logout: typeof logout;
|
||||
postLogin: typeof postLogin;
|
||||
};
|
||||
fetch: {
|
||||
fetchApi: typeof fetchApi;
|
||||
clientFetch: typeof fetchApi;
|
||||
};
|
||||
utils: {
|
||||
deserializeQuery: typeof deserializeQuery;
|
||||
serializeQuery: typeof serializeQuery;
|
||||
serializeCookies: typeof serializeCookies;
|
||||
EJSON: {
|
||||
parse: (string: string | null | number, reviver?: (this: any, key: string, value: any) => any) => {
|
||||
[s: string]: any;
|
||||
} | {
|
||||
[s: string]: any;
|
||||
}[] | undefined;
|
||||
stringify: (value: any, replacer?: ((this: any, key: string, value: any) => any) | null, space?: string | number) => string | undefined;
|
||||
};
|
||||
numberfy: typeof numberfy;
|
||||
slugify: typeof slugify;
|
||||
debugLog: typeof debugLog;
|
||||
};
|
||||
};
|
||||
export default datasquirelClient;
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
import imageInputFileToBase64 from "./imageInputFileToBase64";
|
||||
import imageInputToBase64 from "./imageInputToBase64";
|
||||
/**
|
||||
* ==========================
|
||||
* Main Export
|
||||
* ==========================
|
||||
*/
|
||||
declare const datasquirelClient: {
|
||||
media: {
|
||||
imageInputToBase64: typeof imageInputToBase64;
|
||||
imageInputFileToBase64: typeof imageInputFileToBase64;
|
||||
};
|
||||
};
|
||||
export default datasquirelClient;
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
import { ImageInputFileToBase64FunctionReturn } from "../../package-shared/types";
|
||||
type Param = {
|
||||
imageInputFile: File;
|
||||
maxWidth?: number;
|
||||
imagePreviewNode?: HTMLImageElement;
|
||||
};
|
||||
/**
|
||||
* # Image input File top Base64
|
||||
*/
|
||||
export default function imageInputFileToBase64({ imageInputFile, maxWidth, imagePreviewNode, }: Param): Promise<ImageInputFileToBase64FunctionReturn>;
|
||||
export {};
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
type FunctionReturn = {
|
||||
imageBase64?: string;
|
||||
imageBase64Full?: string;
|
||||
imageName?: string;
|
||||
};
|
||||
type Param = {
|
||||
imageInput: HTMLInputElement;
|
||||
maxWidth?: number;
|
||||
mimeType?: string;
|
||||
};
|
||||
/**
|
||||
* # Image Input Element to Base 64
|
||||
*/
|
||||
export default function imageInputToBase64({ imageInput, maxWidth, mimeType, }: Param): Promise<FunctionReturn>;
|
||||
export {};
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
type FunctionReturn = {
|
||||
fileBase64?: string;
|
||||
fileBase64Full?: string;
|
||||
fileName?: string;
|
||||
fileSize?: number;
|
||||
fileType?: string;
|
||||
};
|
||||
type Param = {
|
||||
inputFile: File;
|
||||
allowedRegex?: RegExp;
|
||||
};
|
||||
/**
|
||||
* Input File to base64
|
||||
* ==============================================================================
|
||||
*
|
||||
* @description This function takes in a *SINGLE* input file from a HTML file input element.
|
||||
* HTML file input elements usually return an array of input objects, so be sure to select the target
|
||||
* file from the array.
|
||||
*/
|
||||
export default function inputFileToBase64({ inputFile, allowedRegex, }: Param): Promise<FunctionReturn>;
|
||||
export {};
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
/**
|
||||
* Parse request cookies
|
||||
* ============================================================================== *
|
||||
* @description This function takes in a request object and returns the cookies as a JS object
|
||||
*/
|
||||
export default function (): {
|
||||
[s: string]: any;
|
||||
} | null;
|
||||
Reference in New Issue
Block a user