@contember/schema-utils
Advanced tools
Comparing version 2.0.0-alpha.19 to 2.0.0-alpha.20
import * as Typesafe from "@contember/typesafe"; | ||
import { ParseError } from "@contember/typesafe"; | ||
import { Model } from "@contember/schema"; | ||
@@ -102,3 +103,8 @@ const orderBySchema = Typesafe.array(Typesafe.object({ | ||
columnName: Typesafe.string, | ||
columnType: Typesafe.string, | ||
columnType: Typesafe.transform(Typesafe.string, (it, raw, path) => { | ||
if (!it.replaceAll(/\s+/g, "").match(/^[\w_]+(?:\(\w+(?:,\w+)*\))?\w*(?:"[^"]+")?(\[])*$/)) { | ||
throw ParseError.format(it, path, "valid column type"); | ||
} | ||
return it; | ||
}), | ||
nullable: Typesafe.boolean, | ||
@@ -105,0 +111,0 @@ type: Typesafe.enumeration(...Object.values(Model.ColumnType)) |
@@ -9,2 +9,3 @@ import * as Typesafe from "@contember/typesafe"; | ||
useExistsInHasManyFilter: Typesafe.boolean, | ||
fullDateTimeResponse: Typesafe.boolean, | ||
shortDateResponse: Typesafe.boolean | ||
@@ -11,0 +12,0 @@ }) |
import * as Typesafe from "@contember/typesafe"; | ||
import { ParseError } from "@contember/typesafe"; | ||
import { Model } from "@contember/schema"; | ||
@@ -102,3 +103,8 @@ const orderBySchema = Typesafe.array(Typesafe.object({ | ||
columnName: Typesafe.string, | ||
columnType: Typesafe.string, | ||
columnType: Typesafe.transform(Typesafe.string, (it, raw, path) => { | ||
if (!it.replaceAll(/\s+/g, "").match(/^[\w_]+(?:\(\w+(?:,\w+)*\))?\w*(?:"[^"]+")?(\[])*$/)) { | ||
throw ParseError.format(it, path, "valid column type"); | ||
} | ||
return it; | ||
}), | ||
nullable: Typesafe.boolean, | ||
@@ -105,0 +111,0 @@ type: Typesafe.enumeration(...Object.values(Model.ColumnType)) |
@@ -9,2 +9,3 @@ import * as Typesafe from "@contember/typesafe"; | ||
useExistsInHasManyFilter: Typesafe.boolean, | ||
fullDateTimeResponse: Typesafe.boolean, | ||
shortDateResponse: Typesafe.boolean | ||
@@ -11,0 +12,0 @@ }) |
@@ -10,2 +10,3 @@ import * as Typesafe from '@contember/typesafe'; | ||
readonly useExistsInHasManyFilter?: boolean | undefined; | ||
readonly fullDateTimeResponse?: boolean | undefined; | ||
readonly shortDateResponse?: boolean | undefined; | ||
@@ -27,2 +28,3 @@ } | undefined; | ||
readonly useExistsInHasManyFilter?: boolean | undefined; | ||
readonly fullDateTimeResponse?: boolean | undefined; | ||
readonly shortDateResponse?: boolean | undefined; | ||
@@ -32,2 +34,3 @@ }; | ||
useExistsInHasManyFilter: Typesafe.Type<boolean>; | ||
fullDateTimeResponse: Typesafe.Type<boolean>; | ||
shortDateResponse: Typesafe.Type<boolean>; | ||
@@ -34,0 +37,0 @@ }; |
{ | ||
"name": "@contember/schema-utils", | ||
"version": "2.0.0-alpha.19", | ||
"version": "2.0.0-alpha.20", | ||
"license": "Apache-2.0", | ||
@@ -26,10 +26,10 @@ "main": "./dist/production/index.js", | ||
"dependencies": { | ||
"@contember/schema": "2.0.0-alpha.19", | ||
"@contember/typesafe": "2.0.0-alpha.19" | ||
"@contember/schema": "2.0.0-alpha.20", | ||
"@contember/typesafe": "2.0.0-alpha.20" | ||
}, | ||
"devDependencies": { | ||
"@contember/schema-definition": "2.0.0-alpha.19", | ||
"@types/node": "^20.16.5" | ||
"@contember/schema-definition": "2.0.0-alpha.20", | ||
"@types/node": "^20.16.11" | ||
}, | ||
"type": "module" | ||
} |
import * as Typesafe from '@contember/typesafe' | ||
import { Model } from '@contember/schema' | ||
import { ParseError } from '@contember/typesafe' | ||
@@ -121,3 +122,8 @@ const orderBySchema = Typesafe.array(Typesafe.object({ | ||
columnName: Typesafe.string, | ||
columnType: Typesafe.string, | ||
columnType: Typesafe.transform(Typesafe.string, (it, raw, path) => { | ||
if (!it.replaceAll(/\s+/g, '').match(/^[\w_]+(?:\(\w+(?:,\w+)*\))?\w*(?:"[^"]+")?(\[])*$/)) { | ||
throw ParseError.format(it, path, 'valid column type') | ||
} | ||
return it | ||
}), | ||
nullable: Typesafe.boolean, | ||
@@ -124,0 +130,0 @@ type: Typesafe.enumeration<Model.ColumnType>(...Object.values(Model.ColumnType)), |
@@ -12,2 +12,3 @@ import * as Typesafe from '@contember/typesafe' | ||
useExistsInHasManyFilter: Typesafe.boolean, | ||
fullDateTimeResponse: Typesafe.boolean, | ||
shortDateResponse: Typesafe.boolean, | ||
@@ -14,0 +15,0 @@ }), |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1564997
465
16900
+ Added@contember/schema@2.0.0-alpha.20(transitive)
+ Added@contember/typesafe@2.0.0-alpha.20(transitive)
- Removed@contember/schema@2.0.0-alpha.19(transitive)
- Removed@contember/typesafe@2.0.0-alpha.19(transitive)