diff --git a/dist/package-shared/types/index.d.ts b/dist/package-shared/types/index.d.ts index 1fea1e2..fa2dd0e 100644 --- a/dist/package-shared/types/index.d.ts +++ b/dist/package-shared/types/index.d.ts @@ -2313,7 +2313,7 @@ export type APIPathsPostResulstsFn = (params: APIPathsCrudParams & { res?: APIResponseObject; -}) => Promise | undefined>; +}) => Promise; export type APIPathsParamsAllowedTable = { table: string; allowedFields?: (string | RegExp)[]; diff --git a/package-shared/types/index.ts b/package-shared/types/index.ts index 1a81862..01d29dd 100644 --- a/package-shared/types/index.ts +++ b/package-shared/types/index.ts @@ -962,7 +962,7 @@ export type AddApiKeyRequestBody = { }; export type CheckApiCredentialsFn = ( - param: CheckApiCredentialsFnParam + param: CheckApiCredentialsFnParam, ) => ApiKeyObject | null | undefined; export type CheckApiCredentialsFnParam = { key?: string; @@ -975,7 +975,7 @@ export type CheckApiCredentialsFnParam = { export type FetchApiFn = ( url: string, options?: FetchApiOptions, - csrf?: boolean + csrf?: boolean, ) => Promise; export type FetchApiOptions = RequestInit & { @@ -1030,7 +1030,7 @@ export const ServerQueryEqualities = [ export type ServerQueryParam< T extends { [k: string]: any } = { [k: string]: any }, - K extends string = string + K extends string = string, > = { selectFields?: (keyof T | TableSelectFieldsObject)[]; omitFields?: (keyof T)[]; @@ -1056,14 +1056,14 @@ export type ServerQueryParam< }; export type ServerQueryParamOrder< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { field: keyof T; strategy: "ASC" | "DESC"; }; export type ServerQueryParamFullTextSearch< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { fields: (keyof T)[]; searchTerm: string; @@ -1088,7 +1088,7 @@ export type ServerQueryParamsCountSrcTrgMap = { }; export type TableSelectFieldsObject< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { fieldName: keyof T; alias?: string; @@ -1108,7 +1108,7 @@ export type ServerQueryObjectValue = export type ServerQueryObject< T extends object = { [key: string]: any }, - K extends string = string + K extends string = string, > = { value?: ServerQueryObjectValue; nullValue?: boolean; @@ -1128,7 +1128,7 @@ export type ServerQueryObject< export type ServerQueryQueryObject< T extends object = { [key: string]: any }, - K extends string = string + K extends string = string, > = { [key in keyof T]: ServerQueryObject; }; @@ -1147,7 +1147,7 @@ export type AuthFetchQuery = ServerQueryParam & { export type ServerQueryParamsJoin< Table extends string = string, - Field extends object = { [key: string]: any } + Field extends object = { [key: string]: any }, > = { joinType: "INNER JOIN" | "JOIN" | "LEFT JOIN" | "RIGHT JOIN"; alias?: string; @@ -1175,7 +1175,7 @@ export type ServerQueryParamsJoin< }; export type ServerQueryParamsJoinMatchObject< - Field extends object = { [key: string]: any } + Field extends object = { [key: string]: any }, > = { /** Field name from the **Root Table** */ source: string | ServerQueryParamsJoinMatchSourceTargetObject; @@ -1257,7 +1257,7 @@ export type APICreateUserFunctionParams = { }; export type APICreateUserFunction = ( - params: APICreateUserFunctionParams + params: APICreateUserFunctionParams, ) => Promise; /** @@ -1284,7 +1284,7 @@ export type APIGoogleLoginFunctionParams = { }; export type APIGoogleLoginFunction = ( - params: APIGoogleLoginFunctionParams + params: APIGoogleLoginFunctionParams, ) => Promise; /** @@ -1329,7 +1329,7 @@ export type HandleSocialDbFunctionReturn = { * @returns {Promise} - Response object */ export type HandleSocialDbFunction = ( - params: HandleSocialDbFunctionParams + params: HandleSocialDbFunctionParams, ) => Promise; export type ApiReauthUserReturn = { @@ -1451,7 +1451,7 @@ export type CookieObject = { }; export type HttpRequestParams< - ReqObj extends { [k: string]: any } = { [k: string]: any } + ReqObj extends { [k: string]: any } = { [k: string]: any }, > = RequestOptions & { scheme?: "http" | "https"; body?: ReqObj; @@ -1461,11 +1461,11 @@ export type HttpRequestParams< export type HttpRequestFunction< 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) => Promise>; export type HttpFunctionResponse< - ResObj extends { [k: string]: any } = { [k: string]: any } + ResObj extends { [k: string]: any } = { [k: string]: any }, > = { status: number; data?: ResObj; @@ -1475,7 +1475,7 @@ export type HttpFunctionResponse< }; export type ApiGetQueryObject< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { query: ServerQueryParam; table: string; @@ -1501,7 +1501,7 @@ export const DataCrudRequestMethodsLowerCase = [ ] as const; export type DsqlMethodCrudParam< - T extends { [key: string]: any } = { [key: string]: any } + T extends { [key: string]: any } = { [key: string]: any }, > = { method: (typeof DataCrudRequestMethods)[number]; body?: T; @@ -1521,7 +1521,7 @@ export type DsqlMethodCrudParam< }; export type DsqlCrudTransformDataFunction< - T extends { [key: string]: any } = { [key: string]: any } + T extends { [key: string]: any } = { [key: string]: any }, > = (params: { data: T; user?: DATASQUIREL_LoggedInUser; @@ -1530,7 +1530,7 @@ export type DsqlCrudTransformDataFunction< }) => Promise; export type DsqlCrudTransformQueryFunction< - T extends { [key: string]: any } = { [key: string]: any } + T extends { [key: string]: any } = { [key: string]: any }, > = (params: { query: DsqlCrudQueryObject; user?: DATASQUIREL_LoggedInUser; @@ -1541,13 +1541,13 @@ export const DsqlCrudActions = ["insert", "update", "delete", "get"] as const; export type DsqlCrudQueryObject< T extends { [key: string]: any } = { [key: string]: any }, - K extends string = string + K extends string = string, > = ServerQueryParam & { query?: ServerQueryQueryObject; }; export type SQLDeleteGeneratorParams< - T extends { [key: string]: any } = { [key: string]: any } + T extends { [key: string]: any } = { [key: string]: any }, > = { tableName: string; deleteKeyValues?: SQLDeleteData[]; @@ -1557,7 +1557,7 @@ export type SQLDeleteGeneratorParams< }; export type SQLDeleteData< - T extends { [key: string]: any } = { [key: string]: any } + T extends { [key: string]: any } = { [key: string]: any }, > = { key: keyof T; value: string | number | null | undefined; @@ -1566,7 +1566,7 @@ export type SQLDeleteData< export type DsqlCrudParam< T extends { [key: string]: any } = { [key: string]: any }, - K extends string = string + K extends string = string, > = { action: (typeof DsqlCrudActions)[number]; table: K; @@ -1730,7 +1730,7 @@ export type ResponseQueryObject = { }; export type APIResponseObject< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { success: boolean; payload?: T[] | null; @@ -2152,7 +2152,7 @@ export const InvitedUserSelectFields = [ ] as const; export type DefaultLocalResourcesHookParams< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { refresh?: number; setLoading?: React.Dispatch>; @@ -2597,7 +2597,7 @@ export type SendEmailCodeParams = { export type UpdateUserParams< T extends DSQL_DATASQUIREL_USERS = DSQL_DATASQUIREL_USERS & { [k: string]: any; - } + }, > = { apiKey?: string; database: string; @@ -2622,7 +2622,7 @@ export type ResetPasswordParams = { export type ApiUpdateUserParams< T extends DSQL_DATASQUIREL_USERS = DSQL_DATASQUIREL_USERS & { [k: string]: any; - } + }, > = { payload: T; database: string; @@ -2904,7 +2904,7 @@ export type CRUDAPIHandlerParams = { }; export type CrudQueryObject< - P extends { [k: string]: any } = { [k: string]: any } + P extends { [k: string]: any } = { [k: string]: any }, > = { paths?: string[]; query?: DsqlCrudQueryObject

; @@ -2913,7 +2913,7 @@ export type CrudQueryObject< }; 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 @@ -2948,14 +2948,14 @@ export type APIPathsParams< }; export type APIPathsBody< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = APIPathsQuery & { data?: T; batchData?: T[]; }; export type APIPathsQuery< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { searchQuery?: DsqlCrudQueryObject; crudParams?: Pick< @@ -2972,7 +2972,7 @@ export type APIPathsQuery< }; export type APIPathsParamsGetMiddleware< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = (params: { query: APIPathsQuery; table: string; @@ -2981,7 +2981,7 @@ export type APIPathsParamsGetMiddleware< export type APIPathsParamsCrudMiddleware< T extends { [k: string]: any } = { [k: string]: any }, - K extends string = string + K extends string = string, > = (params: { body: APIPathsBody; query: DsqlCrudQueryObject; @@ -2990,12 +2990,12 @@ export type APIPathsParamsCrudMiddleware< }) => Promise | undefined>; export type APIPathsPostResulstsFn< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = ( params: APIPathsCrudParams & { res?: APIResponseObject; - } -) => Promise | undefined>; + }, +) => Promise; export type APIPathsParamsAllowedTable = { table: string; @@ -3004,7 +3004,7 @@ export type APIPathsParamsAllowedTable = { }; export type APIPathsCrudParams< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = APIPathsParams & { isAuthorized?: boolean; table: string; @@ -3014,7 +3014,7 @@ export type APIPathsCrudParams< }; export type APIPathsData< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { table: string; targetId?: string; @@ -3024,7 +3024,7 @@ export type APIPathsData< export type ClientCrudFetchParams< T extends { [k: string]: any } = { [k: string]: any }, - P = string + P = string, > = Omit, "method"> & { table: P; method?: DSQLFetchApiOptions["method"]; @@ -3037,7 +3037,7 @@ export type ClientCrudFetchParams< }; export type DSQLFetchApiOptions< - T extends { [k: string]: any } = { [k: string]: any } + T extends { [k: string]: any } = { [k: string]: any }, > = { method: | "POST" @@ -3059,7 +3059,7 @@ export type DSQLFetchApiOptions< export type AddDbEntryParam< T extends { [k: string]: any } = any, - K extends string = string + K extends string = string, > = { dbContext?: (typeof DbContextsArray)[number]; paradigm?: "Read Only" | "Full Access"; diff --git a/package.json b/package.json index 4a64b2f..257e8f8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "5.7.30", + "version": "5.7.31", "description": "Cloud-based SQL data management tool", "main": "dist/index.js", "bin": {