@contember/schema-utils
Advanced tools
Comparing version 0.12.0-alpha.4 to 0.12.0-alpha.5
@@ -27,3 +27,2 @@ "use strict"; | ||
default: | ||
; | ||
((x) => { })(type); | ||
@@ -30,0 +29,0 @@ } |
@@ -7,3 +7,3 @@ "use strict"; | ||
const normalizeSchema = (schema) => { | ||
var _a; | ||
var _a, _b; | ||
return { | ||
@@ -27,4 +27,22 @@ ...schema, | ||
}, | ||
[schema_1.ProjectRole.MIGRATION]: { | ||
[schema_1.ProjectRole.CONTENT_ADMIN]: { | ||
stages: '*', | ||
variables: {}, | ||
entities: new acl_1.AllowAllPermissionFactory().create(schema.model), | ||
s3: { | ||
'**': { | ||
upload: true, | ||
read: true, | ||
}, | ||
}, | ||
system: { | ||
diff: schema_1.Acl.SystemPermissionsLevel.any, | ||
history: schema_1.Acl.SystemPermissionsLevel.any, | ||
release: schema_1.Acl.SystemPermissionsLevel.any, | ||
rebase: schema_1.Acl.SystemPermissionsLevel.any, | ||
}, | ||
...(((_b = schema.acl.roles) === null || _b === void 0 ? void 0 : _b[schema_1.ProjectRole.CONTENT_ADMIN]) || {}), | ||
}, | ||
[schema_1.ProjectRole.MAINTAINER]: { | ||
stages: '*', | ||
entities: {}, | ||
@@ -31,0 +49,0 @@ variables: {}, |
@@ -219,3 +219,2 @@ "use strict"; | ||
if (((it) => 'orderBy' in it)(field)) { | ||
; | ||
(_a = field.orderBy) === null || _a === void 0 ? void 0 : _a.forEach(it => { | ||
@@ -222,0 +221,0 @@ let entity = targetEntity; |
@@ -218,3 +218,2 @@ "use strict"; | ||
default: | ||
; | ||
((_) => { | ||
@@ -221,0 +220,0 @@ errorBuilder.for('operation', `Operation ${validatorCast.operation} is not an valid option`); |
{ | ||
"name": "@contember/schema-utils", | ||
"version": "0.12.0-alpha.4", | ||
"version": "0.12.0-alpha.5", | ||
"license": "Apache-2.0", | ||
@@ -11,3 +11,3 @@ "main": "dist/src/index.js", | ||
"dependencies": { | ||
"@contember/schema": "^0.12.0-alpha.4" | ||
"@contember/schema": "^0.12.0-alpha.5" | ||
}, | ||
@@ -14,0 +14,0 @@ "devDependencies": { |
@@ -35,3 +35,3 @@ import { Acl, Model } from '@contember/schema' | ||
? { | ||
delete: true, | ||
delete: true, | ||
} | ||
@@ -38,0 +38,0 @@ : {}), |
@@ -30,3 +30,3 @@ import { Input, Model, Value } from '@contember/schema' | ||
default: | ||
;((x: never) => {})(type) | ||
((x: never) => {})(type) | ||
} | ||
@@ -33,0 +33,0 @@ |
@@ -14,3 +14,3 @@ import { Schema } from '@contember/schema' | ||
? { | ||
inherits: definition.inherits.filter(it => roles.map(([role]) => role).includes(it)), | ||
inherits: definition.inherits.filter(it => roles.map(([role]) => role).includes(it)), | ||
} | ||
@@ -17,0 +17,0 @@ : {}), |
@@ -23,4 +23,22 @@ import { Acl, ProjectRole, Schema } from '@contember/schema' | ||
}, | ||
[ProjectRole.MIGRATION]: { | ||
[ProjectRole.CONTENT_ADMIN]: { | ||
stages: '*', | ||
variables: {}, | ||
entities: new AllowAllPermissionFactory().create(schema.model), | ||
s3: { | ||
'**': { | ||
upload: true, | ||
read: true, | ||
}, | ||
}, | ||
system: { | ||
diff: Acl.SystemPermissionsLevel.any, | ||
history: Acl.SystemPermissionsLevel.any, | ||
release: Acl.SystemPermissionsLevel.any, | ||
rebase: Acl.SystemPermissionsLevel.any, | ||
}, | ||
...((schema.acl.roles?.[ProjectRole.CONTENT_ADMIN] as Acl.RolePermissions | undefined) || {}), | ||
}, | ||
[ProjectRole.MAINTAINER]: { | ||
stages: '*', | ||
entities: {}, | ||
@@ -27,0 +45,0 @@ variables: {}, |
@@ -240,3 +240,3 @@ import { Model } from '@contember/schema' | ||
if (((it: Model.AnyRelation): it is Model.AnyRelation & Model.OrderableRelation => 'orderBy' in it)(field as any)) { | ||
;(field as Model.OrderableRelation).orderBy?.forEach(it => { | ||
(field as Model.OrderableRelation).orderBy?.forEach(it => { | ||
let entity = targetEntity | ||
@@ -243,0 +243,0 @@ |
@@ -258,3 +258,3 @@ import { Model, Validation } from '@contember/schema' | ||
default: | ||
;((_: never) => { | ||
((_: never) => { | ||
errorBuilder.for('operation', `Operation ${(validatorCast as any).operation} is not an valid option`) | ||
@@ -261,0 +261,0 @@ })(validatorCast) |
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
245461
3785