Updates
This commit is contained in:
+100
-99
@@ -1,24 +1,24 @@
|
||||
export const DsqlTables = [
|
||||
"users",
|
||||
"mariadb_users",
|
||||
"mariadb_user_databases",
|
||||
"mariadb_user_tables",
|
||||
"mariadb_user_privileges",
|
||||
"api_keys",
|
||||
"api_keys_scoped_resources",
|
||||
"invitations",
|
||||
"delegated_resources",
|
||||
"user_databases",
|
||||
"user_database_tables",
|
||||
"user_media",
|
||||
"user_private_folders",
|
||||
"delegated_users",
|
||||
"delegated_resources",
|
||||
"mariadb_user_privileges",
|
||||
"unsubscribes",
|
||||
"notifications",
|
||||
"deleted_api_keys",
|
||||
"servers",
|
||||
"process_queue",
|
||||
"backups",
|
||||
"mariadb_users",
|
||||
"mariadb_user_databases",
|
||||
"mariadb_user_tables",
|
||||
] as const
|
||||
|
||||
export type DSQL_DATASQUIREL_USERS = {
|
||||
@@ -51,79 +51,6 @@ export type DSQL_DATASQUIREL_USERS = {
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USERS = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
username?: string;
|
||||
host?: string;
|
||||
password?: string;
|
||||
primary?: number;
|
||||
all_databases?: 0 | 1;
|
||||
all_grants?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USER_DATABASES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
mariadb_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
all_tables?: 0 | 1;
|
||||
all_privileges?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USER_TABLES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
mariadb_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
table_schema_id?: number;
|
||||
table_slug?: string;
|
||||
all_fields?: 0 | 1;
|
||||
all_privileges?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USER_PRIVILEGES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
mariadb_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
privilege?: "ALTER" | "ALTER ROUTINE" | "CREATE" | "CREATE ROUTINE" | "CREATE TEMPORARY TABLES" | "CREATE VIEW" | "DELETE" | "DROP" | "EVENT" | "EXECUTE" | "FILE" | "INDEX" | "INSERT" | "LOCK TABLES" | "PROCESS" | "REFERENCES" | "RELOAD" | "SELECT" | "SHOW VIEW" | "SUPER" | "TRIGGER" | "UPDATE" | "USAGE";
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_API_KEYS = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
@@ -180,27 +107,6 @@ export type DSQL_DATASQUIREL_INVITATIONS = {
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_DELEGATED_RESOURCES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
delegated_users_id?: number;
|
||||
user_id?: number;
|
||||
delegated_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
table_schema_id?: number;
|
||||
table_slug?: string;
|
||||
permission?: "read" | "write" | "edit" | "delete";
|
||||
all_tables?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_USER_DATABASES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
@@ -257,6 +163,7 @@ export type DSQL_DATASQUIREL_USER_MEDIA = {
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
media_name?: string;
|
||||
alias?: string;
|
||||
folder?: string;
|
||||
media_url?: string;
|
||||
media_thumbnail_url?: string;
|
||||
@@ -305,6 +212,44 @@ export type DSQL_DATASQUIREL_DELEGATED_USERS = {
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_DELEGATED_RESOURCES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
delegated_users_id?: number;
|
||||
user_id?: number;
|
||||
delegated_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
table_schema_id?: number;
|
||||
table_slug?: string;
|
||||
permission?: "read" | "write" | "edit" | "delete";
|
||||
all_tables?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USER_PRIVILEGES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
mariadb_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
privilege?: "ALTER" | "ALTER ROUTINE" | "CREATE" | "CREATE ROUTINE" | "CREATE TEMPORARY TABLES" | "CREATE VIEW" | "DELETE" | "DROP" | "EVENT" | "EXECUTE" | "FILE" | "INDEX" | "INSERT" | "LOCK TABLES" | "PROCESS" | "REFERENCES" | "RELOAD" | "SELECT" | "SHOW VIEW" | "SUPER" | "TRIGGER" | "UPDATE" | "USAGE";
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_UNSUBSCRIBES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
@@ -391,4 +336,60 @@ export type DSQL_DATASQUIREL_BACKUPS = {
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USERS = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
username?: string;
|
||||
host?: string;
|
||||
password?: string;
|
||||
primary?: number;
|
||||
all_databases?: 0 | 1;
|
||||
all_grants?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USER_DATABASES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
mariadb_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
all_tables?: 0 | 1;
|
||||
all_privileges?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_MARIADB_USER_TABLES = {
|
||||
id?: number;
|
||||
uuid?: string;
|
||||
user_id?: number;
|
||||
mariadb_user_id?: number;
|
||||
db_id?: number;
|
||||
db_schema_id?: number;
|
||||
db_slug?: string;
|
||||
table_schema_id?: number;
|
||||
table_slug?: string;
|
||||
all_fields?: 0 | 1;
|
||||
all_privileges?: 0 | 1;
|
||||
date_created?: string;
|
||||
date_created_code?: number;
|
||||
date_created_timestamp?: string;
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
@@ -14,6 +14,7 @@ import type {
|
||||
DSQL_DATASQUIREL_USER_MEDIA,
|
||||
DSQL_DATASQUIREL_USER_PRIVATE_FOLDERS,
|
||||
DSQL_DATASQUIREL_USERS,
|
||||
DsqlTables,
|
||||
} from "./dsql";
|
||||
|
||||
import type { Editor } from "tinymce";
|
||||
@@ -1139,6 +1140,7 @@ export type APICreateUserFunctionParams = {
|
||||
payload: any;
|
||||
database: string;
|
||||
userId?: string | number;
|
||||
verify?: boolean;
|
||||
};
|
||||
|
||||
export type APICreateUserFunction = (
|
||||
@@ -1588,6 +1590,8 @@ export type PagePropsType = {
|
||||
suDatabase?: SQLShowDatabaseObject | null;
|
||||
isSuperUserPage?: boolean;
|
||||
appVersion?: (typeof AppVersions)[number];
|
||||
isMailAvailable?: boolean;
|
||||
websocketURL?: string;
|
||||
};
|
||||
|
||||
export type APIResponseObject<T extends any = any> = {
|
||||
@@ -1771,16 +1775,17 @@ export type AppRefObject = {
|
||||
};
|
||||
|
||||
export type DsqlAppData = {
|
||||
DSQL_REMOTE_SQL_HOST?: string;
|
||||
DSQL_SU_USER_ID?: string;
|
||||
DSQL_HOST_ENV?: string;
|
||||
DSQL_HOST?: string;
|
||||
DSQL_STATIC_HOST?: string;
|
||||
DSQL_GOOGLE_CLIENT_ID?: string;
|
||||
DSQL_TINY_MCE_API_KEY?: string;
|
||||
DSQL_WEBSOCKET_URL?: string;
|
||||
DSQL_FACEBOOK_APP_ID?: string;
|
||||
DSQL_GITHUB_ID?: string;
|
||||
DSQL_REMOTE_SQL_HOST?: string | null;
|
||||
DSQL_SU_USER_ID?: string | null;
|
||||
DSQL_HOST_ENV?: string | null;
|
||||
DSQL_HOST?: string | null;
|
||||
DSQL_STATIC_HOST?: string | null;
|
||||
DSQL_GOOGLE_CLIENT_ID?: string | null;
|
||||
DSQL_TINY_MCE_API_KEY?: string | null;
|
||||
DSQL_WEBSOCKET_HOST?: string | null;
|
||||
DSQL_FACEBOOK_APP_ID?: string | null;
|
||||
DSQL_GITHUB_ID?: string | null;
|
||||
DSQL_HOST_MACHINE_IP?: string | null;
|
||||
};
|
||||
|
||||
export const MediaTypes = ["image", "file", "video"] as const;
|
||||
@@ -1809,10 +1814,15 @@ export const FileMimeTypes = [
|
||||
"xlsx",
|
||||
"txt",
|
||||
"zip",
|
||||
"xz",
|
||||
"tar.xz",
|
||||
"xz",
|
||||
"yaml",
|
||||
"yml",
|
||||
"sh",
|
||||
"jsx",
|
||||
"js",
|
||||
"tsx",
|
||||
"ts",
|
||||
] as const;
|
||||
|
||||
export const VideoMimeTypes = ["mp4", "wav"] as const;
|
||||
@@ -2153,7 +2163,7 @@ export type SiteConfigMaxscale = {
|
||||
admin_port: number;
|
||||
};
|
||||
|
||||
export const APIParadigms = ["crud", "media", "sql"] as const;
|
||||
export const APIParadigms = ["crud", "media", "sql", "schema"] as const;
|
||||
|
||||
export const AppVersions = [
|
||||
{
|
||||
@@ -2246,8 +2256,8 @@ export const EnvKeys = [
|
||||
"DSQL_WEB_APP_FAIL_COUNTS",
|
||||
"NODE_ARCH",
|
||||
"DSQL_WEBSOCKET_PORT",
|
||||
"DSQL_WEBSOCKET_URL",
|
||||
"NEXT_PUBLIC_DSQL_WEBSOCKET_URL",
|
||||
"DSQL_WEBSOCKET_HOST",
|
||||
"NEXT_PUBLIC_DSQL_WEBSOCKET_HOST",
|
||||
"S3_ACCESS_KEY_ID",
|
||||
"S3_SECRET_ACCESS",
|
||||
"DSQL_ADDITIONAL_MARIADB_SERVERS",
|
||||
@@ -2291,3 +2301,21 @@ export type AddMediaAPIBody = {
|
||||
*/
|
||||
useDefault?: boolean;
|
||||
};
|
||||
|
||||
export const TargetMediaParadigms = ["info", "preview"] as const;
|
||||
|
||||
export type TargetMediaDataType = {
|
||||
media: DSQL_DATASQUIREL_USER_MEDIA;
|
||||
paradigm: (typeof TargetMediaParadigms)[number];
|
||||
};
|
||||
|
||||
export type GrabUserResourceParams<T extends { [k: string]: any } = any> = {
|
||||
query?: DsqlCrudQueryObject<T>;
|
||||
userId?: string | number;
|
||||
tableName: (typeof DsqlTables)[number];
|
||||
count?: boolean;
|
||||
countOnly?: boolean;
|
||||
noLimit?: boolean;
|
||||
isSuperUser?: boolean;
|
||||
targetID?: string | number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user