This commit is contained in:
Benjamin Toby 2026-01-25 05:14:56 +01:00
parent acccc26c38
commit cda056311b
3 changed files with 44 additions and 44 deletions

View File

@ -2313,7 +2313,7 @@ export type APIPathsPostResulstsFn<T extends {
[k: string]: any; [k: string]: any;
}> = (params: APIPathsCrudParams<T> & { }> = (params: APIPathsCrudParams<T> & {
res?: APIResponseObject; res?: APIResponseObject;
}) => Promise<APIPathsBody<T> | undefined>; }) => Promise<void>;
export type APIPathsParamsAllowedTable = { export type APIPathsParamsAllowedTable = {
table: string; table: string;
allowedFields?: (string | RegExp)[]; allowedFields?: (string | RegExp)[];

View File

@ -962,7 +962,7 @@ export type AddApiKeyRequestBody = {
}; };
export type CheckApiCredentialsFn = ( export type CheckApiCredentialsFn = (
param: CheckApiCredentialsFnParam param: CheckApiCredentialsFnParam,
) => ApiKeyObject | null | undefined; ) => ApiKeyObject | null | undefined;
export type CheckApiCredentialsFnParam = { export type CheckApiCredentialsFnParam = {
key?: string; key?: string;
@ -975,7 +975,7 @@ export type CheckApiCredentialsFnParam = {
export type FetchApiFn = ( export type FetchApiFn = (
url: string, url: string,
options?: FetchApiOptions, options?: FetchApiOptions,
csrf?: boolean csrf?: boolean,
) => Promise<any>; ) => Promise<any>;
export type FetchApiOptions = RequestInit & { export type FetchApiOptions = RequestInit & {
@ -1030,7 +1030,7 @@ export const ServerQueryEqualities = [
export type ServerQueryParam< export type ServerQueryParam<
T extends { [k: string]: any } = { [k: string]: any }, T extends { [k: string]: any } = { [k: string]: any },
K extends string = string K extends string = string,
> = { > = {
selectFields?: (keyof T | TableSelectFieldsObject<T>)[]; selectFields?: (keyof T | TableSelectFieldsObject<T>)[];
omitFields?: (keyof T)[]; omitFields?: (keyof T)[];
@ -1056,14 +1056,14 @@ export type ServerQueryParam<
}; };
export type ServerQueryParamOrder< export type ServerQueryParamOrder<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
field: keyof T; field: keyof T;
strategy: "ASC" | "DESC"; strategy: "ASC" | "DESC";
}; };
export type ServerQueryParamFullTextSearch< export type ServerQueryParamFullTextSearch<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
fields: (keyof T)[]; fields: (keyof T)[];
searchTerm: string; searchTerm: string;
@ -1088,7 +1088,7 @@ export type ServerQueryParamsCountSrcTrgMap = {
}; };
export type TableSelectFieldsObject< export type TableSelectFieldsObject<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
fieldName: keyof T; fieldName: keyof T;
alias?: string; alias?: string;
@ -1108,7 +1108,7 @@ export type ServerQueryObjectValue =
export type ServerQueryObject< export type ServerQueryObject<
T extends object = { [key: string]: any }, T extends object = { [key: string]: any },
K extends string = string K extends string = string,
> = { > = {
value?: ServerQueryObjectValue; value?: ServerQueryObjectValue;
nullValue?: boolean; nullValue?: boolean;
@ -1128,7 +1128,7 @@ export type ServerQueryObject<
export type ServerQueryQueryObject< export type ServerQueryQueryObject<
T extends object = { [key: string]: any }, T extends object = { [key: string]: any },
K extends string = string K extends string = string,
> = { > = {
[key in keyof T]: ServerQueryObject<T, K>; [key in keyof T]: ServerQueryObject<T, K>;
}; };
@ -1147,7 +1147,7 @@ export type AuthFetchQuery = ServerQueryParam & {
export type ServerQueryParamsJoin< export type ServerQueryParamsJoin<
Table extends string = string, Table extends string = string,
Field extends object = { [key: string]: any } Field extends object = { [key: string]: any },
> = { > = {
joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN"; joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN";
alias?: string; alias?: string;
@ -1175,7 +1175,7 @@ export type ServerQueryParamsJoin<
}; };
export type ServerQueryParamsJoinMatchObject< export type ServerQueryParamsJoinMatchObject<
Field extends object = { [key: string]: any } Field extends object = { [key: string]: any },
> = { > = {
/** Field name from the **Root Table** */ /** Field name from the **Root Table** */
source: string | ServerQueryParamsJoinMatchSourceTargetObject; source: string | ServerQueryParamsJoinMatchSourceTargetObject;
@ -1257,7 +1257,7 @@ export type APICreateUserFunctionParams = {
}; };
export type APICreateUserFunction = ( export type APICreateUserFunction = (
params: APICreateUserFunctionParams params: APICreateUserFunctionParams,
) => Promise<AddUserFunctionReturn>; ) => Promise<AddUserFunctionReturn>;
/** /**
@ -1284,7 +1284,7 @@ export type APIGoogleLoginFunctionParams = {
}; };
export type APIGoogleLoginFunction = ( export type APIGoogleLoginFunction = (
params: APIGoogleLoginFunctionParams params: APIGoogleLoginFunctionParams,
) => Promise<APILoginFunctionReturn>; ) => Promise<APILoginFunctionReturn>;
/** /**
@ -1329,7 +1329,7 @@ export type HandleSocialDbFunctionReturn = {
* @returns {Promise<HandleSocialDbFunctionReturn>} - Response object * @returns {Promise<HandleSocialDbFunctionReturn>} - Response object
*/ */
export type HandleSocialDbFunction = ( export type HandleSocialDbFunction = (
params: HandleSocialDbFunctionParams params: HandleSocialDbFunctionParams,
) => Promise<APILoginFunctionReturn>; ) => Promise<APILoginFunctionReturn>;
export type ApiReauthUserReturn = { export type ApiReauthUserReturn = {
@ -1451,7 +1451,7 @@ export type CookieObject = {
}; };
export type HttpRequestParams< export type HttpRequestParams<
ReqObj extends { [k: string]: any } = { [k: string]: any } ReqObj extends { [k: string]: any } = { [k: string]: any },
> = RequestOptions & { > = RequestOptions & {
scheme?: "http" | "https"; scheme?: "http" | "https";
body?: ReqObj; body?: ReqObj;
@ -1461,11 +1461,11 @@ export type HttpRequestParams<
export type HttpRequestFunction< export type HttpRequestFunction<
ReqObj extends { [k: string]: any } = { [k: string]: any }, ReqObj extends { [k: string]: any } = { [k: string]: any },
ResObj extends { [k: string]: any } = { [k: string]: any } ResObj extends { [k: string]: any } = { [k: string]: any },
> = (param: HttpRequestParams<ReqObj>) => Promise<HttpFunctionResponse<ResObj>>; > = (param: HttpRequestParams<ReqObj>) => Promise<HttpFunctionResponse<ResObj>>;
export type HttpFunctionResponse< export type HttpFunctionResponse<
ResObj extends { [k: string]: any } = { [k: string]: any } ResObj extends { [k: string]: any } = { [k: string]: any },
> = { > = {
status: number; status: number;
data?: ResObj; data?: ResObj;
@ -1475,7 +1475,7 @@ export type HttpFunctionResponse<
}; };
export type ApiGetQueryObject< export type ApiGetQueryObject<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
query: ServerQueryParam<T>; query: ServerQueryParam<T>;
table: string; table: string;
@ -1501,7 +1501,7 @@ export const DataCrudRequestMethodsLowerCase = [
] as const; ] as const;
export type DsqlMethodCrudParam< export type DsqlMethodCrudParam<
T extends { [key: string]: any } = { [key: string]: any } T extends { [key: string]: any } = { [key: string]: any },
> = { > = {
method: (typeof DataCrudRequestMethods)[number]; method: (typeof DataCrudRequestMethods)[number];
body?: T; body?: T;
@ -1521,7 +1521,7 @@ export type DsqlMethodCrudParam<
}; };
export type DsqlCrudTransformDataFunction< export type DsqlCrudTransformDataFunction<
T extends { [key: string]: any } = { [key: string]: any } T extends { [key: string]: any } = { [key: string]: any },
> = (params: { > = (params: {
data: T; data: T;
user?: DATASQUIREL_LoggedInUser; user?: DATASQUIREL_LoggedInUser;
@ -1530,7 +1530,7 @@ export type DsqlCrudTransformDataFunction<
}) => Promise<T>; }) => Promise<T>;
export type DsqlCrudTransformQueryFunction< export type DsqlCrudTransformQueryFunction<
T extends { [key: string]: any } = { [key: string]: any } T extends { [key: string]: any } = { [key: string]: any },
> = (params: { > = (params: {
query: DsqlCrudQueryObject<T>; query: DsqlCrudQueryObject<T>;
user?: DATASQUIREL_LoggedInUser; user?: DATASQUIREL_LoggedInUser;
@ -1541,13 +1541,13 @@ export const DsqlCrudActions = ["insert", "update", "delete", "get"] as const;
export type DsqlCrudQueryObject< export type DsqlCrudQueryObject<
T extends { [key: string]: any } = { [key: string]: any }, T extends { [key: string]: any } = { [key: string]: any },
K extends string = string K extends string = string,
> = ServerQueryParam<T, K> & { > = ServerQueryParam<T, K> & {
query?: ServerQueryQueryObject<T, K>; query?: ServerQueryQueryObject<T, K>;
}; };
export type SQLDeleteGeneratorParams< export type SQLDeleteGeneratorParams<
T extends { [key: string]: any } = { [key: string]: any } T extends { [key: string]: any } = { [key: string]: any },
> = { > = {
tableName: string; tableName: string;
deleteKeyValues?: SQLDeleteData<T>[]; deleteKeyValues?: SQLDeleteData<T>[];
@ -1557,7 +1557,7 @@ export type SQLDeleteGeneratorParams<
}; };
export type SQLDeleteData< export type SQLDeleteData<
T extends { [key: string]: any } = { [key: string]: any } T extends { [key: string]: any } = { [key: string]: any },
> = { > = {
key: keyof T; key: keyof T;
value: string | number | null | undefined; value: string | number | null | undefined;
@ -1566,7 +1566,7 @@ export type SQLDeleteData<
export type DsqlCrudParam< export type DsqlCrudParam<
T extends { [key: string]: any } = { [key: string]: any }, T extends { [key: string]: any } = { [key: string]: any },
K extends string = string K extends string = string,
> = { > = {
action: (typeof DsqlCrudActions)[number]; action: (typeof DsqlCrudActions)[number];
table: K; table: K;
@ -1730,7 +1730,7 @@ export type ResponseQueryObject = {
}; };
export type APIResponseObject< export type APIResponseObject<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
success: boolean; success: boolean;
payload?: T[] | null; payload?: T[] | null;
@ -2152,7 +2152,7 @@ export const InvitedUserSelectFields = [
] as const; ] as const;
export type DefaultLocalResourcesHookParams< export type DefaultLocalResourcesHookParams<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
refresh?: number; refresh?: number;
setLoading?: React.Dispatch<React.SetStateAction<boolean>>; setLoading?: React.Dispatch<React.SetStateAction<boolean>>;
@ -2597,7 +2597,7 @@ export type SendEmailCodeParams = {
export type UpdateUserParams< export type UpdateUserParams<
T extends DSQL_DATASQUIREL_USERS = DSQL_DATASQUIREL_USERS & { T extends DSQL_DATASQUIREL_USERS = DSQL_DATASQUIREL_USERS & {
[k: string]: any; [k: string]: any;
} },
> = { > = {
apiKey?: string; apiKey?: string;
database: string; database: string;
@ -2622,7 +2622,7 @@ export type ResetPasswordParams = {
export type ApiUpdateUserParams< export type ApiUpdateUserParams<
T extends DSQL_DATASQUIREL_USERS = DSQL_DATASQUIREL_USERS & { T extends DSQL_DATASQUIREL_USERS = DSQL_DATASQUIREL_USERS & {
[k: string]: any; [k: string]: any;
} },
> = { > = {
payload: T; payload: T;
database: string; database: string;
@ -2904,7 +2904,7 @@ export type CRUDAPIHandlerParams = {
}; };
export type CrudQueryObject< export type CrudQueryObject<
P extends { [k: string]: any } = { [k: string]: any } P extends { [k: string]: any } = { [k: string]: any },
> = { > = {
paths?: string[]; paths?: string[];
query?: DsqlCrudQueryObject<P>; query?: DsqlCrudQueryObject<P>;
@ -2913,7 +2913,7 @@ export type CrudQueryObject<
}; };
export type APIPathsParams< export type APIPathsParams<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
/** /**
* Full URL with http and query * Full URL with http and query
@ -2948,14 +2948,14 @@ export type APIPathsParams<
}; };
export type APIPathsBody< export type APIPathsBody<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = APIPathsQuery<T> & { > = APIPathsQuery<T> & {
data?: T; data?: T;
batchData?: T[]; batchData?: T[];
}; };
export type APIPathsQuery< export type APIPathsQuery<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
searchQuery?: DsqlCrudQueryObject<T>; searchQuery?: DsqlCrudQueryObject<T>;
crudParams?: Pick< crudParams?: Pick<
@ -2972,7 +2972,7 @@ export type APIPathsQuery<
}; };
export type APIPathsParamsGetMiddleware< export type APIPathsParamsGetMiddleware<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = (params: { > = (params: {
query: APIPathsQuery<T>; query: APIPathsQuery<T>;
table: string; table: string;
@ -2981,7 +2981,7 @@ export type APIPathsParamsGetMiddleware<
export type APIPathsParamsCrudMiddleware< export type APIPathsParamsCrudMiddleware<
T extends { [k: string]: any } = { [k: string]: any }, T extends { [k: string]: any } = { [k: string]: any },
K extends string = string K extends string = string,
> = (params: { > = (params: {
body: APIPathsBody<T>; body: APIPathsBody<T>;
query: DsqlCrudQueryObject<T>; query: DsqlCrudQueryObject<T>;
@ -2990,12 +2990,12 @@ export type APIPathsParamsCrudMiddleware<
}) => Promise<APIPathsBody<T> | undefined>; }) => Promise<APIPathsBody<T> | undefined>;
export type APIPathsPostResulstsFn< export type APIPathsPostResulstsFn<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = ( > = (
params: APIPathsCrudParams<T> & { params: APIPathsCrudParams<T> & {
res?: APIResponseObject; res?: APIResponseObject;
} },
) => Promise<APIPathsBody<T> | undefined>; ) => Promise<void>;
export type APIPathsParamsAllowedTable = { export type APIPathsParamsAllowedTable = {
table: string; table: string;
@ -3004,7 +3004,7 @@ export type APIPathsParamsAllowedTable = {
}; };
export type APIPathsCrudParams< export type APIPathsCrudParams<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = APIPathsParams<T> & { > = APIPathsParams<T> & {
isAuthorized?: boolean; isAuthorized?: boolean;
table: string; table: string;
@ -3014,7 +3014,7 @@ export type APIPathsCrudParams<
}; };
export type APIPathsData< export type APIPathsData<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
table: string; table: string;
targetId?: string; targetId?: string;
@ -3024,7 +3024,7 @@ export type APIPathsData<
export type ClientCrudFetchParams< export type ClientCrudFetchParams<
T extends { [k: string]: any } = { [k: string]: any }, T extends { [k: string]: any } = { [k: string]: any },
P = string P = string,
> = Omit<DSQLFetchApiOptions<T>, "method"> & { > = Omit<DSQLFetchApiOptions<T>, "method"> & {
table: P; table: P;
method?: DSQLFetchApiOptions<T>["method"]; method?: DSQLFetchApiOptions<T>["method"];
@ -3037,7 +3037,7 @@ export type ClientCrudFetchParams<
}; };
export type DSQLFetchApiOptions< export type DSQLFetchApiOptions<
T extends { [k: string]: any } = { [k: string]: any } T extends { [k: string]: any } = { [k: string]: any },
> = { > = {
method: method:
| "POST" | "POST"
@ -3059,7 +3059,7 @@ export type DSQLFetchApiOptions<
export type AddDbEntryParam< export type AddDbEntryParam<
T extends { [k: string]: any } = any, T extends { [k: string]: any } = any,
K extends string = string K extends string = string,
> = { > = {
dbContext?: (typeof DbContextsArray)[number]; dbContext?: (typeof DbContextsArray)[number];
paradigm?: "Read Only" | "Full Access"; paradigm?: "Read Only" | "Full Access";

View File

@ -1,6 +1,6 @@
{ {
"name": "@moduletrace/datasquirel", "name": "@moduletrace/datasquirel",
"version": "5.7.30", "version": "5.7.31",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {