Updates
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,5 @@
|
||||
import type { IncomingMessage, ServerResponse } from "http";
|
||||
import { RequestOptions } from "https";
|
||||
|
||||
import { Editor } from "tinymce";
|
||||
export type DSQL_DatabaseFullName = string;
|
||||
@@ -130,6 +131,7 @@ export interface DSQL_MYSQL_user_databases_Type {
|
||||
db_image: string;
|
||||
db_description: string;
|
||||
active_clone: number;
|
||||
active_data: 0 | 1;
|
||||
active_clone_parent_db: string;
|
||||
remote_connected?: number;
|
||||
remote_db_full_name?: string;
|
||||
@@ -170,15 +172,11 @@ export interface PackageUserLoginLocalBody {
|
||||
skipPassword?: boolean;
|
||||
}
|
||||
|
||||
type Request = IncomingMessage;
|
||||
|
||||
type Response = ServerResponse;
|
||||
|
||||
type ImageInputFileToBase64FunctionReturn = {
|
||||
imageBase64: string;
|
||||
imageBase64Full: string;
|
||||
imageName: string;
|
||||
imageSize: number;
|
||||
export type ImageInputFileToBase64FunctionReturn = {
|
||||
imageBase64?: string;
|
||||
imageBase64Full?: string;
|
||||
imageName?: string;
|
||||
imageSize?: number;
|
||||
};
|
||||
|
||||
export interface GetReqQueryObject {
|
||||
@@ -188,8 +186,6 @@ export interface GetReqQueryObject {
|
||||
tableName?: string;
|
||||
}
|
||||
|
||||
export type SerializeQueryFnType = (query: any) => string;
|
||||
|
||||
export type DATASQUIREL_LoggedInUser = {
|
||||
id: number;
|
||||
uuid?: string;
|
||||
@@ -370,7 +366,7 @@ export interface DashboardContextType {
|
||||
user?: UserType;
|
||||
databases?: DSQL_MYSQL_user_databases_Type[];
|
||||
setTargetDatabase?: React.Dispatch<
|
||||
React.SetStateAction<DSQL_MYSQL_user_databases_Type>
|
||||
React.SetStateAction<DSQL_MYSQL_user_databases_Type | undefined>
|
||||
>;
|
||||
targetDatabase?: DSQL_MYSQL_user_databases_Type;
|
||||
metrics?: MetricsType;
|
||||
@@ -433,7 +429,7 @@ export interface AddEntryContextType {
|
||||
richTextEditors: React.MutableRefObject<RichTextEditorsRefArray[]>;
|
||||
jsonTextEditors: React.MutableRefObject<JSONTextEditorsRefArray[]>;
|
||||
query: any;
|
||||
duplicateEntry?: any;
|
||||
duplicateEntry: any;
|
||||
confirmedDelegetedUser: any;
|
||||
}
|
||||
|
||||
@@ -510,13 +506,13 @@ export interface SingleDatabaseContextType {
|
||||
}
|
||||
|
||||
export interface ApiKeysContextType {
|
||||
user: UserType;
|
||||
apiKeys: any[];
|
||||
setApiKeys: React.Dispatch<React.SetStateAction<any[]>>;
|
||||
targetApiKey: any | null;
|
||||
setTargetApiKey: React.Dispatch<React.SetStateAction<any | null>>;
|
||||
newApiKey: any | null;
|
||||
setNewApiKey: React.Dispatch<React.SetStateAction<any | null>>;
|
||||
user?: UserType;
|
||||
apiKeys?: any[];
|
||||
setApiKeys?: React.Dispatch<React.SetStateAction<any[]>>;
|
||||
targetApiKey?: any | null;
|
||||
setTargetApiKey?: React.Dispatch<React.SetStateAction<any | null>>;
|
||||
newApiKey?: any | null;
|
||||
setNewApiKey?: React.Dispatch<React.SetStateAction<any | null>>;
|
||||
}
|
||||
|
||||
export interface LoginFormContextType {
|
||||
@@ -549,32 +545,32 @@ export interface DocsAsidePageObject {
|
||||
}
|
||||
|
||||
export interface AllUserUsersContextType {
|
||||
user: UserType;
|
||||
users: MYSQL_delegated_users_table_def[];
|
||||
targetUser: MYSQL_user_users_table_def | null;
|
||||
setTargetUser: React.Dispatch<
|
||||
React.SetStateAction<MYSQL_user_users_table_def | null>
|
||||
user?: UserType;
|
||||
users?: MYSQL_delegated_users_table_def[];
|
||||
targetUser?: MYSQL_user_users_table_def | undefined;
|
||||
setTargetUser?: React.Dispatch<
|
||||
React.SetStateAction<MYSQL_user_users_table_def | undefined>
|
||||
>;
|
||||
databases: DSQL_MYSQL_user_databases_Type[];
|
||||
pendingInvitations: MYSQL_invitations_table_def[];
|
||||
pendingInvitationsReceived: any[];
|
||||
adminUsers: any[];
|
||||
invitedAccounts: any[];
|
||||
databases?: DSQL_MYSQL_user_databases_Type[];
|
||||
pendingInvitations?: MYSQL_invitations_table_def[];
|
||||
pendingInvitationsReceived?: any[];
|
||||
adminUsers?: any[];
|
||||
invitedAccounts?: any[];
|
||||
}
|
||||
|
||||
export interface AddSocialLoginContextType {
|
||||
user: UserType;
|
||||
database: DSQL_MYSQL_user_databases_Type;
|
||||
query: any;
|
||||
socialLogins: SocialLoginObjectType[];
|
||||
user?: UserType;
|
||||
database?: DSQL_MYSQL_user_databases_Type;
|
||||
query?: any;
|
||||
socialLogins?: SocialLoginObjectType[];
|
||||
}
|
||||
|
||||
export interface DelegatedDbContextType {
|
||||
user: UserType;
|
||||
users: MYSQL_user_users_table_def[];
|
||||
targetUser: MYSQL_user_users_table_def | null;
|
||||
targetUser: MYSQL_user_users_table_def | undefined;
|
||||
setTargetUser: React.Dispatch<
|
||||
React.SetStateAction<MYSQL_user_users_table_def | null>
|
||||
React.SetStateAction<MYSQL_user_users_table_def | undefined>
|
||||
>;
|
||||
database: DSQL_MYSQL_user_databases_Type;
|
||||
}
|
||||
@@ -590,9 +586,9 @@ export interface AddUserUserContextType {
|
||||
export interface UserUsersContextType {
|
||||
user: UserType;
|
||||
users: MYSQL_user_users_table_def[];
|
||||
targetUser: MYSQL_user_users_table_def;
|
||||
targetUser?: MYSQL_user_users_table_def;
|
||||
setTargetUser: React.Dispatch<
|
||||
React.SetStateAction<MYSQL_user_users_table_def | null>
|
||||
React.SetStateAction<MYSQL_user_users_table_def | undefined>
|
||||
>;
|
||||
database: DSQL_MYSQL_user_databases_Type;
|
||||
table: DSQL_TableSchemaType;
|
||||
@@ -722,16 +718,16 @@ export interface UserSchemaContextType {
|
||||
}
|
||||
|
||||
export interface ConnectContextType {
|
||||
user: UserType;
|
||||
query: any;
|
||||
mariadbUserCred: MariaDBUserCredType;
|
||||
mariadbUsers: MYSQL_mariadb_users_table_def[];
|
||||
targetMariadbUser: MYSQL_mariadb_users_table_def | null;
|
||||
setTargetMariadbUser: React.Dispatch<
|
||||
user?: UserType;
|
||||
query?: any;
|
||||
mariadbUserCred?: MariaDBUserCredType;
|
||||
mariadbUsers?: MYSQL_mariadb_users_table_def[];
|
||||
targetMariadbUser?: MYSQL_mariadb_users_table_def | null;
|
||||
setTargetMariadbUser?: React.Dispatch<
|
||||
React.SetStateAction<MYSQL_mariadb_users_table_def | null>
|
||||
>;
|
||||
refresh: number;
|
||||
setRefresh: React.Dispatch<React.SetStateAction<number>>;
|
||||
refresh?: number;
|
||||
setRefresh?: React.Dispatch<React.SetStateAction<number>>;
|
||||
}
|
||||
|
||||
export interface MYSQL_mariadb_users_table_def {
|
||||
@@ -755,7 +751,7 @@ export interface DbContextType {
|
||||
databases?: DSQL_MYSQL_user_databases_Type[];
|
||||
targetDatabase?: DSQL_MYSQL_user_databases_Type;
|
||||
setTargetDatabase?: React.Dispatch<
|
||||
React.SetStateAction<DSQL_MYSQL_user_databases_Type>
|
||||
React.SetStateAction<DSQL_MYSQL_user_databases_Type | undefined>
|
||||
>;
|
||||
}
|
||||
|
||||
@@ -766,33 +762,33 @@ export interface MariaDBUserCredType {
|
||||
}
|
||||
|
||||
export interface AddTableContextType {
|
||||
user: UserType;
|
||||
dbSchemaData: DSQL_DatabaseSchemaType[];
|
||||
database: DSQL_MYSQL_user_databases_Type;
|
||||
tables: DSQL_TableSchemaType[];
|
||||
tableFields: DSQL_FieldSchemaType[];
|
||||
setTableFields: React.Dispatch<
|
||||
user?: UserType;
|
||||
dbSchemaData?: DSQL_DatabaseSchemaType[];
|
||||
database?: DSQL_MYSQL_user_databases_Type;
|
||||
tables?: DSQL_TableSchemaType[];
|
||||
tableFields?: DSQL_FieldSchemaType[];
|
||||
setTableFields?: React.Dispatch<
|
||||
React.SetStateAction<DSQL_FieldSchemaType[]>
|
||||
>;
|
||||
targetField: DSQL_FieldSchemaType | null;
|
||||
setTargetField: React.Dispatch<
|
||||
targetField?: DSQL_FieldSchemaType | null;
|
||||
setTargetField?: React.Dispatch<
|
||||
React.SetStateAction<DSQL_FieldSchemaType | null>
|
||||
>;
|
||||
pageRefresh: number | null;
|
||||
setPageRefresh: React.Dispatch<React.SetStateAction<number>>;
|
||||
refreshFieldsListRef: React.MutableRefObject<
|
||||
React.Dispatch<React.SetStateAction<number>>
|
||||
pageRefresh?: number | null;
|
||||
setPageRefresh?: React.Dispatch<React.SetStateAction<number>>;
|
||||
refreshFieldsListRef?: React.MutableRefObject<
|
||||
React.Dispatch<React.SetStateAction<number>> | undefined
|
||||
>;
|
||||
query: any;
|
||||
query?: any;
|
||||
}
|
||||
|
||||
export interface DbSchemaContextType {
|
||||
user: UserType;
|
||||
database: DSQL_MYSQL_user_databases_Type;
|
||||
dbImage: string;
|
||||
setDbImage: React.Dispatch<React.SetStateAction<string>>;
|
||||
dbSchemaData: DSQL_DatabaseSchemaType[];
|
||||
tables: any[];
|
||||
user?: UserType;
|
||||
database?: DSQL_MYSQL_user_databases_Type;
|
||||
dbImage?: string;
|
||||
setDbImage?: React.Dispatch<React.SetStateAction<string>>;
|
||||
dbSchemaData?: DSQL_DatabaseSchemaType[];
|
||||
tables?: any[];
|
||||
}
|
||||
|
||||
export interface DbShellContextType {
|
||||
@@ -1071,11 +1067,7 @@ export type FetchApiOptions = RequestInit & {
|
||||
query?: { [key: string]: any };
|
||||
};
|
||||
|
||||
export type AuthCsrfHeaderName = "x-csrf-auth";
|
||||
|
||||
type FetchHeader = HeadersInit & {
|
||||
[key in AuthCsrfHeaderName]?: string | null;
|
||||
} & {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
@@ -1086,32 +1078,40 @@ export type FetchApiReturn = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
export const ServerQueryOperators = ["AND", "OR"] as const;
|
||||
export const ServerQueryEqualities = ["EQUAL", "LIKE", "NOT EQUAL"] as const;
|
||||
|
||||
export type ServerQueryParam = {
|
||||
selectFields?: string[];
|
||||
query?: ServerQueryQueryObject;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
order?: {
|
||||
field: string;
|
||||
strategy: "ASC" | "DESC";
|
||||
};
|
||||
searchOperator?: "AND" | "OR";
|
||||
searchEquality?: "EQUAL" | "LIKE";
|
||||
searchOperator?: (typeof ServerQueryOperators)[number];
|
||||
searchEquality?: (typeof ServerQueryEqualities)[number];
|
||||
addUserId?: {
|
||||
fieldName: string;
|
||||
};
|
||||
join?: ServerQueryParamsJoin[];
|
||||
} & {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
export type ServerQueryObject<T extends object = { [key: string]: any }> = {
|
||||
value?: string | string[];
|
||||
operator?: (typeof ServerQueryOperators)[number];
|
||||
equality?: (typeof ServerQueryEqualities)[number];
|
||||
tableName?: string;
|
||||
__query?: {
|
||||
[key in keyof T]: Omit<ServerQueryObject<T>, "__query">;
|
||||
};
|
||||
};
|
||||
|
||||
export type ServerQueryQueryObject<T extends object = { [key: string]: any }> =
|
||||
{
|
||||
[key in keyof T]: {
|
||||
value: string | string[];
|
||||
operator?: "AND" | "OR";
|
||||
equality?: "EQUAL" | "LIKE";
|
||||
tableName?: string;
|
||||
};
|
||||
[key in keyof T]: ServerQueryObject<T>;
|
||||
};
|
||||
|
||||
export type FetchDataParams = {
|
||||
@@ -1131,6 +1131,7 @@ export type ServerQueryParamsJoin<
|
||||
Field extends object = { [key: string]: any }
|
||||
> = {
|
||||
joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN";
|
||||
alias?: string;
|
||||
tableName: Table;
|
||||
match?:
|
||||
| ServerQueryParamsJoinMatchObject<Field>
|
||||
@@ -1140,8 +1141,10 @@ export type ServerQueryParamsJoin<
|
||||
| {
|
||||
field: keyof Field;
|
||||
alias?: string;
|
||||
count?: boolean;
|
||||
}
|
||||
)[];
|
||||
operator?: (typeof ServerQueryOperators)[number];
|
||||
};
|
||||
|
||||
export type ServerQueryParamsJoinMatchObject<
|
||||
@@ -1160,16 +1163,6 @@ export type ServerQueryParamsJoinMatchSourceTargetObject = {
|
||||
fieldName: string;
|
||||
};
|
||||
|
||||
export type SqlGeneratorFn = (Param0: {
|
||||
genObject?: ServerQueryParam;
|
||||
tableName: string;
|
||||
}) =>
|
||||
| {
|
||||
string: string;
|
||||
values: string[];
|
||||
}
|
||||
| undefined;
|
||||
|
||||
export type ApiConnectBody = {
|
||||
url: string;
|
||||
key: string;
|
||||
@@ -1226,9 +1219,6 @@ export type APILoginFunctionReturn = {
|
||||
csrf?: string;
|
||||
cookieNames?: any;
|
||||
};
|
||||
export type APILoginFunction = (
|
||||
params: APILoginFunctionParams
|
||||
) => Promise<APILoginFunctionReturn>;
|
||||
|
||||
export type APICreateUserFunctionParams = {
|
||||
encryptionKey?: string;
|
||||
@@ -1252,10 +1242,6 @@ export type APIGetUserFunctionParams = {
|
||||
useLocal?: boolean;
|
||||
};
|
||||
|
||||
export type APIGetUserFunction = (
|
||||
params: APIGetUserFunctionParams
|
||||
) => Promise<GetUserFunctionReturn>;
|
||||
|
||||
/**
|
||||
* API Google Login Function
|
||||
*/
|
||||
@@ -1263,6 +1249,7 @@ export type APIGoogleLoginFunctionParams = {
|
||||
token: string;
|
||||
database: string;
|
||||
additionalFields?: string[];
|
||||
additionalData?: { [key: string]: string | number };
|
||||
};
|
||||
|
||||
export type APIGoogleLoginFunction = (
|
||||
@@ -1430,3 +1417,27 @@ export type CookieObject = {
|
||||
sameSite?: "Strict" | "Lax" | "None";
|
||||
priority?: "Low" | "Medium" | "High";
|
||||
};
|
||||
|
||||
export type HttpRequestParams<
|
||||
ReqObj extends { [k: string]: any } = { [k: string]: any }
|
||||
> = RequestOptions & {
|
||||
scheme?: "http" | "https";
|
||||
body?: ReqObj;
|
||||
query?: ReqObj;
|
||||
urlEncodedFormBody?: boolean;
|
||||
};
|
||||
|
||||
export type HttpRequestFunction<
|
||||
ReqObj extends { [k: string]: any } = { [k: string]: any },
|
||||
ResObj extends { [k: string]: any } = { [k: string]: any }
|
||||
> = (param: HttpRequestParams<ReqObj>) => Promise<HttpFunctionResponse<ResObj>>;
|
||||
|
||||
export type HttpFunctionResponse<
|
||||
ResObj extends { [k: string]: any } = { [k: string]: any }
|
||||
> = {
|
||||
status: number;
|
||||
data?: ResObj;
|
||||
error?: string;
|
||||
str?: string;
|
||||
requestedPath?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user