Updates
This commit is contained in:
Vendored
-105
@@ -271,34 +271,6 @@ export interface GetReqQueryObject {
|
||||
tableName?: string;
|
||||
debug?: boolean;
|
||||
}
|
||||
export type DATASQUIREL_LoggedInUser = {
|
||||
id: number;
|
||||
uuid?: string;
|
||||
first_name: string;
|
||||
last_name: string;
|
||||
email: string;
|
||||
phone?: string;
|
||||
user_type?: string;
|
||||
username?: string;
|
||||
image?: string;
|
||||
image_thumbnail?: string;
|
||||
social_login?: number;
|
||||
social_platform?: string;
|
||||
social_id?: string;
|
||||
verification_status?: number;
|
||||
csrf_k: string;
|
||||
logged_in_status: boolean;
|
||||
date: number;
|
||||
} & {
|
||||
[key: string]: any;
|
||||
};
|
||||
export interface AuthenticatedUser {
|
||||
success: boolean;
|
||||
payload: DATASQUIREL_LoggedInUser | null;
|
||||
msg?: string;
|
||||
userId?: number;
|
||||
cookieNames?: any;
|
||||
}
|
||||
export interface SuccessUserObject {
|
||||
id: number;
|
||||
first_name: string;
|
||||
@@ -346,13 +318,6 @@ export interface GetUserFunctionReturn {
|
||||
verification_status: [number];
|
||||
} | null;
|
||||
}
|
||||
export interface ReauthUserFunctionReturn {
|
||||
success: boolean;
|
||||
payload: DATASQUIREL_LoggedInUser | null;
|
||||
msg?: string;
|
||||
userId?: number;
|
||||
token?: string;
|
||||
}
|
||||
export interface UpdateUserFunctionReturn {
|
||||
success: boolean;
|
||||
payload?: Object[] | string;
|
||||
@@ -417,12 +382,6 @@ export interface PostInsertReturn {
|
||||
changedRows?: number;
|
||||
error?: string;
|
||||
}
|
||||
export type UserType = DATASQUIREL_LoggedInUser & {
|
||||
isSuperUser?: boolean;
|
||||
staticHost?: string;
|
||||
appHost?: string;
|
||||
appName?: string;
|
||||
};
|
||||
export interface ApiKeyDef {
|
||||
name: string;
|
||||
scope: string;
|
||||
@@ -639,16 +598,6 @@ export type MariadbRemoteServerUserObject = {
|
||||
password: string;
|
||||
host: string;
|
||||
};
|
||||
export type APILoginFunctionReturn = {
|
||||
success: boolean;
|
||||
msg?: string;
|
||||
payload?: DATASQUIREL_LoggedInUser | null;
|
||||
userId?: number | string;
|
||||
key?: string;
|
||||
token?: string;
|
||||
csrf?: string;
|
||||
cookieNames?: any;
|
||||
};
|
||||
export type APICreateUserFunctionParams = {
|
||||
encryptionKey?: string;
|
||||
payload: any;
|
||||
@@ -657,17 +606,6 @@ export type APICreateUserFunctionParams = {
|
||||
verify?: boolean;
|
||||
};
|
||||
export type APICreateUserFunction = (params: APICreateUserFunctionParams) => Promise<AddUserFunctionReturn>;
|
||||
export type HandleSocialDbFunctionReturn = {
|
||||
success: boolean;
|
||||
user?: DATASQUIREL_LoggedInUser | null;
|
||||
msg?: string;
|
||||
social_id?: string | number;
|
||||
social_platform?: string;
|
||||
payload?: any;
|
||||
alert?: boolean;
|
||||
newUser?: any;
|
||||
error?: any;
|
||||
} | null;
|
||||
export type CookieObject = {
|
||||
name: string;
|
||||
value: string;
|
||||
@@ -721,49 +659,6 @@ export type ApiGetQueryObject<T extends {
|
||||
};
|
||||
export declare const DataCrudRequestMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"];
|
||||
export declare const DataCrudRequestMethodsLowerCase: readonly ["get", "post", "put", "patch", "delete", "options"];
|
||||
export type DsqlMethodCrudParam<T extends {
|
||||
[key: string]: any;
|
||||
} = {
|
||||
[key: string]: any;
|
||||
}> = {
|
||||
method: (typeof DataCrudRequestMethods)[number];
|
||||
body?: T;
|
||||
query?: DsqlCrudQueryObject<T>;
|
||||
tableName: string;
|
||||
addUser?: {
|
||||
field: keyof T;
|
||||
};
|
||||
user?: DATASQUIREL_LoggedInUser;
|
||||
extraData?: T;
|
||||
transformData?: DsqlCrudTransformDataFunction<T>;
|
||||
transformQuery?: DsqlCrudTransformQueryFunction<T>;
|
||||
existingData?: T;
|
||||
targetId?: string | number;
|
||||
sanitize?: ({ data, batchData }: {
|
||||
data?: T;
|
||||
batchData?: T[];
|
||||
}) => T | T[];
|
||||
debug?: boolean;
|
||||
};
|
||||
export type DsqlCrudTransformDataFunction<T extends {
|
||||
[key: string]: any;
|
||||
} = {
|
||||
[key: string]: any;
|
||||
}> = (params: {
|
||||
data: T;
|
||||
user?: DATASQUIREL_LoggedInUser;
|
||||
existingData?: T;
|
||||
reqMethod: (typeof DataCrudRequestMethods)[number];
|
||||
}) => Promise<T>;
|
||||
export type DsqlCrudTransformQueryFunction<T extends {
|
||||
[key: string]: any;
|
||||
} = {
|
||||
[key: string]: any;
|
||||
}> = (params: {
|
||||
query: DsqlCrudQueryObject<T>;
|
||||
user?: DATASQUIREL_LoggedInUser;
|
||||
reqMethod: (typeof DataCrudRequestMethods)[number];
|
||||
}) => Promise<DsqlCrudQueryObject<T>>;
|
||||
export declare const DsqlCrudActions: readonly ["insert", "update", "delete", "get"];
|
||||
export type DsqlCrudQueryObject<T extends {
|
||||
[key: string]: any;
|
||||
|
||||
Reference in New Issue
Block a user