Update Types

This commit is contained in:
Benjamin Toby 2024-11-09 07:09:00 +01:00
parent 0d6b1d7e4c
commit 7dd8111b5b
2 changed files with 14 additions and 9 deletions

View File

@ -1174,26 +1174,31 @@ export type AuthFetchQuery = ServerQueryParam & {
[key: string]: string | number | { [key: string]: any }; [key: string]: string | number | { [key: string]: any };
}; };
export type ServerQueryParamsJoin = { export type ServerQueryParamsJoin<
Table extends string = string,
Field extends object = { [key: string]: any }
> = {
joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN"; joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN";
tableName: string; tableName: Table;
match?: match?:
| ServerQueryParamsJoinMatchObject | ServerQueryParamsJoinMatchObject<Field>
| ServerQueryParamsJoinMatchObject[]; | ServerQueryParamsJoinMatchObject<Field>[];
selectFields?: ( selectFields?: (
| string | keyof Field
| { | {
field: string; field: keyof Field;
alias?: string; alias?: string;
} }
)[]; )[];
}; };
export type ServerQueryParamsJoinMatchObject = { export type ServerQueryParamsJoinMatchObject<
Field extends object = { [key: string]: any }
> = {
/** Field name from the **Root Table** */ /** Field name from the **Root Table** */
source: string | ServerQueryParamsJoinMatchSourceTargetObject; source: string | ServerQueryParamsJoinMatchSourceTargetObject;
/** Field name from the **Join Table** */ /** Field name from the **Join Table** */
target: string | ServerQueryParamsJoinMatchSourceTargetObject; target: keyof Field | ServerQueryParamsJoinMatchSourceTargetObject;
}; };
export type ServerQueryParamsJoinMatchSourceTargetObject = { export type ServerQueryParamsJoinMatchSourceTargetObject = {

View File

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