@contember/engine-system-api 1.1.0-rc.3 → 1.2.0-alpha.3
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/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/model/ProjectInitializer.d.ts +2 -2
- package/dist/src/model/ProjectInitializer.d.ts.map +1 -1
- package/dist/src/model/ProjectInitializer.js +5 -1
- package/dist/src/model/ProjectInitializer.js.map +1 -1
- package/dist/src/resolvers/ResolverFactory.d.ts +1 -1
- package/dist/src/resolvers/ResolverFactory.d.ts.map +1 -1
- package/dist/src/schema/types.d.ts +126 -141
- package/dist/src/schema/types.d.ts.map +1 -1
- package/dist/src/schema/types.js +6 -6
- package/dist/src/schema/types.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/tests/tsconfig.tsbuildinfo +1 -1
- package/graphql.codegen.yml +0 -2
- package/package.json +20 -20
- package/src/index.ts +11 -10
- package/src/model/ProjectInitializer.ts +7 -3
- package/src/schema/types.ts +126 -148
package/graphql.codegen.yml
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/engine-system-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0-alpha.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -9,28 +9,28 @@
|
|
|
9
9
|
"test": "vitest"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@contember/authorization": "^1.
|
|
13
|
-
"@contember/database": "^1.
|
|
14
|
-
"@contember/database-migrations": "^1.
|
|
15
|
-
"@contember/dic": "^1.
|
|
16
|
-
"@contember/engine-common": "^1.
|
|
17
|
-
"@contember/graphql-utils": "^1.
|
|
18
|
-
"@contember/queryable": "^1.
|
|
19
|
-
"@contember/schema": "^1.
|
|
20
|
-
"@contember/schema-migrations": "^1.
|
|
21
|
-
"@contember/schema-utils": "^1.
|
|
22
|
-
"@graphql-tools/utils": "^
|
|
12
|
+
"@contember/authorization": "^1.2.0-alpha.3",
|
|
13
|
+
"@contember/database": "^1.2.0-alpha.3",
|
|
14
|
+
"@contember/database-migrations": "^1.2.0-alpha.3",
|
|
15
|
+
"@contember/dic": "^1.2.0-alpha.3",
|
|
16
|
+
"@contember/engine-common": "^1.2.0-alpha.3",
|
|
17
|
+
"@contember/graphql-utils": "^1.2.0-alpha.3",
|
|
18
|
+
"@contember/queryable": "^1.2.0-alpha.3",
|
|
19
|
+
"@contember/schema": "^1.2.0-alpha.3",
|
|
20
|
+
"@contember/schema-migrations": "^1.2.0-alpha.3",
|
|
21
|
+
"@contember/schema-utils": "^1.2.0-alpha.3",
|
|
22
|
+
"@graphql-tools/utils": "^8.6.13",
|
|
23
23
|
"graphql-tag": "^2.12.5"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@contember/engine-api-tester": "^1.
|
|
27
|
-
"@contember/schema-definition": "^1.
|
|
28
|
-
"@graphql-codegen/cli": "^
|
|
29
|
-
"@graphql-codegen/typescript": "^
|
|
30
|
-
"@graphql-codegen/typescript-operations": "^
|
|
31
|
-
"@graphql-codegen/typescript-resolvers": "^
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"graphql": "^
|
|
26
|
+
"@contember/engine-api-tester": "^1.2.0-alpha.3",
|
|
27
|
+
"@contember/schema-definition": "^1.2.0-alpha.3",
|
|
28
|
+
"@graphql-codegen/cli": "^2.6.2",
|
|
29
|
+
"@graphql-codegen/typescript": "^2.5.1",
|
|
30
|
+
"@graphql-codegen/typescript-operations": "^2.4.2",
|
|
31
|
+
"@graphql-codegen/typescript-resolvers": "^2.6.6",
|
|
32
|
+
"@types/node": "^16",
|
|
33
|
+
"graphql": "^16.5.0",
|
|
34
34
|
"pg": "^8.5.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -3,21 +3,22 @@ export { SchemaMigrator, MigrationsResolver } from '@contember/schema-migrations
|
|
|
3
3
|
export { typeDefs, devTypeDefs, Schema } from './schema'
|
|
4
4
|
|
|
5
5
|
export {
|
|
6
|
-
Identity,
|
|
7
6
|
DatabaseContext,
|
|
8
|
-
|
|
9
|
-
StageBySlugQuery,
|
|
10
|
-
unnamedIdentity,
|
|
11
|
-
SchemaVersionBuilder,
|
|
7
|
+
DatabaseContextFactory,
|
|
12
8
|
formatSchemaName,
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
getJunctionTables,
|
|
10
|
+
Identity,
|
|
15
11
|
LatestTransactionIdByStageQuery,
|
|
16
|
-
|
|
12
|
+
ProjectInitializer,
|
|
17
13
|
ProjectMigrator,
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
SchemaVersionBuilder,
|
|
15
|
+
setupSystemVariables,
|
|
20
16
|
Stage,
|
|
17
|
+
StageBySlugQuery,
|
|
18
|
+
StageCreator,
|
|
19
|
+
StagesQuery,
|
|
20
|
+
unnamedIdentity,
|
|
21
|
+
VersionedSchema,
|
|
21
22
|
} from './model'
|
|
22
23
|
export * from './SystemContainer'
|
|
23
24
|
export * from './resolvers'
|
|
@@ -6,7 +6,7 @@ import { SystemDbMigrationsRunnerFactory } from '../SystemContainer'
|
|
|
6
6
|
import {
|
|
7
7
|
Connection,
|
|
8
8
|
createDatabaseIfNotExists,
|
|
9
|
-
|
|
9
|
+
DatabaseConfig,
|
|
10
10
|
retryTransaction,
|
|
11
11
|
SingleConnection,
|
|
12
12
|
} from '@contember/database'
|
|
@@ -24,7 +24,7 @@ export class ProjectInitializer {
|
|
|
24
24
|
|
|
25
25
|
public async initialize(
|
|
26
26
|
databaseContextFactory: DatabaseContextFactory,
|
|
27
|
-
project: ProjectConfig & { db?:
|
|
27
|
+
project: ProjectConfig & { db?: DatabaseConfig },
|
|
28
28
|
logger: Logger,
|
|
29
29
|
migrations?: Migration[],
|
|
30
30
|
) {
|
|
@@ -50,11 +50,15 @@ export class ProjectInitializer {
|
|
|
50
50
|
await singleConnection.end()
|
|
51
51
|
logger.groupEnd()
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
const result = await retryTransaction(() =>
|
|
54
54
|
dbContext.transaction(async trx => {
|
|
55
55
|
await this.initStages(trx, project, logger, migrations)
|
|
56
56
|
}),
|
|
57
57
|
)
|
|
58
|
+
if (dbContext.client.connection instanceof Connection) {
|
|
59
|
+
await dbContext.client.connection.clearPool()
|
|
60
|
+
}
|
|
61
|
+
return result
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
private async initStages(
|