@contember/cli 0.12.0-beta.0 → 1.0.0-alpha.1
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/Dockerfile +2 -1
- package/dist/src/commands/deploy/DeployCommand.js +7 -7
- package/dist/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.js +10 -10
- package/dist/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationCreateCommand.js +2 -2
- package/dist/src/commands/migrations/MigrationCreateCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.js +2 -2
- package/dist/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationDiffCommand.js +9 -9
- package/dist/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.js +9 -9
- package/dist/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteHelper.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteHelper.js +6 -10
- package/dist/src/commands/migrations/MigrationExecuteHelper.js.map +1 -1
- package/dist/src/commands/migrations/MigrationRebaseCommand.js +4 -4
- package/dist/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.js +6 -6
- package/dist/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationValidationHelper.js +1 -1
- package/dist/src/commands/migrations/MigrationValidationHelper.js.map +1 -1
- package/dist/src/commands/migrations/SystemApiClientResolver.js +2 -2
- package/dist/src/commands/migrations/SystemApiClientResolver.js.map +1 -1
- package/dist/src/commands/misc/VersionCommand.js +1 -1
- package/dist/src/commands/misc/VersionCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectCreateCommand.js +1 -1
- package/dist/src/commands/project/ProjectCreateCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js +4 -4
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectValidateCommand.js +4 -4
- package/dist/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/src/commands/tenant/CreateApiKeyCommand.js +3 -3
- package/dist/src/commands/tenant/CreateApiKeyCommand.js.map +1 -1
- package/dist/src/commands/tenant/InviteCommand.js +3 -3
- package/dist/src/commands/tenant/InviteCommand.js.map +1 -1
- package/dist/src/commands/tenant/ResetPasswordCommand.js +3 -3
- package/dist/src/commands/tenant/ResetPasswordCommand.js.map +1 -1
- package/dist/src/commands/tenant/SignInCommand.js +3 -3
- package/dist/src/commands/tenant/SignInCommand.js.map +1 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js +3 -3
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/src/run.js +2 -2
- package/dist/src/run.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/src/utils/admin.d.ts.map +1 -1
- package/dist/src/utils/admin.js +5 -5
- package/dist/src/utils/admin.js.map +1 -1
- package/dist/src/utils/commands.js +1 -1
- package/dist/src/utils/commands.js.map +1 -1
- package/dist/src/utils/dockerCompose.js +4 -4
- package/dist/src/utils/dockerCompose.js.map +1 -1
- package/dist/src/utils/instance/interactiveUtils.js +2 -2
- package/dist/src/utils/instance/interactiveUtils.js.map +1 -1
- package/dist/src/utils/migrations.js +6 -6
- package/dist/src/utils/migrations.js.map +1 -1
- package/dist/src/utils/npm.js +6 -6
- package/dist/src/utils/npm.js.map +1 -1
- package/dist/src/utils/schema.js +1 -1
- package/dist/src/utils/schema.js.map +1 -1
- package/dist/src/utils/system/index.d.ts +1 -1
- package/dist/src/utils/system/index.d.ts.map +1 -1
- package/dist/src/utils/system/index.js +5 -2
- package/dist/src/utils/system/index.js.map +1 -1
- package/dist/src/utils/tenant.js +21 -21
- package/dist/src/utils/tenant.js.map +1 -1
- package/dist/src/utils/workspace.js +3 -3
- package/dist/src/utils/workspace.js.map +1 -1
- package/dist/src/utils/yaml.js +3 -3
- package/dist/src/utils/yaml.js.map +1 -1
- package/package.json +10 -10
- package/src/commands/migrations/MigrationExecuteHelper.ts +3 -7
- package/src/utils/admin.ts +2 -1
- package/src/utils/system/index.ts +5 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contember": "./dist/src/run.js"
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
"@types/fs-extra": "^9.0.3"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@contember/cli-common": "^0.
|
|
18
|
-
"@contember/config-loader": "^0.
|
|
19
|
-
"@contember/database-migrations": "^0.
|
|
20
|
-
"@contember/dic": "^0.
|
|
21
|
-
"@contember/engine-content-api": "^0.
|
|
22
|
-
"@contember/schema": "^0.
|
|
23
|
-
"@contember/schema-definition": "^0.
|
|
24
|
-
"@contember/schema-migrations": "^0.
|
|
25
|
-
"@contember/schema-utils": "^0.
|
|
17
|
+
"@contember/cli-common": "^1.0.0-alpha.1",
|
|
18
|
+
"@contember/config-loader": "^1.0.0-alpha.1",
|
|
19
|
+
"@contember/database-migrations": "^1.0.0-alpha.1",
|
|
20
|
+
"@contember/dic": "^1.0.0-alpha.1",
|
|
21
|
+
"@contember/engine-content-api": "^1.0.0-alpha.1",
|
|
22
|
+
"@contember/schema": "^1.0.0-alpha.1",
|
|
23
|
+
"@contember/schema-definition": "^1.0.0-alpha.1",
|
|
24
|
+
"@contember/schema-migrations": "^1.0.0-alpha.1",
|
|
25
|
+
"@contember/schema-utils": "^1.0.0-alpha.1",
|
|
26
26
|
"@graphql-tools/merge": "^6.2.14",
|
|
27
27
|
"chalk": "^4.1.0",
|
|
28
28
|
"chalk-table": "^1.0.2",
|
|
@@ -82,14 +82,10 @@ export const executeMigrations = async ({
|
|
|
82
82
|
} while (true)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
await client.migrate(
|
|
86
86
|
migrations.map(it => it.localMigration),
|
|
87
87
|
force,
|
|
88
88
|
)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return 0
|
|
92
|
-
}
|
|
93
|
-
console.error(result.errors)
|
|
94
|
-
return 1
|
|
89
|
+
console.log('Migration executed')
|
|
90
|
+
return 0
|
|
95
91
|
}
|
package/src/utils/admin.ts
CHANGED
|
@@ -10,8 +10,9 @@ export class AdminClient {
|
|
|
10
10
|
|
|
11
11
|
public async deploy(project: string, files: AdminFiles): Promise<void> {
|
|
12
12
|
const response = await this.execute('_deploy', 'POST', { project, files })
|
|
13
|
+
|
|
13
14
|
if (!response.ok) {
|
|
14
|
-
throw
|
|
15
|
+
throw `Failed to deploy admin, POST request to ${this.url}/_deploy returned status ${response.status} ${response.statusText}`
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
|
|
@@ -40,7 +40,7 @@ export class SystemClient {
|
|
|
40
40
|
return new SystemClient(graphqlClient)
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
public async migrate(migrations: Migration[], force = false): Promise<
|
|
43
|
+
public async migrate(migrations: Migration[], force = false): Promise<void> {
|
|
44
44
|
const query = `
|
|
45
45
|
mutation($migrations: [Migration!]!) {
|
|
46
46
|
migrate: ${force ? 'forceMigrate' : 'migrate'}(migrations: $migrations) {
|
|
@@ -53,13 +53,16 @@ mutation($migrations: [Migration!]!) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
`
|
|
56
|
-
|
|
56
|
+
const result = (
|
|
57
57
|
await this.apiClient.request<{
|
|
58
58
|
migrate: { ok: boolean; errors: { code: MigrateErrorCode; migration: string; message: string }[] }
|
|
59
59
|
}>(query, {
|
|
60
60
|
migrations,
|
|
61
61
|
})
|
|
62
62
|
).migrate
|
|
63
|
+
if (!result.ok) {
|
|
64
|
+
throw result.errors
|
|
65
|
+
}
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
public async migrationDelete(version: string): Promise<void> {
|