@contember/cli 2.1.0-alpha.1 → 2.1.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/development/src/commands/deploy/DeployCommand.cjs +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs +5 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js +5 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs +2 -2
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js +2 -2
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs +5 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js +5 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs +2 -2
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js +2 -2
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/types/commands/deploy/DeployCommand.d.ts +1 -1
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/utils.d.ts.map +1 -1
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
- package/dist/types/lib/dsn.d.ts.map +1 -1
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
- package/dist/types/lib/fs/FileSystem.d.ts.map +1 -1
- package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -1
- package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -1
- package/dist/types/lib/maskToken.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +2 -1
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationsValidator.d.ts.map +1 -1
- package/dist/types/lib/migrations/migrations.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityLink.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldLink.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldPermissions.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/FieldType.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/ProjectInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/SinglePermission.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/utils.d.ts.map +1 -1
- package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaValidationHelper.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaValidationPrinter.d.ts.map +1 -1
- package/dist/types/lib/schema/collectReferences.d.ts.map +1 -1
- package/dist/types/lib/stream.d.ts +1 -1
- package/dist/types/lib/stream.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/dist/types/lib/transfer/stdio.d.ts.map +1 -1
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -14
- package/src/commands/deploy/DeployCommand.ts +2 -2
- package/src/commands/migrations/MigrationStatusCommand.ts +1 -1
- package/src/commands/project/ProjectPrintSchemaCommand.ts +5 -1
- package/src/lib/migrations/MigrationsStatusFacade.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli",
|
|
3
|
-
"version": "2.1.0-alpha.
|
|
3
|
+
"version": "2.1.0-alpha.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contember": "./dist/production/run.js"
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/fs-extra": "^11.0.4",
|
|
14
14
|
"@types/js-yaml": "^4.0.9",
|
|
15
|
-
"@types/node": "^20.
|
|
15
|
+
"@types/node": "^20.17.22",
|
|
16
16
|
"@types/prompts": "^2.4.9",
|
|
17
17
|
"@types/semver": "^7.5.8",
|
|
18
18
|
"autoprefixer": "^10.4.20",
|
|
@@ -20,18 +20,18 @@
|
|
|
20
20
|
"tailwindcss": "^3.4.14"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@contember/cli-common": "2.1.0-alpha.
|
|
24
|
-
"@contember/config-loader": "2.1.0-alpha.
|
|
25
|
-
"@contember/database": "2.1.0-alpha.
|
|
26
|
-
"@contember/dic": "2.1.0-alpha.
|
|
27
|
-
"@contember/engine-common": "2.1.0-alpha.
|
|
28
|
-
"@contember/engine-content-api": "2.1.0-alpha.
|
|
29
|
-
"@contember/graphql-client": "2.1.0-alpha.
|
|
30
|
-
"@contember/migrations-client": "2.1.0-alpha.
|
|
31
|
-
"@contember/schema": "2.1.0-alpha.
|
|
32
|
-
"@contember/schema-migrations": "2.1.0-alpha.
|
|
33
|
-
"@contember/schema-utils": "2.1.0-alpha.
|
|
34
|
-
"@contember/typesafe": "2.1.0-alpha.
|
|
23
|
+
"@contember/cli-common": "2.1.0-alpha.3",
|
|
24
|
+
"@contember/config-loader": "2.1.0-alpha.3",
|
|
25
|
+
"@contember/database": "2.1.0-alpha.3",
|
|
26
|
+
"@contember/dic": "2.1.0-alpha.3",
|
|
27
|
+
"@contember/engine-common": "2.1.0-alpha.3",
|
|
28
|
+
"@contember/engine-content-api": "2.1.0-alpha.3",
|
|
29
|
+
"@contember/graphql-client": "2.1.0-alpha.3",
|
|
30
|
+
"@contember/migrations-client": "2.1.0-alpha.3",
|
|
31
|
+
"@contember/schema": "2.1.0-alpha.3",
|
|
32
|
+
"@contember/schema-migrations": "2.1.0-alpha.3",
|
|
33
|
+
"@contember/schema-utils": "2.1.0-alpha.3",
|
|
34
|
+
"@contember/typesafe": "2.1.0-alpha.3",
|
|
35
35
|
"@graphql-tools/schema": "^10.0.7",
|
|
36
36
|
"chalk": "^5.3.0",
|
|
37
37
|
"chalk-table": "^1.0.2",
|
|
@@ -10,7 +10,7 @@ import { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider'
|
|
|
10
10
|
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
11
11
|
|
|
12
12
|
type Args = {
|
|
13
|
-
dsn
|
|
13
|
+
dsn?: string
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
type Options = {
|
|
@@ -35,7 +35,7 @@ export class DeployCommand extends Command<Args, Options> {
|
|
|
35
35
|
|
|
36
36
|
protected configure(configuration: CommandConfiguration<Args, Options>): void {
|
|
37
37
|
configuration.description('Deploy Contember project')
|
|
38
|
-
configuration.argument('dsn')
|
|
38
|
+
configuration.argument('dsn').optional()
|
|
39
39
|
|
|
40
40
|
configuration.option('admin').valueRequired()
|
|
41
41
|
configuration.option('root').valueNone()
|
|
@@ -46,7 +46,7 @@ export class MigrationStatusCommand extends Command<Args, Options> {
|
|
|
46
46
|
const onlyToExecute = input.getOption('only-to-execute')
|
|
47
47
|
const restoreMissing = input.getOption('restore-missing')
|
|
48
48
|
|
|
49
|
-
let status = await this.migrationsStatusFacade.resolveMigrationsStatus({})
|
|
49
|
+
let status = await this.migrationsStatusFacade.resolveMigrationsStatus({ allowError: true })
|
|
50
50
|
|
|
51
51
|
if (restoreMissing) {
|
|
52
52
|
const missing = status.errorMigrations.filter(it => it.state === MigrationState.EXECUTED_MISSING)
|
|
@@ -73,7 +73,11 @@ export class ProjectPrintSchemaCommand extends Command<Args, Options> {
|
|
|
73
73
|
const schemaNormalized = input.getOption('normalize') ? normalizeSchema(filteredSchema) : filteredSchema
|
|
74
74
|
const permissions = permissionFactory.create(schemaNormalized, inputRoles || ['admin'])
|
|
75
75
|
const schemaBuilderFactory = new GraphQlSchemaBuilderFactory()
|
|
76
|
-
const authorizator = new Authorizator(
|
|
76
|
+
const authorizator = new Authorizator(
|
|
77
|
+
permissions,
|
|
78
|
+
schemaNormalized.acl.customPrimary ?? false,
|
|
79
|
+
Object.values(schemaNormalized.acl.roles).some(it => it.content?.refreshMaterializedView),
|
|
80
|
+
)
|
|
77
81
|
const introspection = new IntrospectionSchemaFactory(
|
|
78
82
|
schemaNormalized.model,
|
|
79
83
|
new EntityRulesResolver(schemaNormalized.validation, schemaNormalized.model),
|
|
@@ -11,11 +11,11 @@ export class MigrationsStatusFacade {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
public resolveMigrationsStatus = async ({ force }: { force?: boolean }) => {
|
|
14
|
+
public resolveMigrationsStatus = async ({ force, allowError }: { force?: boolean; allowError?: boolean }) => {
|
|
15
15
|
const executedMigrations = await this.systemClientProvider.get().listExecutedMigrations()
|
|
16
16
|
const localMigrations = await this.migrationsResolver.getMigrationFiles()
|
|
17
17
|
const status = await this.migrationsStatusResolver.getMigrationsStatus(executedMigrations, localMigrations, force)
|
|
18
|
-
if (status.errorMigrations.length > 0) {
|
|
18
|
+
if (status.errorMigrations.length > 0 && !allowError) {
|
|
19
19
|
console.error(createMigrationStatusTable(status.errorMigrations))
|
|
20
20
|
if (!force) {
|
|
21
21
|
throw `Cannot execute migrations`
|