Updates
This commit is contained in:
parent
8d38f99bf1
commit
6593047efd
13
dist/client/auth/github/getAccessToken.d.ts
vendored
Normal file
13
dist/client/auth/github/getAccessToken.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
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
dist/client/auth/google/getAccessToken.d.ts
vendored
Normal file
18
dist/client/auth/google/getAccessToken.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
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 {};
|
8
dist/client/auth/logout.d.ts
vendored
Normal file
8
dist/client/auth/logout.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* 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>;
|
9
dist/client/auth/post-login.d.ts
vendored
Normal file
9
dist/client/auth/post-login.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
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;
|
21
dist/client/fetch/index.d.ts
vendored
Normal file
21
dist/client/fetch/index.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
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 {};
|
55
dist/client/index.d.ts
vendored
Normal file
55
dist/client/index.d.ts
vendored
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
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;
|
14
dist/client/media/client.d.ts
vendored
Normal file
14
dist/client/media/client.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import imageInputFileToBase64 from "./imageInputFileToBase64";
|
||||||
|
import imageInputToBase64 from "./imageInputToBase64";
|
||||||
|
/**
|
||||||
|
* ==========================
|
||||||
|
* Main Export
|
||||||
|
* ==========================
|
||||||
|
*/
|
||||||
|
declare const datasquirelClient: {
|
||||||
|
media: {
|
||||||
|
imageInputToBase64: typeof imageInputToBase64;
|
||||||
|
imageInputFileToBase64: typeof imageInputFileToBase64;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export default datasquirelClient;
|
11
dist/client/media/imageInputFileToBase64.d.ts
vendored
Normal file
11
dist/client/media/imageInputFileToBase64.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
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
dist/client/media/imageInputToBase64.d.ts
vendored
Normal file
15
dist/client/media/imageInputToBase64.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
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
dist/client/media/inputFileToBase64.d.ts
vendored
Normal file
21
dist/client/media/inputFileToBase64.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
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
dist/client/utils/parseClientCookies.d.ts
vendored
Normal file
8
dist/client/utils/parseClientCookies.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* 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;
|
28
dist/console-colors.d.ts
vendored
Normal file
28
dist/console-colors.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
declare const colors: {
|
||||||
|
Reset: string;
|
||||||
|
Bright: string;
|
||||||
|
Dim: string;
|
||||||
|
Underscore: string;
|
||||||
|
Blink: string;
|
||||||
|
Reverse: string;
|
||||||
|
Hidden: string;
|
||||||
|
FgBlack: string;
|
||||||
|
FgRed: string;
|
||||||
|
FgGreen: string;
|
||||||
|
FgYellow: string;
|
||||||
|
FgBlue: string;
|
||||||
|
FgMagenta: string;
|
||||||
|
FgCyan: string;
|
||||||
|
FgWhite: string;
|
||||||
|
FgGray: string;
|
||||||
|
BgBlack: string;
|
||||||
|
BgRed: string;
|
||||||
|
BgGreen: string;
|
||||||
|
BgYellow: string;
|
||||||
|
BgBlue: string;
|
||||||
|
BgMagenta: string;
|
||||||
|
BgCyan: string;
|
||||||
|
BgWhite: string;
|
||||||
|
BgGray: string;
|
||||||
|
};
|
||||||
|
export default colors;
|
2
dist/engine/dsql.d.ts
vendored
Normal file
2
dist/engine/dsql.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#! /usr/bin/env node
|
||||||
|
export default function run(): Promise<void>;
|
2
dist/engine/dump.d.ts
vendored
Normal file
2
dist/engine/dump.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#! /usr/bin/env node
|
||||||
|
export {};
|
2
dist/engine/schema-to-typedef.d.ts
vendored
Normal file
2
dist/engine/schema-to-typedef.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#! /usr/bin/env node
|
||||||
|
export {};
|
146
dist/index.d.ts
vendored
Normal file
146
dist/index.d.ts
vendored
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
import { ServerlessMysql } from "serverless-mysql";
|
||||||
|
declare global {
|
||||||
|
var DSQL_DB_CONN: ServerlessMysql | undefined;
|
||||||
|
var DSQL_READ_ONLY_DB_CONN: ServerlessMysql | undefined;
|
||||||
|
var DSQL_FULL_ACCESS_DB_CONN: ServerlessMysql | undefined;
|
||||||
|
var DSQL_USE_LOCAL: boolean | undefined;
|
||||||
|
var ERROR_CALLBACK: ErrorCallback | undefined;
|
||||||
|
}
|
||||||
|
import get from "./package-shared/actions/get";
|
||||||
|
import post from "./package-shared/actions/post";
|
||||||
|
import getSchema from "./package-shared/actions/get-schema";
|
||||||
|
import uploadImage from "./package-shared/actions/upload-image";
|
||||||
|
import uploadFile from "./package-shared/actions/upload-file";
|
||||||
|
import deleteFile from "./package-shared/actions/delete-file";
|
||||||
|
import createUser from "./package-shared/actions/users/add-user";
|
||||||
|
import updateUser from "./package-shared/actions/users/update-user";
|
||||||
|
import loginUser from "./package-shared/actions/users/login-user";
|
||||||
|
import sendEmailCode from "./package-shared/actions/users/send-email-code";
|
||||||
|
import logoutUser from "./package-shared/actions/users/logout-user";
|
||||||
|
import userAuth from "./package-shared/actions/users/user-auth";
|
||||||
|
import reAuthUser from "./package-shared/actions/users/reauth-user";
|
||||||
|
import getUser from "./package-shared/actions/users/get-user";
|
||||||
|
import loginWithGoogle from "./package-shared/actions/users/social/google-auth";
|
||||||
|
import loginWithGithub from "./package-shared/actions/users/social/github-auth";
|
||||||
|
import getToken from "./package-shared/actions/users/get-token";
|
||||||
|
import validateToken from "./package-shared/actions/users/validate-token";
|
||||||
|
import sqlGenerator from "./package-shared/functions/dsql/sql/sql-generator";
|
||||||
|
import sqlInsertGenerator from "./package-shared/functions/dsql/sql/sql-insert-generator";
|
||||||
|
import sqlDeleteGenerator from "./package-shared/functions/dsql/sql/sql-delete-generator";
|
||||||
|
import trimSql from "./package-shared/utils/trim-sql";
|
||||||
|
import parseCookies from "./package-shared/utils/backend/parseCookies";
|
||||||
|
import httpRequest from "./package-shared/functions/backend/httpRequest";
|
||||||
|
import connDbHandler from "./package-shared/utils/db/conn-db-handler";
|
||||||
|
import encrypt from "./package-shared/functions/dsql/encrypt";
|
||||||
|
import decrypt from "./package-shared/functions/dsql/decrypt";
|
||||||
|
import hashPassword from "./package-shared/functions/dsql/hashPassword";
|
||||||
|
import validateTempEmailCode from "./package-shared/actions/users/validate-temp-email-code";
|
||||||
|
import deleteUser from "./package-shared/actions/users/delete-user";
|
||||||
|
import dsqlCrud from "./package-shared/utils/data-fetching/crud";
|
||||||
|
import dsqlMethodCrud from "./package-shared/utils/data-fetching/method-crud";
|
||||||
|
import debugLog from "./package-shared/utils/logging/debug-log";
|
||||||
|
import { ErrorCallback } from "./package-shared/types";
|
||||||
|
import parseEnv from "./package-shared/utils/parse-env";
|
||||||
|
/**
|
||||||
|
* Main Export
|
||||||
|
*/
|
||||||
|
declare const datasquirel: {
|
||||||
|
/**
|
||||||
|
* Get Action
|
||||||
|
*/
|
||||||
|
get: typeof get;
|
||||||
|
/**
|
||||||
|
* Post Action
|
||||||
|
*/
|
||||||
|
post: typeof post;
|
||||||
|
media: {
|
||||||
|
uploadImage: typeof uploadImage;
|
||||||
|
uploadFile: typeof uploadFile;
|
||||||
|
deleteFile: typeof deleteFile;
|
||||||
|
};
|
||||||
|
user: {
|
||||||
|
createUser: typeof createUser;
|
||||||
|
deleteUser: typeof deleteUser;
|
||||||
|
loginUser: typeof loginUser;
|
||||||
|
sendEmailCode: typeof sendEmailCode;
|
||||||
|
logoutUser: typeof logoutUser;
|
||||||
|
userAuth: typeof userAuth;
|
||||||
|
reAuthUser: typeof reAuthUser;
|
||||||
|
updateUser: typeof updateUser;
|
||||||
|
getUser: typeof getUser;
|
||||||
|
getToken: typeof getToken;
|
||||||
|
validateToken: typeof validateToken;
|
||||||
|
validateTempEmailCode: typeof validateTempEmailCode;
|
||||||
|
social: {
|
||||||
|
loginWithGoogle: typeof loginWithGoogle;
|
||||||
|
loginWithGithub: typeof loginWithGithub;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
getSchema: typeof getSchema;
|
||||||
|
client: {
|
||||||
|
media: {
|
||||||
|
imageInputToBase64: typeof import("./client/media/imageInputToBase64").default;
|
||||||
|
imageInputFileToBase64: typeof import("./client/media/imageInputFileToBase64").default;
|
||||||
|
inputFileToBase64: typeof import("./client/media/inputFileToBase64").default;
|
||||||
|
};
|
||||||
|
auth: {
|
||||||
|
google: {
|
||||||
|
getAccessToken: typeof import("./client/auth/google/getAccessToken").default;
|
||||||
|
};
|
||||||
|
github: {
|
||||||
|
getAccessToken: typeof import("./client/auth/github/getAccessToken").default;
|
||||||
|
};
|
||||||
|
logout: typeof import("./client/auth/logout").default;
|
||||||
|
postLogin: typeof import("./client/auth/post-login").default;
|
||||||
|
};
|
||||||
|
fetch: {
|
||||||
|
fetchApi: typeof import("./client/fetch").default;
|
||||||
|
clientFetch: typeof import("./client/fetch").default;
|
||||||
|
};
|
||||||
|
utils: {
|
||||||
|
deserializeQuery: typeof import("./package-shared/utils/deserialize-query").default;
|
||||||
|
serializeQuery: typeof import("./package-shared/utils/serialize-query").default;
|
||||||
|
serializeCookies: typeof import("./package-shared/utils/serialize-cookies").default;
|
||||||
|
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 import("./package-shared/utils/numberfy").default;
|
||||||
|
slugify: typeof import("./package-shared/utils/slugify").default;
|
||||||
|
debugLog: typeof debugLog;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
sql: {
|
||||||
|
sqlGenerator: typeof sqlGenerator;
|
||||||
|
sqlInsertGenerator: typeof sqlInsertGenerator;
|
||||||
|
sqlDeleteGenerator: typeof sqlDeleteGenerator;
|
||||||
|
trim: typeof trimSql;
|
||||||
|
};
|
||||||
|
utils: {
|
||||||
|
crypto: {
|
||||||
|
encrypt: typeof encrypt;
|
||||||
|
decrypt: typeof decrypt;
|
||||||
|
hashPassword: typeof hashPassword;
|
||||||
|
};
|
||||||
|
parseCookies: typeof parseCookies;
|
||||||
|
httpRequest: typeof httpRequest;
|
||||||
|
connDbHandler: typeof connDbHandler;
|
||||||
|
debugLog: typeof debugLog;
|
||||||
|
parseEnv: typeof parseEnv;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Run Crud actions `get`, `insert`, `update`, `delete`
|
||||||
|
* @note *Requires global variables `DSQL_USE_LOCAL` and `DSQL_DB_CONN`
|
||||||
|
*/
|
||||||
|
crud: typeof dsqlCrud;
|
||||||
|
/**
|
||||||
|
* Run Crud based on request Methods `GET`, `POST`, `PUT`, `PATCH`
|
||||||
|
* @note *Requires global variables `DSQL_USE_LOCAL` and `DSQL_DB_CONN`
|
||||||
|
*/
|
||||||
|
methodCrud: typeof dsqlMethodCrud;
|
||||||
|
};
|
||||||
|
export default datasquirel;
|
18
dist/package-shared/actions/delete-file.d.ts
vendored
Normal file
18
dist/package-shared/actions/delete-file.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
interface Return {
|
||||||
|
success: boolean;
|
||||||
|
payload: {
|
||||||
|
urlPath: string;
|
||||||
|
urlThumbnailPath: string;
|
||||||
|
} | null;
|
||||||
|
msg?: string;
|
||||||
|
}
|
||||||
|
type Param = {
|
||||||
|
key: string;
|
||||||
|
url: string;
|
||||||
|
user_id?: string | number;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Delete File via API
|
||||||
|
*/
|
||||||
|
export default function deleteFile({ key, url, user_id, }: Param): Promise<Return>;
|
||||||
|
export {};
|
1
dist/package-shared/actions/get-csrf-header-name.d.ts
vendored
Normal file
1
dist/package-shared/actions/get-csrf-header-name.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
export default function getCsrfHeaderName(): string;
|
10
dist/package-shared/actions/get-schema.d.ts
vendored
Normal file
10
dist/package-shared/actions/get-schema.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { DSQL_DatabaseSchemaType, DSQL_FieldSchemaType, DSQL_TableSchemaType, GetSchemaAPIParam } from "../types";
|
||||||
|
type GetSchemaReturn = {
|
||||||
|
success: boolean;
|
||||||
|
payload?: DSQL_DatabaseSchemaType | DSQL_TableSchemaType | DSQL_FieldSchemaType | null;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Get Schema for Database, table, or field *
|
||||||
|
*/
|
||||||
|
export default function getSchema({ key, database, field, table, user_id, env, }: GetSchemaAPIParam): Promise<GetSchemaReturn>;
|
||||||
|
export {};
|
25
dist/package-shared/actions/get.d.ts
vendored
Normal file
25
dist/package-shared/actions/get.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { ApiGetQueryObject, GetReturn } from "../types";
|
||||||
|
type Param<T extends {
|
||||||
|
[k: string]: any;
|
||||||
|
} = {
|
||||||
|
[k: string]: any;
|
||||||
|
}> = {
|
||||||
|
key?: string;
|
||||||
|
db?: string;
|
||||||
|
query: string | ApiGetQueryObject<T>;
|
||||||
|
queryValues?: string[];
|
||||||
|
tableName?: string;
|
||||||
|
user_id?: string | number;
|
||||||
|
debug?: boolean;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
export type ApiGetParams = Param;
|
||||||
|
/**
|
||||||
|
* # Make a get request to Datasquirel API
|
||||||
|
*/
|
||||||
|
export default function get<T extends {
|
||||||
|
[k: string]: any;
|
||||||
|
} = {
|
||||||
|
[k: string]: any;
|
||||||
|
}>({ key, db, query, queryValues, tableName, user_id, debug, forceLocal, }: Param<T>): Promise<GetReturn>;
|
||||||
|
export {};
|
15
dist/package-shared/actions/post.d.ts
vendored
Normal file
15
dist/package-shared/actions/post.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { PostDataPayload, PostReturn } from "../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database?: string;
|
||||||
|
query: string | PostDataPayload;
|
||||||
|
queryValues?: any[];
|
||||||
|
tableName?: string;
|
||||||
|
user_id?: boolean;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Make a post request to Datasquirel API
|
||||||
|
*/
|
||||||
|
export default function post({ key, query, queryValues, database, tableName, user_id, forceLocal, }: Param): Promise<PostReturn>;
|
||||||
|
export {};
|
23
dist/package-shared/actions/upload-file.d.ts
vendored
Normal file
23
dist/package-shared/actions/upload-file.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
interface Return {
|
||||||
|
success: boolean;
|
||||||
|
payload: {
|
||||||
|
urlPath: string;
|
||||||
|
} | null;
|
||||||
|
msg?: string;
|
||||||
|
}
|
||||||
|
type Param = {
|
||||||
|
key: string;
|
||||||
|
payload: {
|
||||||
|
fileData: string;
|
||||||
|
fileName: string;
|
||||||
|
mimeType?: string;
|
||||||
|
folder?: string;
|
||||||
|
isPrivate?: boolean;
|
||||||
|
};
|
||||||
|
user_id?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Upload File via API
|
||||||
|
*/
|
||||||
|
export default function uploadImage({ key, payload, user_id, }: Param): Promise<Return>;
|
||||||
|
export {};
|
25
dist/package-shared/actions/upload-image.d.ts
vendored
Normal file
25
dist/package-shared/actions/upload-image.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
interface FunctionReturn {
|
||||||
|
success: boolean;
|
||||||
|
payload: {
|
||||||
|
urlPath: string;
|
||||||
|
urlThumbnailPath: string;
|
||||||
|
} | null;
|
||||||
|
msg?: string;
|
||||||
|
}
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
payload: {
|
||||||
|
imageData: string;
|
||||||
|
imageName: string;
|
||||||
|
mimeType?: string;
|
||||||
|
thumbnailSize?: number;
|
||||||
|
folder?: string;
|
||||||
|
isPrivate?: boolean;
|
||||||
|
};
|
||||||
|
user_id?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Upload Image via API
|
||||||
|
*/
|
||||||
|
export default function uploadImage({ key, payload, user_id, }: Param): Promise<FunctionReturn>;
|
||||||
|
export {};
|
15
dist/package-shared/actions/users/add-user.d.ts
vendored
Normal file
15
dist/package-shared/actions/users/add-user.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { AddUserFunctionReturn, UserDataPayload } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database?: string;
|
||||||
|
payload: UserDataPayload;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
user_id?: string | number;
|
||||||
|
apiUserId?: string | number;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Add User to Database
|
||||||
|
*/
|
||||||
|
export default function addUser({ key, payload, database, encryptionKey, user_id, apiUserId, }: Param): Promise<AddUserFunctionReturn>;
|
||||||
|
export {};
|
12
dist/package-shared/actions/users/delete-user.d.ts
vendored
Normal file
12
dist/package-shared/actions/users/delete-user.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { UpdateUserFunctionReturn } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database?: string;
|
||||||
|
deletedUserId: string | number;
|
||||||
|
user_id?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Update User
|
||||||
|
*/
|
||||||
|
export default function deleteUser({ key, database, user_id, deletedUserId, }: Param): Promise<UpdateUserFunctionReturn>;
|
||||||
|
export {};
|
20
dist/package-shared/actions/users/get-token.d.ts
vendored
Normal file
20
dist/package-shared/actions/users/get-token.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import http from "http";
|
||||||
|
type Param = {
|
||||||
|
request?: http.IncomingMessage;
|
||||||
|
cookieString?: string;
|
||||||
|
encryptionKey: string;
|
||||||
|
encryptionSalt: string;
|
||||||
|
database: string;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
key: string | undefined;
|
||||||
|
csrf: string | undefined;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Get just the access token for user
|
||||||
|
* ==============================================================================
|
||||||
|
* @description This Function takes in a request object and returns a user token
|
||||||
|
* string and csrf token string
|
||||||
|
*/
|
||||||
|
export default function getToken({ request, encryptionKey, encryptionSalt, cookieString, }: Param): Return;
|
||||||
|
export {};
|
13
dist/package-shared/actions/users/get-user.d.ts
vendored
Normal file
13
dist/package-shared/actions/users/get-user.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { GetUserFunctionReturn } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key: string;
|
||||||
|
database: string;
|
||||||
|
userId: number;
|
||||||
|
fields?: string[];
|
||||||
|
apiUserId?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Get User
|
||||||
|
*/
|
||||||
|
export default function getUser({ key, userId, database, fields, apiUserId, }: Param): Promise<GetUserFunctionReturn>;
|
||||||
|
export {};
|
37
dist/package-shared/actions/users/login-user.d.ts
vendored
Normal file
37
dist/package-shared/actions/users/login-user.d.ts
vendored
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { APILoginFunctionReturn } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database: string;
|
||||||
|
payload: {
|
||||||
|
email?: string;
|
||||||
|
username?: string;
|
||||||
|
password?: string;
|
||||||
|
};
|
||||||
|
additionalFields?: string[];
|
||||||
|
request?: http.IncomingMessage & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
response?: http.ServerResponse & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
email_login?: boolean;
|
||||||
|
email_login_code?: string;
|
||||||
|
temp_code_field?: string;
|
||||||
|
token?: boolean;
|
||||||
|
user_id?: string | number;
|
||||||
|
skipPassword?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
|
skipWriteAuthFile?: boolean;
|
||||||
|
apiUserID?: string | number;
|
||||||
|
dbUserId?: string | number;
|
||||||
|
cleanupTokens?: boolean;
|
||||||
|
secureCookie?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Login A user
|
||||||
|
*/
|
||||||
|
export default function loginUser({ key, payload, database, additionalFields, response, encryptionKey, encryptionSalt, email_login, email_login_code, temp_code_field, token, user_id, skipPassword, apiUserID, skipWriteAuthFile, dbUserId, debug, cleanupTokens, secureCookie, request, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
|
export {};
|
24
dist/package-shared/actions/users/logout-user.d.ts
vendored
Normal file
24
dist/package-shared/actions/users/logout-user.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import http from "http";
|
||||||
|
type Param = {
|
||||||
|
encryptedUserString?: string;
|
||||||
|
request?: http.IncomingMessage & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
response?: http.ServerResponse & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
cookieString?: string;
|
||||||
|
database?: string;
|
||||||
|
dsqlUserId?: string | number;
|
||||||
|
debug?: boolean;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
success: boolean;
|
||||||
|
msg: string;
|
||||||
|
cookieNames?: any;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Logout user
|
||||||
|
*/
|
||||||
|
export default function logoutUser({ response, database, dsqlUserId, encryptedUserString, request, cookieString, debug, }: Param): Return;
|
||||||
|
export {};
|
20
dist/package-shared/actions/users/reauth-user.d.ts
vendored
Normal file
20
dist/package-shared/actions/users/reauth-user.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { APILoginFunctionReturn } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database?: string;
|
||||||
|
response?: http.ServerResponse;
|
||||||
|
request?: http.IncomingMessage;
|
||||||
|
level?: "deep" | "normal";
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
additionalFields?: string[];
|
||||||
|
encryptedUserString?: string;
|
||||||
|
user_id?: string | number;
|
||||||
|
secureCookie?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Reauthorize User
|
||||||
|
*/
|
||||||
|
export default function reauthUser({ key, database, response, request, level, encryptionKey, encryptionSalt, additionalFields, encryptedUserString, user_id, secureCookie, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
|
export {};
|
23
dist/package-shared/actions/users/send-email-code.d.ts
vendored
Normal file
23
dist/package-shared/actions/users/send-email-code.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { SendOneTimeCodeEmailResponse } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database?: string;
|
||||||
|
email: string;
|
||||||
|
temp_code_field_name?: string;
|
||||||
|
response?: http.ServerResponse & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
mail_domain?: string;
|
||||||
|
mail_username?: string;
|
||||||
|
mail_password?: string;
|
||||||
|
mail_port?: number;
|
||||||
|
sender?: string;
|
||||||
|
user_id?: boolean;
|
||||||
|
extraCookies?: import("../../types").CookieObject[];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Send Email Code to a User
|
||||||
|
*/
|
||||||
|
export default function sendEmailCode({ key, email, database, temp_code_field_name, mail_domain, mail_password, mail_username, mail_port, sender, user_id, response, extraCookies, }: Param): Promise<SendOneTimeCodeEmailResponse>;
|
||||||
|
export {};
|
35
dist/package-shared/actions/users/social/github-auth.d.ts
vendored
Normal file
35
dist/package-shared/actions/users/social/github-auth.d.ts
vendored
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import http from "http";
|
||||||
|
interface FunctionReturn {
|
||||||
|
success: boolean;
|
||||||
|
user: {
|
||||||
|
id: number;
|
||||||
|
first_name: string;
|
||||||
|
last_name: string;
|
||||||
|
csrf_k: string;
|
||||||
|
social_id: string;
|
||||||
|
} | null;
|
||||||
|
dsqlUserId?: number;
|
||||||
|
msg?: string;
|
||||||
|
}
|
||||||
|
type Param = {
|
||||||
|
key: string;
|
||||||
|
code: string;
|
||||||
|
email: string | null;
|
||||||
|
database: string;
|
||||||
|
clientId: string;
|
||||||
|
clientSecret: string;
|
||||||
|
response: http.ServerResponse;
|
||||||
|
encryptionKey: string;
|
||||||
|
encryptionSalt: string;
|
||||||
|
additionalFields?: string[];
|
||||||
|
additionalData?: {
|
||||||
|
[s: string]: string | number;
|
||||||
|
};
|
||||||
|
user_id?: boolean;
|
||||||
|
secureCookie?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # SERVER FUNCTION: Login with google Function
|
||||||
|
*/
|
||||||
|
export default function githubAuth({ key, code, email, database, clientId, clientSecret, response, encryptionKey, encryptionSalt, additionalFields, user_id, additionalData, secureCookie, }: Param): Promise<FunctionReturn | undefined>;
|
||||||
|
export {};
|
22
dist/package-shared/actions/users/social/google-auth.d.ts
vendored
Normal file
22
dist/package-shared/actions/users/social/google-auth.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { APILoginFunctionReturn } from "../../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
token: string;
|
||||||
|
database?: string;
|
||||||
|
response?: http.ServerResponse;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
additionalFields?: string[];
|
||||||
|
additionalData?: {
|
||||||
|
[s: string]: string | number;
|
||||||
|
};
|
||||||
|
apiUserID?: string | number;
|
||||||
|
debug?: boolean;
|
||||||
|
secureCookie?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # SERVER FUNCTION: Login with google Function
|
||||||
|
*/
|
||||||
|
export default function googleAuth({ key, token, database, response, encryptionKey, encryptionSalt, additionalFields, additionalData, apiUserID, debug, secureCookie, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
|
export {};
|
15
dist/package-shared/actions/users/update-user.d.ts
vendored
Normal file
15
dist/package-shared/actions/users/update-user.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { UpdateUserFunctionReturn } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database?: string;
|
||||||
|
updatedUserId: string | number;
|
||||||
|
payload: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
user_id?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Update User
|
||||||
|
*/
|
||||||
|
export default function updateUser({ key, payload, database, user_id, updatedUserId, }: Param): Promise<UpdateUserFunctionReturn>;
|
||||||
|
export {};
|
28
dist/package-shared/actions/users/user-auth.d.ts
vendored
Normal file
28
dist/package-shared/actions/users/user-auth.d.ts
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { AuthenticatedUser } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
request?: http.IncomingMessage & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
req?: http.IncomingMessage & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
cookieString?: string;
|
||||||
|
encryptedUserString?: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
level?: "deep" | "normal";
|
||||||
|
database?: string;
|
||||||
|
dsqlUserId?: string | number;
|
||||||
|
expiry?: number;
|
||||||
|
csrfHeaderName?: string;
|
||||||
|
debug?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Authenticate User from request
|
||||||
|
* ==============================================================================
|
||||||
|
* @description This Function takes in a request object and returns a user object
|
||||||
|
* with the user's data
|
||||||
|
*/
|
||||||
|
export default function userAuth({ request, req, encryptionKey, encryptionSalt, level, database, dsqlUserId, encryptedUserString, expiry, cookieString, csrfHeaderName, debug, }: Param): AuthenticatedUser;
|
||||||
|
export {};
|
14
dist/package-shared/actions/users/validate-temp-email-code.d.ts
vendored
Normal file
14
dist/package-shared/actions/users/validate-temp-email-code.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { SendOneTimeCodeEmailResponse } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
request?: http.IncomingMessage & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
cookieString?: string;
|
||||||
|
email?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Verify the temp email code sent to the user's email address
|
||||||
|
*/
|
||||||
|
export default function validateTempEmailCode({ request, email, cookieString, }: Param): Promise<SendOneTimeCodeEmailResponse | null>;
|
||||||
|
export {};
|
15
dist/package-shared/actions/users/validate-token.d.ts
vendored
Normal file
15
dist/package-shared/actions/users/validate-token.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import { DATASQUIREL_LoggedInUser } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
token: string;
|
||||||
|
encryptionKey: string;
|
||||||
|
encryptionSalt: string;
|
||||||
|
level?: ("deep" | "normal") | null;
|
||||||
|
database: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Validate Token
|
||||||
|
* ======================================
|
||||||
|
* @description This Function takes in a encrypted token and returns a user object
|
||||||
|
*/
|
||||||
|
export default function validateToken({ token, encryptionKey, encryptionSalt, }: Param): DATASQUIREL_LoggedInUser | null;
|
||||||
|
export {};
|
0
dist/package-shared/external-services/arcjet/index.d.ts
vendored
Normal file
0
dist/package-shared/external-services/arcjet/index.d.ts
vendored
Normal file
25
dist/package-shared/functions/api/query/get.d.ts
vendored
Normal file
25
dist/package-shared/functions/api/query/get.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { DbContextsArray } from "../../backend/db/runQuery";
|
||||||
|
import { ApiGetQueryObject } from "../../../types";
|
||||||
|
type Param<T extends {
|
||||||
|
[key: string]: any;
|
||||||
|
} = {
|
||||||
|
[key: string]: any;
|
||||||
|
}> = {
|
||||||
|
query: string | ApiGetQueryObject<T>;
|
||||||
|
queryValues?: (string | number)[];
|
||||||
|
dbFullName: string;
|
||||||
|
tableName?: string;
|
||||||
|
dbSchema?: import("../../../types").DSQL_DatabaseSchemaType;
|
||||||
|
debug?: boolean;
|
||||||
|
dbContext?: (typeof DbContextsArray)[number];
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Get Function FOr API
|
||||||
|
*/
|
||||||
|
export default function apiGet<T extends {
|
||||||
|
[key: string]: any;
|
||||||
|
} = {
|
||||||
|
[key: string]: any;
|
||||||
|
}>({ query, dbFullName, queryValues, tableName, dbSchema, debug, dbContext, forceLocal, }: Param<T>): Promise<import("../../../types").GetReturn>;
|
||||||
|
export {};
|
16
dist/package-shared/functions/api/query/post.d.ts
vendored
Normal file
16
dist/package-shared/functions/api/query/post.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { DbContextsArray } from "../../backend/db/runQuery";
|
||||||
|
import { DSQL_DatabaseSchemaType, PostReturn } from "../../../types";
|
||||||
|
type Param = {
|
||||||
|
query: any;
|
||||||
|
queryValues?: (string | number)[];
|
||||||
|
dbFullName: string;
|
||||||
|
tableName?: string;
|
||||||
|
dbSchema?: DSQL_DatabaseSchemaType;
|
||||||
|
dbContext?: (typeof DbContextsArray)[number];
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Post Function For API
|
||||||
|
*/
|
||||||
|
export default function apiPost({ query, dbFullName, queryValues, tableName, dbSchema, dbContext, forceLocal, }: Param): Promise<PostReturn>;
|
||||||
|
export {};
|
8
dist/package-shared/functions/api/social-login/facebookLogin.d.ts
vendored
Normal file
8
dist/package-shared/functions/api/social-login/facebookLogin.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { UserType } from "../../../types";
|
||||||
|
/**
|
||||||
|
* # Facebook Login
|
||||||
|
*/
|
||||||
|
export default function facebookLogin({ usertype, body, }: {
|
||||||
|
body: any;
|
||||||
|
usertype: UserType;
|
||||||
|
}): Promise<any>;
|
43
dist/package-shared/functions/api/social-login/githubLogin.d.ts
vendored
Normal file
43
dist/package-shared/functions/api/social-login/githubLogin.d.ts
vendored
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
export interface GithubUserPayload {
|
||||||
|
login: string;
|
||||||
|
id: number;
|
||||||
|
node_id: string;
|
||||||
|
avatar_url: string;
|
||||||
|
gravatar_id: string;
|
||||||
|
url: string;
|
||||||
|
html_url: string;
|
||||||
|
followers_url: string;
|
||||||
|
following_url: string;
|
||||||
|
gists_url: string;
|
||||||
|
starred_url: string;
|
||||||
|
subscriptions_url: string;
|
||||||
|
organizations_url: string;
|
||||||
|
repos_url: string;
|
||||||
|
received_events_url: string;
|
||||||
|
type: string;
|
||||||
|
site_admin: boolean;
|
||||||
|
name: string;
|
||||||
|
company: string;
|
||||||
|
blog: string;
|
||||||
|
location: string;
|
||||||
|
email: string;
|
||||||
|
hireable: string;
|
||||||
|
bio: string;
|
||||||
|
twitter_username: string;
|
||||||
|
public_repos: number;
|
||||||
|
public_gists: number;
|
||||||
|
followers: number;
|
||||||
|
following: number;
|
||||||
|
created_at: string;
|
||||||
|
updated_at: string;
|
||||||
|
}
|
||||||
|
type Param = {
|
||||||
|
code: string;
|
||||||
|
clientId: string;
|
||||||
|
clientSecret: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Login/signup a github user
|
||||||
|
*/
|
||||||
|
export default function githubLogin({ code, clientId, clientSecret, }: Param): Promise<GithubUserPayload | null | undefined>;
|
||||||
|
export {};
|
22
dist/package-shared/functions/api/social-login/googleLogin.d.ts
vendored
Normal file
22
dist/package-shared/functions/api/social-login/googleLogin.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
type Param = {
|
||||||
|
usertype: string;
|
||||||
|
foundUser: any;
|
||||||
|
isSocialValidated: boolean;
|
||||||
|
isUserValid: boolean;
|
||||||
|
reqBody: any;
|
||||||
|
serverRes: any;
|
||||||
|
loginFailureReason: any;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Google Login
|
||||||
|
*/
|
||||||
|
export default function googleLogin({ usertype, foundUser, isSocialValidated, isUserValid, reqBody, serverRes, loginFailureReason, }: Param): Promise<{
|
||||||
|
isGoogleAuthValid: boolean;
|
||||||
|
newFoundUser: null;
|
||||||
|
loginFailureReason: any;
|
||||||
|
} | {
|
||||||
|
isGoogleAuthValid: boolean;
|
||||||
|
newFoundUser: any;
|
||||||
|
loginFailureReason?: undefined;
|
||||||
|
} | undefined>;
|
||||||
|
export {};
|
5
dist/package-shared/functions/api/social-login/handleSocialDb.d.ts
vendored
Normal file
5
dist/package-shared/functions/api/social-login/handleSocialDb.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { APILoginFunctionReturn, HandleSocialDbFunctionParams } from "../../../types";
|
||||||
|
/**
|
||||||
|
* # Handle Social DB
|
||||||
|
*/
|
||||||
|
export default function handleSocialDb({ database, social_id, email, social_platform, payload, invitation, supEmail, additionalFields, debug, }: HandleSocialDbFunctionParams): Promise<APILoginFunctionReturn>;
|
22
dist/package-shared/functions/api/social-login/loginSocialUser.d.ts
vendored
Normal file
22
dist/package-shared/functions/api/social-login/loginSocialUser.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { APILoginFunctionReturn } from "../../../types";
|
||||||
|
type Param = {
|
||||||
|
user: {
|
||||||
|
first_name: string;
|
||||||
|
last_name: string;
|
||||||
|
email: string;
|
||||||
|
social_id: string | number;
|
||||||
|
};
|
||||||
|
social_platform: string;
|
||||||
|
invitation?: any;
|
||||||
|
database?: string;
|
||||||
|
additionalFields?: string[];
|
||||||
|
debug?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Function to login social user
|
||||||
|
* ==============================================================================
|
||||||
|
* @description This function logs in the user after 'handleSocialDb' function finishes
|
||||||
|
* the user creation or confirmation process
|
||||||
|
*/
|
||||||
|
export default function loginSocialUser({ user, social_platform, invitation, database, additionalFields, debug, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
|
export {};
|
25
dist/package-shared/functions/api/users/api-create-user.d.ts
vendored
Normal file
25
dist/package-shared/functions/api/users/api-create-user.d.ts
vendored
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { APICreateUserFunctionParams } from "../../../types";
|
||||||
|
/**
|
||||||
|
* # API Create User
|
||||||
|
*/
|
||||||
|
export default function apiCreateUser({ encryptionKey, payload, database, userId, }: APICreateUserFunctionParams): Promise<{
|
||||||
|
success: boolean;
|
||||||
|
msg: string;
|
||||||
|
payload?: undefined;
|
||||||
|
sqlResult?: undefined;
|
||||||
|
} | {
|
||||||
|
success: boolean;
|
||||||
|
msg: string | undefined;
|
||||||
|
payload: null;
|
||||||
|
sqlResult?: undefined;
|
||||||
|
} | {
|
||||||
|
success: boolean;
|
||||||
|
payload: any;
|
||||||
|
msg?: undefined;
|
||||||
|
sqlResult?: undefined;
|
||||||
|
} | {
|
||||||
|
success: boolean;
|
||||||
|
msg: string;
|
||||||
|
sqlResult: any;
|
||||||
|
payload: null;
|
||||||
|
}>;
|
14
dist/package-shared/functions/api/users/api-delete-user.d.ts
vendored
Normal file
14
dist/package-shared/functions/api/users/api-delete-user.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
type Param = {
|
||||||
|
dbFullName: string;
|
||||||
|
deletedUserId: string | number;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
success: boolean;
|
||||||
|
result?: any;
|
||||||
|
msg?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Update API User Function
|
||||||
|
*/
|
||||||
|
export default function apiDeleteUser({ dbFullName, deletedUserId, }: Param): Promise<Return>;
|
||||||
|
export {};
|
5
dist/package-shared/functions/api/users/api-get-user.d.ts
vendored
Normal file
5
dist/package-shared/functions/api/users/api-get-user.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { APIGetUserFunctionParams, GetUserFunctionReturn } from "../../../types";
|
||||||
|
/**
|
||||||
|
* # API Get User
|
||||||
|
*/
|
||||||
|
export default function apiGetUser({ fields, dbFullName, userId, }: APIGetUserFunctionParams): Promise<GetUserFunctionReturn>;
|
5
dist/package-shared/functions/api/users/api-login.d.ts
vendored
Normal file
5
dist/package-shared/functions/api/users/api-login.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { APILoginFunctionParams, APILoginFunctionReturn } from "../../../types";
|
||||||
|
/**
|
||||||
|
* # API Login
|
||||||
|
*/
|
||||||
|
export default function apiLoginUser({ encryptionKey, email, username, password, database, additionalFields, email_login, email_login_code, email_login_field, skipPassword, social, dbUserId, debug, }: APILoginFunctionParams): Promise<APILoginFunctionReturn>;
|
13
dist/package-shared/functions/api/users/api-reauth-user.d.ts
vendored
Normal file
13
dist/package-shared/functions/api/users/api-reauth-user.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { APILoginFunctionReturn } from "../../../types";
|
||||||
|
type Param = {
|
||||||
|
existingUser: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
database?: string;
|
||||||
|
additionalFields?: string[];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Re-authenticate API user
|
||||||
|
*/
|
||||||
|
export default function apiReauthUser({ existingUser, database, additionalFields, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
|
export {};
|
22
dist/package-shared/functions/api/users/api-send-email-code.d.ts
vendored
Normal file
22
dist/package-shared/functions/api/users/api-send-email-code.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import http from "http";
|
||||||
|
import { SendOneTimeCodeEmailResponse } from "../../../types";
|
||||||
|
type Param = {
|
||||||
|
email: string;
|
||||||
|
database: string;
|
||||||
|
email_login_field?: string;
|
||||||
|
mail_domain?: string;
|
||||||
|
mail_port?: number;
|
||||||
|
sender?: string;
|
||||||
|
mail_username?: string;
|
||||||
|
mail_password?: string;
|
||||||
|
html: string;
|
||||||
|
response?: http.ServerResponse & {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
extraCookies?: import("../../../../package-shared/types").CookieObject[];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Send Email Login Code
|
||||||
|
*/
|
||||||
|
export default function apiSendEmailCode({ email, database, email_login_field, mail_domain, mail_port, sender, mail_username, mail_password, html, response, extraCookies, }: Param): Promise<SendOneTimeCodeEmailResponse>;
|
||||||
|
export {};
|
18
dist/package-shared/functions/api/users/api-update-user.d.ts
vendored
Normal file
18
dist/package-shared/functions/api/users/api-update-user.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
type Param = {
|
||||||
|
payload: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
dbFullName: string;
|
||||||
|
updatedUserId: string | number;
|
||||||
|
dbSchema?: import("../../../types").DSQL_DatabaseSchemaType;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
success: boolean;
|
||||||
|
payload?: any;
|
||||||
|
msg?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Update API User Function
|
||||||
|
*/
|
||||||
|
export default function apiUpdateUser({ payload, dbFullName, updatedUserId, dbSchema, }: Param): Promise<Return>;
|
||||||
|
export {};
|
11
dist/package-shared/functions/api/users/reset-password/(utils)/encrypt-url.d.ts
vendored
Normal file
11
dist/package-shared/functions/api/users/reset-password/(utils)/encrypt-url.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
type Param = {
|
||||||
|
email: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
};
|
||||||
|
export type EncryptResetPasswordObject = {
|
||||||
|
email: string;
|
||||||
|
createdAt: number;
|
||||||
|
};
|
||||||
|
export default function encryptReserPasswordUrl({ email, encryptionKey, encryptionSalt, }: Param): void;
|
||||||
|
export {};
|
22
dist/package-shared/functions/api/users/reset-password/api-send-reset-password-link.d.ts
vendored
Normal file
22
dist/package-shared/functions/api/users/reset-password/api-send-reset-password-link.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
type Return = {
|
||||||
|
success: boolean;
|
||||||
|
msg?: string;
|
||||||
|
error?: string;
|
||||||
|
};
|
||||||
|
type Param = {
|
||||||
|
key?: string;
|
||||||
|
database: string;
|
||||||
|
email: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
debug?: boolean;
|
||||||
|
apiUserID?: string | number;
|
||||||
|
dbUserId?: string | number;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # API Login
|
||||||
|
*/
|
||||||
|
export default function apiSendResetPasswordLink({ database, email, dbUserId, debug, }: Param): Promise<Return>;
|
||||||
|
export type SendResetPasswordParam = Param;
|
||||||
|
export type SendResetPasswordReturn = Return;
|
||||||
|
export {};
|
17
dist/package-shared/functions/api/users/social/api-github-login.d.ts
vendored
Normal file
17
dist/package-shared/functions/api/users/social/api-github-login.d.ts
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { APILoginFunctionReturn } from "../../../../types";
|
||||||
|
type Param = {
|
||||||
|
code?: string;
|
||||||
|
clientId?: string;
|
||||||
|
clientSecret?: string;
|
||||||
|
database?: string;
|
||||||
|
additionalFields?: string[];
|
||||||
|
additionalData?: {
|
||||||
|
[s: string]: string | number;
|
||||||
|
};
|
||||||
|
email?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # API Login with Github
|
||||||
|
*/
|
||||||
|
export default function apiGithubLogin({ code, clientId, clientSecret, database, additionalFields, email, additionalData, }: Param): Promise<APILoginFunctionReturn>;
|
||||||
|
export {};
|
5
dist/package-shared/functions/api/users/social/api-google-login.d.ts
vendored
Normal file
5
dist/package-shared/functions/api/users/social/api-google-login.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import { APIGoogleLoginFunctionParams, APILoginFunctionReturn } from "../../../../types";
|
||||||
|
/**
|
||||||
|
* # API google login
|
||||||
|
*/
|
||||||
|
export default function apiGoogleLogin({ token, database, additionalFields, additionalData, debug, }: APIGoogleLoginFunctionParams): Promise<APILoginFunctionReturn>;
|
20
dist/package-shared/functions/backend/addAdminUserOnLogin.d.ts
vendored
Normal file
20
dist/package-shared/functions/backend/addAdminUserOnLogin.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { DATASQUIREL_LoggedInUser } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
query: {
|
||||||
|
invite: number;
|
||||||
|
database_access: string;
|
||||||
|
priviledge: string;
|
||||||
|
email: string;
|
||||||
|
};
|
||||||
|
user: DATASQUIREL_LoggedInUser;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Add Admin User on Login
|
||||||
|
* ==============================================================================
|
||||||
|
*
|
||||||
|
* @description this function handles admin users that have been invited by another
|
||||||
|
* admin user. This fires when the invited user has been logged in or a new account
|
||||||
|
* has been created for the invited user
|
||||||
|
*/
|
||||||
|
export default function addAdminUserOnLogin({ query, user, }: Param): Promise<any>;
|
||||||
|
export {};
|
8
dist/package-shared/functions/backend/addMariadbUser.d.ts
vendored
Normal file
8
dist/package-shared/functions/backend/addMariadbUser.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
type Param = {
|
||||||
|
userId: number | string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Add Mariadb User
|
||||||
|
*/
|
||||||
|
export default function addMariadbUser({ userId }: Param): Promise<any>;
|
||||||
|
export {};
|
12
dist/package-shared/functions/backend/addUsersTableToDb.d.ts
vendored
Normal file
12
dist/package-shared/functions/backend/addUsersTableToDb.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
type Param = {
|
||||||
|
userId: number;
|
||||||
|
database: string;
|
||||||
|
payload?: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Add User Table to Database
|
||||||
|
*/
|
||||||
|
export default function addUsersTableToDb({ userId, database, payload, }: Param): Promise<any>;
|
||||||
|
export {};
|
6
dist/package-shared/functions/backend/api-cred.d.ts
vendored
Normal file
6
dist/package-shared/functions/backend/api-cred.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { CheckApiCredentialsFn } from "../../types";
|
||||||
|
/**
|
||||||
|
* # Grap API Credentials
|
||||||
|
*/
|
||||||
|
declare const grabApiCred: CheckApiCredentialsFn;
|
||||||
|
export default grabApiCred;
|
29
dist/package-shared/functions/backend/auth/write-auth-files.d.ts
vendored
Normal file
29
dist/package-shared/functions/backend/auth/write-auth-files.d.ts
vendored
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
export declare const grabAuthDirs: () => {
|
||||||
|
root: string;
|
||||||
|
auth: string;
|
||||||
|
};
|
||||||
|
export declare const initAuthFiles: () => boolean;
|
||||||
|
/**
|
||||||
|
* # Write Auth Files
|
||||||
|
*/
|
||||||
|
export declare const writeAuthFile: (name: string, data: string, cleanup?: {
|
||||||
|
userId: string | number;
|
||||||
|
}) => boolean;
|
||||||
|
/**
|
||||||
|
* # Clean up User Auth Files
|
||||||
|
*/
|
||||||
|
export declare const cleanupUserAuthFiles: (userId: string | number) => boolean;
|
||||||
|
/**
|
||||||
|
* # Get Auth Files
|
||||||
|
*/
|
||||||
|
export declare const getAuthFile: (name: string) => string | null;
|
||||||
|
/**
|
||||||
|
* # Delete Auth Files
|
||||||
|
* @param {string} name
|
||||||
|
*/
|
||||||
|
export declare const deleteAuthFile: (name: string) => void | null;
|
||||||
|
/**
|
||||||
|
* # Delete Auth Files
|
||||||
|
* @param {string} name
|
||||||
|
*/
|
||||||
|
export declare const checkAuthFile: (name: string) => boolean;
|
14
dist/package-shared/functions/backend/cookies/get-auth-cookie-names.d.ts
vendored
Normal file
14
dist/package-shared/functions/backend/cookies/get-auth-cookie-names.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
type Param = {
|
||||||
|
database?: string;
|
||||||
|
userId?: string | number;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
keyCookieName: string;
|
||||||
|
csrfCookieName: string;
|
||||||
|
oneTimeCodeName: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Grab Auth Cookie Names
|
||||||
|
*/
|
||||||
|
export default function getAuthCookieNames(params?: Param): Return;
|
||||||
|
export {};
|
20
dist/package-shared/functions/backend/db/addDbEntry.d.ts
vendored
Normal file
20
dist/package-shared/functions/backend/db/addDbEntry.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { DbContextsArray } from "./runQuery";
|
||||||
|
type Param = {
|
||||||
|
dbContext?: (typeof DbContextsArray)[number];
|
||||||
|
paradigm?: "Read Only" | "Full Access";
|
||||||
|
dbFullName?: string;
|
||||||
|
tableName: string;
|
||||||
|
data: any;
|
||||||
|
tableSchema?: import("../../../types").DSQL_TableSchemaType;
|
||||||
|
duplicateColumnName?: string;
|
||||||
|
duplicateColumnValue?: string;
|
||||||
|
update?: boolean;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Add a db Entry Function
|
||||||
|
*/
|
||||||
|
export default function addDbEntry({ dbContext, paradigm, dbFullName, tableName, data, tableSchema, duplicateColumnName, duplicateColumnValue, update, encryptionKey, encryptionSalt, forceLocal, }: Param): Promise<any>;
|
||||||
|
export {};
|
16
dist/package-shared/functions/backend/db/deleteDbEntry.d.ts
vendored
Normal file
16
dist/package-shared/functions/backend/db/deleteDbEntry.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { DbContextsArray } from "./runQuery";
|
||||||
|
type Param = {
|
||||||
|
dbContext?: (typeof DbContextsArray)[number];
|
||||||
|
dbFullName: string;
|
||||||
|
tableName: string;
|
||||||
|
tableSchema?: import("../../../types").DSQL_TableSchemaType;
|
||||||
|
identifierColumnName: string;
|
||||||
|
identifierValue: string | number;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Delete DB Entry Function
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
export default function deleteDbEntry({ dbContext, dbFullName, tableName, identifierColumnName, identifierValue, forceLocal, }: Param): Promise<object | null>;
|
||||||
|
export {};
|
5
dist/package-shared/functions/backend/db/pathTraversalCheck.d.ts
vendored
Normal file
5
dist/package-shared/functions/backend/db/pathTraversalCheck.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/**
|
||||||
|
* # Path Traversal Check
|
||||||
|
* @returns {string}
|
||||||
|
*/
|
||||||
|
export default function pathTraversalCheck(text: string | number): string;
|
21
dist/package-shared/functions/backend/db/runQuery.d.ts
vendored
Normal file
21
dist/package-shared/functions/backend/db/runQuery.d.ts
vendored
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
export declare const DbContextsArray: readonly ["Master", "Dsql User"];
|
||||||
|
type Param = {
|
||||||
|
dbContext?: (typeof DbContextsArray)[number];
|
||||||
|
dbFullName: string;
|
||||||
|
query: string | any;
|
||||||
|
readOnly?: boolean;
|
||||||
|
debug?: boolean;
|
||||||
|
dbSchema?: import("../../../types").DSQL_DatabaseSchemaType;
|
||||||
|
queryValuesArray?: (string | number)[];
|
||||||
|
tableName?: string;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
result: any;
|
||||||
|
error?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Run DSQL users queries
|
||||||
|
*/
|
||||||
|
export default function runQuery({ dbFullName, query, readOnly, dbSchema, queryValuesArray, tableName, debug, dbContext, forceLocal, }: Param): Promise<Return>;
|
||||||
|
export {};
|
8
dist/package-shared/functions/backend/db/sanitizeSql.d.ts
vendored
Normal file
8
dist/package-shared/functions/backend/db/sanitizeSql.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
/**
|
||||||
|
* Sanitize SQL function
|
||||||
|
* ==============================================================================
|
||||||
|
* @description this function takes in a text(or number) and returns a sanitized
|
||||||
|
* text, usually without spaces
|
||||||
|
*/
|
||||||
|
declare function sanitizeSql(text: any, spaces?: boolean, regex?: RegExp | null): any;
|
||||||
|
export default sanitizeSql;
|
19
dist/package-shared/functions/backend/db/updateDbEntry.d.ts
vendored
Normal file
19
dist/package-shared/functions/backend/db/updateDbEntry.d.ts
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
import { DbContextsArray } from "./runQuery";
|
||||||
|
type Param = {
|
||||||
|
dbContext?: (typeof DbContextsArray)[number];
|
||||||
|
dbFullName?: string;
|
||||||
|
tableName: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
data: any;
|
||||||
|
tableSchema?: import("../../../types").DSQL_TableSchemaType;
|
||||||
|
identifierColumnName: string;
|
||||||
|
identifierValue: string | number;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Update DB Function
|
||||||
|
* @description
|
||||||
|
*/
|
||||||
|
export default function updateDbEntry({ dbContext, dbFullName, tableName, data, tableSchema, identifierColumnName, identifierValue, encryptionKey, encryptionSalt, forceLocal, }: Param): Promise<object | null>;
|
||||||
|
export {};
|
4
dist/package-shared/functions/backend/dbHandler.d.ts
vendored
Normal file
4
dist/package-shared/functions/backend/dbHandler.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* # Main DB Handler Function
|
||||||
|
*/
|
||||||
|
export default function dbHandler(...args: any[]): Promise<any>;
|
7
dist/package-shared/functions/backend/defaultFieldsRegexp.d.ts
vendored
Normal file
7
dist/package-shared/functions/backend/defaultFieldsRegexp.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Regular expression to match default fields
|
||||||
|
*
|
||||||
|
* @description Regular expression to match default fields
|
||||||
|
*/
|
||||||
|
declare const defaultFieldsRegexp: RegExp;
|
||||||
|
export default defaultFieldsRegexp;
|
11
dist/package-shared/functions/backend/fullAccessDbHandler.d.ts
vendored
Normal file
11
dist/package-shared/functions/backend/fullAccessDbHandler.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
type Param = {
|
||||||
|
queryString: string;
|
||||||
|
tableSchema?: import("../../types").DSQL_TableSchemaType | null;
|
||||||
|
queryValuesArray?: string[];
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Full Access Db Handler
|
||||||
|
*/
|
||||||
|
export default function fullAccessDbHandler({ queryString, tableSchema, queryValuesArray, forceLocal, }: Param): Promise<any>;
|
||||||
|
export {};
|
9
dist/package-shared/functions/backend/grabNewUsersTableSchema.d.ts
vendored
Normal file
9
dist/package-shared/functions/backend/grabNewUsersTableSchema.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { DSQL_TableSchemaType } from "../../types";
|
||||||
|
/**
|
||||||
|
* # Add User Table to Database
|
||||||
|
*/
|
||||||
|
export default function grabNewUsersTableSchema(params: {
|
||||||
|
payload?: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
}): DSQL_TableSchemaType | null;
|
16
dist/package-shared/functions/backend/grabSchemaFieldsFromData.d.ts
vendored
Normal file
16
dist/package-shared/functions/backend/grabSchemaFieldsFromData.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import { DSQL_FieldSchemaType } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
data?: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
fields?: string[];
|
||||||
|
excludeData?: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
excludeFields?: DSQL_FieldSchemaType[];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Add User Table to Database
|
||||||
|
*/
|
||||||
|
export default function grabSchemaFieldsFromData({ data, fields, excludeData, excludeFields, }: Param): DSQL_FieldSchemaType[];
|
||||||
|
export {};
|
6
dist/package-shared/functions/backend/grabUserSchemaData.d.ts
vendored
Normal file
6
dist/package-shared/functions/backend/grabUserSchemaData.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
/**
|
||||||
|
* # Grab User Schema Data
|
||||||
|
*/
|
||||||
|
export default function grabUserSchemaData({ userId, }: {
|
||||||
|
userId: string | number;
|
||||||
|
}): import("../../types").DSQL_DatabaseSchemaType[] | null;
|
11
dist/package-shared/functions/backend/handleNodemailer.d.ts
vendored
Normal file
11
dist/package-shared/functions/backend/handleNodemailer.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import Mail from "nodemailer/lib/mailer";
|
||||||
|
import SMTPTransport from "nodemailer/lib/smtp-transport";
|
||||||
|
export type HandleNodemailerParam = Mail.Options & {
|
||||||
|
senderName?: string;
|
||||||
|
alias?: string | null;
|
||||||
|
options?: SMTPTransport.Options;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Handle mails With Nodemailer
|
||||||
|
*/
|
||||||
|
export default function handleNodemailer(params: HandleNodemailerParam): Promise<SMTPTransport.SentMessageInfo | undefined>;
|
9
dist/package-shared/functions/backend/html/sanitizeHtmlOptions.d.ts
vendored
Normal file
9
dist/package-shared/functions/backend/html/sanitizeHtmlOptions.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
declare const sanitizeHtmlOptions: {
|
||||||
|
allowedTags: string[];
|
||||||
|
allowedAttributes: {
|
||||||
|
a: string[];
|
||||||
|
img: string[];
|
||||||
|
"*": string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
export default sanitizeHtmlOptions;
|
13
dist/package-shared/functions/backend/httpRequest.d.ts
vendored
Normal file
13
dist/package-shared/functions/backend/httpRequest.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import { HttpFunctionResponse, HttpRequestParams } from "../../types";
|
||||||
|
/**
|
||||||
|
* # Generate a http Request
|
||||||
|
*/
|
||||||
|
export default function httpRequest<ReqObj extends {
|
||||||
|
[k: string]: any;
|
||||||
|
} = {
|
||||||
|
[k: string]: any;
|
||||||
|
}, ResObj extends {
|
||||||
|
[k: string]: any;
|
||||||
|
} = {
|
||||||
|
[k: string]: any;
|
||||||
|
}>(params: HttpRequestParams<ReqObj>): Promise<HttpFunctionResponse<ResObj>>;
|
15
dist/package-shared/functions/backend/httpsRequest.d.ts
vendored
Normal file
15
dist/package-shared/functions/backend/httpsRequest.d.ts
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
type Param = {
|
||||||
|
scheme?: string;
|
||||||
|
url?: string;
|
||||||
|
method?: string;
|
||||||
|
hostname?: string;
|
||||||
|
path?: string;
|
||||||
|
port?: number | string;
|
||||||
|
headers?: object;
|
||||||
|
body?: object;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Make Https Request
|
||||||
|
*/
|
||||||
|
export default function httpsRequest({ url, method, hostname, path, headers, body, port, scheme, }: Param): Promise<unknown>;
|
||||||
|
export {};
|
4
dist/package-shared/functions/backend/noDatabaseDbHandler.d.ts
vendored
Normal file
4
dist/package-shared/functions/backend/noDatabaseDbHandler.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
/**
|
||||||
|
* # No Database DB Handler
|
||||||
|
*/
|
||||||
|
export default function noDatabaseDbHandler(queryString: string): Promise<any>;
|
13
dist/package-shared/functions/backend/parseDbResults.d.ts
vendored
Normal file
13
dist/package-shared/functions/backend/parseDbResults.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
type Param = {
|
||||||
|
unparsedResults: any[];
|
||||||
|
tableSchema?: import("../../types").DSQL_TableSchemaType;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* Parse Database results
|
||||||
|
* ==============================================================================
|
||||||
|
* @description this function takes a database results array gotten from a DB handler
|
||||||
|
* function, decrypts encrypted fields, and returns an updated array with no encrypted
|
||||||
|
* fields
|
||||||
|
*/
|
||||||
|
export default function parseDbResults({ unparsedResults, tableSchema, }: Param): Promise<any[] | null>;
|
||||||
|
export {};
|
10
dist/package-shared/functions/backend/queues/add-queue.d.ts
vendored
Normal file
10
dist/package-shared/functions/backend/queues/add-queue.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { DSQL_DATASQUIREL_PROCESS_QUEUE } from "../../../types/dsql";
|
||||||
|
type Param = {
|
||||||
|
queue: DSQL_DATASQUIREL_PROCESS_QUEUE;
|
||||||
|
userId: string | number;
|
||||||
|
dummy?: boolean;
|
||||||
|
};
|
||||||
|
export default function addQueue({ queue, userId, dummy }: Param): Promise<(import("../../../types").PostReturn & {
|
||||||
|
queryObject?: ReturnType<Awaited<typeof import("../../dsql/sql/sql-generator").default>>;
|
||||||
|
}) | null | undefined>;
|
||||||
|
export {};
|
6
dist/package-shared/functions/backend/queues/delete-queue.d.ts
vendored
Normal file
6
dist/package-shared/functions/backend/queues/delete-queue.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
type Param = {
|
||||||
|
queueId: string | number;
|
||||||
|
userId: string | number;
|
||||||
|
};
|
||||||
|
export default function deleteQueue({ queueId, userId }: Param): Promise<boolean>;
|
||||||
|
export {};
|
10
dist/package-shared/functions/backend/queues/get-queue.d.ts
vendored
Normal file
10
dist/package-shared/functions/backend/queues/get-queue.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { DSQL_DATASQUIREL_PROCESS_QUEUE } from "../../../types/dsql";
|
||||||
|
import { DsqlCrudQueryObject } from "../../../types";
|
||||||
|
type Param = {
|
||||||
|
queueId?: string | number;
|
||||||
|
userId?: string | number;
|
||||||
|
query?: DsqlCrudQueryObject<DSQL_DATASQUIREL_PROCESS_QUEUE>;
|
||||||
|
single?: boolean;
|
||||||
|
};
|
||||||
|
export default function getQueue({ queueId, userId, query, single, }: Param): Promise<DSQL_DATASQUIREL_PROCESS_QUEUE | DSQL_DATASQUIREL_PROCESS_QUEUE[] | undefined>;
|
||||||
|
export {};
|
7
dist/package-shared/functions/backend/queues/update-queue.d.ts
vendored
Normal file
7
dist/package-shared/functions/backend/queues/update-queue.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
import { DSQL_DATASQUIREL_PROCESS_QUEUE } from "../../../types/dsql";
|
||||||
|
type Param = {
|
||||||
|
queueId: string | number;
|
||||||
|
queue: DSQL_DATASQUIREL_PROCESS_QUEUE;
|
||||||
|
};
|
||||||
|
export default function updateQueue({ queueId, queue }: Param): Promise<boolean>;
|
||||||
|
export {};
|
18
dist/package-shared/functions/backend/serverError.d.ts
vendored
Normal file
18
dist/package-shared/functions/backend/serverError.d.ts
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
import { IncomingMessage } from "http";
|
||||||
|
type Param = {
|
||||||
|
user?: {
|
||||||
|
id?: number | string;
|
||||||
|
first_name?: string;
|
||||||
|
last_name?: string;
|
||||||
|
email?: string;
|
||||||
|
} & any;
|
||||||
|
message: string;
|
||||||
|
component?: string;
|
||||||
|
noMail?: boolean;
|
||||||
|
req?: import("next").NextApiRequest & IncomingMessage;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Server Error
|
||||||
|
*/
|
||||||
|
export default function serverError({ user, message, component, noMail, req, }: Param): Promise<void>;
|
||||||
|
export {};
|
10
dist/package-shared/functions/backend/setUserSchemaData.d.ts
vendored
Normal file
10
dist/package-shared/functions/backend/setUserSchemaData.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { DSQL_DatabaseSchemaType } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
userId: string | number;
|
||||||
|
schemaData: DSQL_DatabaseSchemaType[];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Set User Schema Data
|
||||||
|
*/
|
||||||
|
export default function setUserSchemaData({ userId, schemaData, }: Param): boolean;
|
||||||
|
export {};
|
8
dist/package-shared/functions/backend/suSocketAuth.d.ts
vendored
Normal file
8
dist/package-shared/functions/backend/suSocketAuth.d.ts
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
import { IncomingMessage } from "http";
|
||||||
|
export default function (req: IncomingMessage): Promise<{
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
authKey: string;
|
||||||
|
logged_in_status: boolean;
|
||||||
|
date: number;
|
||||||
|
} | null>;
|
13
dist/package-shared/functions/backend/updateUsersTableSchema.d.ts
vendored
Normal file
13
dist/package-shared/functions/backend/updateUsersTableSchema.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
type Param = {
|
||||||
|
userId: number | string;
|
||||||
|
database: string;
|
||||||
|
newFields?: string[];
|
||||||
|
newPayload?: {
|
||||||
|
[s: string]: any;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Add User Table to Database
|
||||||
|
*/
|
||||||
|
export default function updateUsersTableSchema({ userId, database, newFields, newPayload, }: Param): Promise<any>;
|
||||||
|
export {};
|
12
dist/package-shared/functions/backend/varDatabaseDbHandler.d.ts
vendored
Normal file
12
dist/package-shared/functions/backend/varDatabaseDbHandler.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
type Param = {
|
||||||
|
queryString: string;
|
||||||
|
queryValuesArray?: any[];
|
||||||
|
database?: string;
|
||||||
|
tableSchema?: import("../../types").DSQL_TableSchemaType;
|
||||||
|
debug?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # DB handler for specific database
|
||||||
|
*/
|
||||||
|
export default function varDatabaseDbHandler({ queryString, queryValuesArray, database, tableSchema, debug, }: Param): Promise<any>;
|
||||||
|
export {};
|
12
dist/package-shared/functions/backend/varReadOnlyDatabaseDbHandler.d.ts
vendored
Normal file
12
dist/package-shared/functions/backend/varReadOnlyDatabaseDbHandler.d.ts
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
type Param = {
|
||||||
|
queryString: string;
|
||||||
|
queryValuesArray?: string[];
|
||||||
|
tableSchema?: import("../../types").DSQL_TableSchemaType;
|
||||||
|
forceLocal?: boolean;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Read Only Db Handler with Varaibles
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export default function varReadOnlyDatabaseDbHandler({ queryString, queryValuesArray, tableSchema, forceLocal, }: Param): Promise<any>;
|
||||||
|
export {};
|
6
dist/package-shared/functions/dsql/db-schema-to-type.d.ts
vendored
Normal file
6
dist/package-shared/functions/dsql/db-schema-to-type.d.ts
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { DSQL_DatabaseSchemaType } from "../../types";
|
||||||
|
type Params = {
|
||||||
|
dbSchema?: DSQL_DatabaseSchemaType;
|
||||||
|
};
|
||||||
|
export default function dbSchemaToType(params?: Params): string[] | undefined;
|
||||||
|
export {};
|
10
dist/package-shared/functions/dsql/decrypt.d.ts
vendored
Normal file
10
dist/package-shared/functions/dsql/decrypt.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
type Param = {
|
||||||
|
encryptedString: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Decrypt Function
|
||||||
|
*/
|
||||||
|
export default function decrypt({ encryptedString, encryptionKey, encryptionSalt, }: Param): string;
|
||||||
|
export {};
|
7
dist/package-shared/functions/dsql/default-fields-regexp.d.ts
vendored
Normal file
7
dist/package-shared/functions/dsql/default-fields-regexp.d.ts
vendored
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Check for user in local storage
|
||||||
|
*
|
||||||
|
* @description Preventdefault, declare variables
|
||||||
|
*/
|
||||||
|
declare const defaultFieldsRegexp: RegExp;
|
||||||
|
export default defaultFieldsRegexp;
|
10
dist/package-shared/functions/dsql/encrypt.d.ts
vendored
Normal file
10
dist/package-shared/functions/dsql/encrypt.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
type Param = {
|
||||||
|
data: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
encryptionSalt?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Encrypt String
|
||||||
|
*/
|
||||||
|
export default function encrypt({ data, encryptionKey, encryptionSalt, }: Param): string | null;
|
||||||
|
export {};
|
11
dist/package-shared/functions/dsql/generate-type-definitions.d.ts
vendored
Normal file
11
dist/package-shared/functions/dsql/generate-type-definitions.d.ts
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { DSQL_TableSchemaType } from "../../types";
|
||||||
|
type Param = {
|
||||||
|
paradigm: "JavaScript" | "TypeScript" | undefined;
|
||||||
|
table: DSQL_TableSchemaType;
|
||||||
|
query?: any;
|
||||||
|
typeDefName?: string;
|
||||||
|
allValuesOptional?: boolean;
|
||||||
|
addExport?: boolean;
|
||||||
|
};
|
||||||
|
export default function generateTypeDefinition({ paradigm, table, query, typeDefName, allValuesOptional, addExport, }: Param): string | null;
|
||||||
|
export {};
|
9
dist/package-shared/functions/dsql/hashPassword.d.ts
vendored
Normal file
9
dist/package-shared/functions/dsql/hashPassword.d.ts
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
type Param = {
|
||||||
|
password: string;
|
||||||
|
encryptionKey?: string;
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # Hash password Function
|
||||||
|
*/
|
||||||
|
export default function hashPassword({ password, encryptionKey, }: Param): string;
|
||||||
|
export {};
|
13
dist/package-shared/functions/dsql/sql/sql-delete-generator.d.ts
vendored
Normal file
13
dist/package-shared/functions/dsql/sql/sql-delete-generator.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
interface SQLDeleteGenReturn {
|
||||||
|
query: string;
|
||||||
|
values: string[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* # SQL Delete Generator
|
||||||
|
*/
|
||||||
|
export default function sqlDeleteGenerator({ tableName, data, dbFullName, }: {
|
||||||
|
data: any;
|
||||||
|
tableName: string;
|
||||||
|
dbFullName?: string;
|
||||||
|
}): SQLDeleteGenReturn | undefined;
|
||||||
|
export {};
|
24
dist/package-shared/functions/dsql/sql/sql-generator.d.ts
vendored
Normal file
24
dist/package-shared/functions/dsql/sql/sql-generator.d.ts
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { ServerQueryParam } from "../../../types";
|
||||||
|
type Param<T extends {
|
||||||
|
[key: string]: any;
|
||||||
|
} = {
|
||||||
|
[key: string]: any;
|
||||||
|
}> = {
|
||||||
|
genObject?: ServerQueryParam<T>;
|
||||||
|
tableName: string;
|
||||||
|
dbFullName?: string;
|
||||||
|
};
|
||||||
|
type Return = {
|
||||||
|
string: string;
|
||||||
|
values: string[];
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* # SQL Query Generator
|
||||||
|
* @description Generates an SQL Query for node module `mysql` or `serverless-mysql`
|
||||||
|
*/
|
||||||
|
export default function sqlGenerator<T extends {
|
||||||
|
[key: string]: any;
|
||||||
|
} = {
|
||||||
|
[key: string]: any;
|
||||||
|
}>({ tableName, genObject, dbFullName }: Param<T>): Return;
|
||||||
|
export {};
|
13
dist/package-shared/functions/dsql/sql/sql-insert-generator.d.ts
vendored
Normal file
13
dist/package-shared/functions/dsql/sql/sql-insert-generator.d.ts
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
interface SQLInsertGenReturn {
|
||||||
|
query: string;
|
||||||
|
values: string[];
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* # SQL Insert Generator
|
||||||
|
*/
|
||||||
|
export default function sqlInsertGenerator({ tableName, data, dbFullName, }: {
|
||||||
|
data: any[];
|
||||||
|
tableName: string;
|
||||||
|
dbFullName?: string;
|
||||||
|
}): SQLInsertGenReturn | undefined;
|
||||||
|
export {};
|
10
dist/package-shared/functions/email/fns/validate-email.d.ts
vendored
Normal file
10
dist/package-shared/functions/email/fns/validate-email.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import { HandleNodemailerParam } from "../../backend/handleNodemailer";
|
||||||
|
type Param = {
|
||||||
|
email?: string;
|
||||||
|
welcomeEmailOptions?: HandleNodemailerParam;
|
||||||
|
};
|
||||||
|
export default function validateEmail({ email, welcomeEmailOptions, }: Param): Promise<{
|
||||||
|
isValid: boolean;
|
||||||
|
message?: string;
|
||||||
|
}>;
|
||||||
|
export {};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user