@contember/engine-system-api 1.1.0-beta.4 → 1.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/model/migrations/ProjectMigrator.d.ts.map +1 -1
- package/dist/src/model/migrations/ProjectMigrator.js +4 -2
- package/dist/src/model/migrations/ProjectMigrator.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/model/migrations/ProjectMigrator.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-system-api",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-rc.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -9,22 +9,22 @@
|
|
|
9
9
|
"test": "vitest"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@contember/authorization": "^1.1.0-
|
|
13
|
-
"@contember/database": "^1.1.0-
|
|
14
|
-
"@contember/database-migrations": "^1.1.0-
|
|
15
|
-
"@contember/dic": "^1.1.0-
|
|
16
|
-
"@contember/engine-common": "^1.1.0-
|
|
17
|
-
"@contember/graphql-utils": "^1.1.0-
|
|
18
|
-
"@contember/queryable": "^1.1.0-
|
|
19
|
-
"@contember/schema": "^1.1.0-
|
|
20
|
-
"@contember/schema-migrations": "^1.1.0-
|
|
21
|
-
"@contember/schema-utils": "^1.1.0-
|
|
12
|
+
"@contember/authorization": "^1.1.0-rc.2",
|
|
13
|
+
"@contember/database": "^1.1.0-rc.2",
|
|
14
|
+
"@contember/database-migrations": "^1.1.0-rc.2",
|
|
15
|
+
"@contember/dic": "^1.1.0-rc.2",
|
|
16
|
+
"@contember/engine-common": "^1.1.0-rc.2",
|
|
17
|
+
"@contember/graphql-utils": "^1.1.0-rc.2",
|
|
18
|
+
"@contember/queryable": "^1.1.0-rc.2",
|
|
19
|
+
"@contember/schema": "^1.1.0-rc.2",
|
|
20
|
+
"@contember/schema-migrations": "^1.1.0-rc.2",
|
|
21
|
+
"@contember/schema-utils": "^1.1.0-rc.2",
|
|
22
22
|
"@graphql-tools/utils": "^7.10.0",
|
|
23
23
|
"graphql-tag": "^2.12.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@contember/engine-api-tester": "^1.1.0-
|
|
27
|
-
"@contember/schema-definition": "^1.1.0-
|
|
26
|
+
"@contember/engine-api-tester": "^1.1.0-rc.2",
|
|
27
|
+
"@contember/schema-definition": "^1.1.0-rc.2",
|
|
28
28
|
"@graphql-codegen/cli": "^1.15.2",
|
|
29
29
|
"@graphql-codegen/typescript": "^1.15.2",
|
|
30
30
|
"@graphql-codegen/typescript-operations": "^1.15.2",
|
|
@@ -8,6 +8,7 @@ import { DatabaseContext } from '../database'
|
|
|
8
8
|
import { ExecutedMigrationsResolver } from './ExecutedMigrationsResolver'
|
|
9
9
|
import { MigrateErrorCode } from '../../schema'
|
|
10
10
|
import { SchemaVersionBuilder } from './SchemaVersionBuilder'
|
|
11
|
+
import { SchemaValidator } from '@contember/schema-utils'
|
|
11
12
|
|
|
12
13
|
export class ProjectMigrator {
|
|
13
14
|
constructor(
|
|
@@ -74,11 +75,12 @@ export class ProjectMigrator {
|
|
|
74
75
|
}
|
|
75
76
|
const latestModification = described[described.length - 1]
|
|
76
77
|
schema = latestModification.schema
|
|
77
|
-
|
|
78
|
+
const errors = SchemaValidator.validate(schema)
|
|
79
|
+
if (errors.length > 0) {
|
|
78
80
|
throw new InvalidSchemaError(
|
|
79
81
|
migration.version,
|
|
80
82
|
'Migration generates invalid schema: \n' +
|
|
81
|
-
|
|
83
|
+
errors.map(it => it.path.join('.') + ': ' + it.message).join('\n'),
|
|
82
84
|
)
|
|
83
85
|
}
|
|
84
86
|
}
|