@contember/schema-definition
Advanced tools
Comparing version 0.12.0-beta.2 to 1.0.0-alpha.0
@@ -24,3 +24,3 @@ "use strict"; | ||
operations: {}, | ||
predicates: { [name]: PredicateReference_1.resolvePredicateReference(this.schema, this.permissions, entity, predicate) }, | ||
predicates: { [name]: (0, PredicateReference_1.resolvePredicateReference)(this.schema, this.permissions, entity, predicate) }, | ||
}, | ||
@@ -94,4 +94,4 @@ }), {}); | ||
const fields = this.entities | ||
.map(it => utils_1.tuple(it, Object.values(it.fields).filter(field => fieldSelectorConst.matches(this.schema, it, field)))) | ||
.reduce((acc, [entity, fields]) => [...acc, ...fields.map(it => utils_1.tuple(entity, it))], []); | ||
.map(it => (0, utils_1.tuple)(it, Object.values(it.fields).filter(field => fieldSelectorConst.matches(this.schema, it, field)))) | ||
.reduce((acc, [entity, fields]) => [...acc, ...fields.map(it => (0, utils_1.tuple)(entity, it))], []); | ||
return new FieldPermissionsBuilder_1.default(this, fields); | ||
@@ -98,0 +98,0 @@ } |
@@ -19,3 +19,3 @@ "use strict"; | ||
return this.matching((schema, entity) => entity.fields[name] && | ||
schema_utils_1.acceptFieldVisitor(schema, entity, name, { | ||
(0, schema_utils_1.acceptFieldVisitor)(schema, entity, name, { | ||
visitColumn: () => false, | ||
@@ -22,0 +22,0 @@ visitRelation: ({}, {}, target) => !targetEntity || target.name === targetEntity, |
@@ -9,5 +9,5 @@ "use strict"; | ||
if (overrides[key]) { | ||
return utils_1.tuple(key, this.overrideEntityPermissions(value, overrides[key])); | ||
return (0, utils_1.tuple)(key, this.overrideEntityPermissions(value, overrides[key])); | ||
} | ||
return utils_1.tuple(key, value); | ||
return (0, utils_1.tuple)(key, value); | ||
}) | ||
@@ -14,0 +14,0 @@ .reduce((acc, [key, value]) => ({ ...acc, [key]: value }), {}); |
@@ -26,3 +26,3 @@ "use strict"; | ||
type, | ||
columnType: getColumnType_1.getColumnType(type), | ||
columnType: (0, getColumnType_1.getColumnType)(type), | ||
...(options.typeAlias !== undefined ? { typeAlias: options.typeAlias } : {}), | ||
@@ -29,0 +29,0 @@ }; |
@@ -67,3 +67,3 @@ "use strict"; | ||
type: type, | ||
columnType: columnType || utils_1.getColumnType(type), | ||
columnType: columnType || (0, utils_1.getColumnType)(type), | ||
...(typeAlias !== undefined ? { typeAlias } : {}), | ||
@@ -70,0 +70,0 @@ }; |
@@ -34,3 +34,3 @@ "use strict"; | ||
unique: this.createUnique(entityName, definitionInstance), | ||
fields: [utils_1.tuple(primaryName, primaryField), ...Object.entries(definitionInstance)] | ||
fields: [(0, utils_1.tuple)(primaryName, primaryField), ...Object.entries(definitionInstance)] | ||
.map(([name, definition]) => { | ||
@@ -53,3 +53,3 @@ return definition.createField({ | ||
}; | ||
return extensions_1.applyEntityExtensions(definition, entity, definitionInstance); | ||
return (0, extensions_1.applyEntityExtensions)(definition, entity, definitionInstance); | ||
}); | ||
@@ -56,0 +56,0 @@ return { |
@@ -7,3 +7,3 @@ "use strict"; | ||
function Unique(options, ...args) { | ||
return extensions_1.extendEntity(entity => { | ||
return (0, extensions_1.extendEntity)(entity => { | ||
const fields = (typeof options !== 'object' ? [options, ...args] : options.fields); | ||
@@ -10,0 +10,0 @@ const name = typeof options === 'object' && options.name |
@@ -5,3 +5,3 @@ "use strict"; | ||
const extensions_1 = require("./extensions"); | ||
const View = (sql) => extensions_1.extendEntity(entity => ({ | ||
const View = (sql) => (0, extensions_1.extendEntity)(entity => ({ | ||
...entity, | ||
@@ -8,0 +8,0 @@ view: { |
@@ -25,3 +25,3 @@ "use strict"; | ||
default: | ||
return utils_1.assertNever(type); | ||
return (0, utils_1.assertNever)(type); | ||
} | ||
@@ -28,0 +28,0 @@ }; |
@@ -25,3 +25,3 @@ "use strict"; | ||
type: schema_1.Validation.ArgumentType.path, | ||
path: exports.parsePath(path), | ||
path: (0, exports.parsePath)(path), | ||
}), | ||
@@ -178,9 +178,9 @@ literal: (value) => ({ type: schema_1.Validation.ArgumentType.literal, value }), | ||
const fields = Object.keys(defInstance); | ||
return utils_1.tuple(name, fields | ||
return (0, utils_1.tuple)(name, fields | ||
.map(field => { | ||
const fieldRules = Reflect.getMetadata(RuleMetaKey, target, field); | ||
if (fieldRules === undefined) { | ||
return utils_1.tuple(field, []); | ||
return (0, utils_1.tuple)(field, []); | ||
} | ||
return utils_1.tuple(field, fieldRules); | ||
return (0, utils_1.tuple)(field, fieldRules); | ||
}) | ||
@@ -187,0 +187,0 @@ .reduce((ruleSet, [field, rules]) => (rules.length > 0 ? { ...ruleSet, [field]: rules } : ruleSet), {})); |
{ | ||
"name": "@contember/schema-definition", | ||
"version": "0.12.0-beta.2", | ||
"version": "1.0.0-alpha.0", | ||
"license": "Apache-2.0", | ||
@@ -11,4 +11,4 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@contember/schema": "^0.12.0-beta.2", | ||
"@contember/schema-utils": "^0.12.0-beta.2", | ||
"@contember/schema": "^1.0.0-alpha.0", | ||
"@contember/schema-utils": "^1.0.0-alpha.0", | ||
"reflect-metadata": "^0.1.13" | ||
@@ -15,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
352850
+ Added@contember/schema@1.4.7(transitive)
+ Added@contember/schema-utils@1.4.7(transitive)
+ Added@contember/typesafe@1.4.7(transitive)
- Removed@contember/schema@0.12.0-beta.2(transitive)
- Removed@contember/schema-utils@0.12.0-beta.2(transitive)