diff --git a/lib/JSONBValidation/validation.ts b/lib/JSONBValidation/validation.ts index 5d5d72e7..1a668d52 100644 --- a/lib/JSONBValidation/validation.ts +++ b/lib/JSONBValidation/validation.ts @@ -93,9 +93,9 @@ export function getJSONBSchemaTSTypes(schema: JSONB.JSONBSchema, colOpts: ColOpt } else if (fieldType?.record) { const { keysEnum, values, partial } = fieldType.record; - // TODO: ensure props with undefined values are not allowed in the TS type + // TODO: ensure props with undefined values are not allowed in the TS type (strict union) const getRecord = (v: string) => partial? `Partial>` : `Record<${v}>`; - return `${fieldType.nullable ? `null |` : ""} ${getRecord(`${keysEnum?.map(v => asValue(v)).join(" | ") ?? "string"}, ${!values? "any" : getFieldType(values, true, undefined, depth + 1)}`)}>>` + return `${fieldType.nullable ? `null |` : ""} ${getRecord(`${keysEnum?.map(v => asValue(v)).join(" | ") ?? "string"}, ${!values? "any" : getFieldType(values, true, undefined, depth + 1)}`)}` } else if(fieldType?.lookup){ diff --git a/package-lock.json b/package-lock.json index e56425a0..4f888afe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prostgles-server", - "version": "4.1.85", + "version": "4.1.86", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prostgles-server", - "version": "4.1.85", + "version": "4.1.86", "license": "MIT", "dependencies": { "@types/express": "^4.17.13", diff --git a/package.json b/package.json index 36e3c22e..394d1a5c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prostgles-server", - "version": "4.1.85", + "version": "4.1.86", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/tests/client/PID.txt b/tests/client/PID.txt index 81d12095..5af747d0 100644 --- a/tests/client/PID.txt +++ b/tests/client/PID.txt @@ -1 +1 @@ -1750441 +1754269 diff --git a/tests/server/DBoGenerated.d.ts b/tests/server/DBoGenerated.d.ts index d9b7724a..8affdb85 100644 --- a/tests/server/DBoGenerated.d.ts +++ b/tests/server/DBoGenerated.d.ts @@ -485,7 +485,7 @@ export type DBSchemaGenerated = { | { ok: string; } | { err: string; } | { loading: { loaded: number; total: number; }; } - table_config?: null | { referencedTables?: ( { name: string; minFiles: number; } )[]; recType?: null | Record<'a' | 'b', { bools: boolean[]; }>>>; }; + table_config?: null | { referencedTables?: ( { name: string; minFiles: number; } )[]; recType?: null | Record<'a' | 'b', { bools: boolean[]; }>; }; }; }; tr1: { diff --git a/tests/server/package-lock.json b/tests/server/package-lock.json index c485ead3..54012b61 100644 --- a/tests/server/package-lock.json +++ b/tests/server/package-lock.json @@ -21,7 +21,7 @@ }, "../..": { "name": "prostgles-server", - "version": "4.1.85", + "version": "4.1.86", "license": "MIT", "dependencies": { "@types/express": "^4.17.13",