@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.
Files changed (74) hide show
  1. package/Dockerfile +2 -1
  2. package/dist/src/commands/deploy/DeployCommand.js +7 -7
  3. package/dist/src/commands/deploy/DeployCommand.js.map +1 -1
  4. package/dist/src/commands/migrations/MigrationAmendCommand.js +10 -10
  5. package/dist/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  6. package/dist/src/commands/migrations/MigrationCreateCommand.js +2 -2
  7. package/dist/src/commands/migrations/MigrationCreateCommand.js.map +1 -1
  8. package/dist/src/commands/migrations/MigrationDescribeCommand.js +2 -2
  9. package/dist/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  10. package/dist/src/commands/migrations/MigrationDiffCommand.js +9 -9
  11. package/dist/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
  12. package/dist/src/commands/migrations/MigrationExecuteCommand.js +9 -9
  13. package/dist/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  14. package/dist/src/commands/migrations/MigrationExecuteHelper.d.ts.map +1 -1
  15. package/dist/src/commands/migrations/MigrationExecuteHelper.js +6 -10
  16. package/dist/src/commands/migrations/MigrationExecuteHelper.js.map +1 -1
  17. package/dist/src/commands/migrations/MigrationRebaseCommand.js +4 -4
  18. package/dist/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
  19. package/dist/src/commands/migrations/MigrationStatusCommand.js +6 -6
  20. package/dist/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
  21. package/dist/src/commands/migrations/MigrationValidationHelper.js +1 -1
  22. package/dist/src/commands/migrations/MigrationValidationHelper.js.map +1 -1
  23. package/dist/src/commands/migrations/SystemApiClientResolver.js +2 -2
  24. package/dist/src/commands/migrations/SystemApiClientResolver.js.map +1 -1
  25. package/dist/src/commands/misc/VersionCommand.js +1 -1
  26. package/dist/src/commands/misc/VersionCommand.js.map +1 -1
  27. package/dist/src/commands/project/ProjectCreateCommand.js +1 -1
  28. package/dist/src/commands/project/ProjectCreateCommand.js.map +1 -1
  29. package/dist/src/commands/project/ProjectPrintSchemaCommand.js +4 -4
  30. package/dist/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  31. package/dist/src/commands/project/ProjectValidateCommand.js +4 -4
  32. package/dist/src/commands/project/ProjectValidateCommand.js.map +1 -1
  33. package/dist/src/commands/tenant/CreateApiKeyCommand.js +3 -3
  34. package/dist/src/commands/tenant/CreateApiKeyCommand.js.map +1 -1
  35. package/dist/src/commands/tenant/InviteCommand.js +3 -3
  36. package/dist/src/commands/tenant/InviteCommand.js.map +1 -1
  37. package/dist/src/commands/tenant/ResetPasswordCommand.js +3 -3
  38. package/dist/src/commands/tenant/ResetPasswordCommand.js.map +1 -1
  39. package/dist/src/commands/tenant/SignInCommand.js +3 -3
  40. package/dist/src/commands/tenant/SignInCommand.js.map +1 -1
  41. package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js +3 -3
  42. package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  43. package/dist/src/run.js +2 -2
  44. package/dist/src/run.js.map +1 -1
  45. package/dist/src/tsconfig.tsbuildinfo +1 -1
  46. package/dist/src/utils/admin.d.ts.map +1 -1
  47. package/dist/src/utils/admin.js +5 -5
  48. package/dist/src/utils/admin.js.map +1 -1
  49. package/dist/src/utils/commands.js +1 -1
  50. package/dist/src/utils/commands.js.map +1 -1
  51. package/dist/src/utils/dockerCompose.js +4 -4
  52. package/dist/src/utils/dockerCompose.js.map +1 -1
  53. package/dist/src/utils/instance/interactiveUtils.js +2 -2
  54. package/dist/src/utils/instance/interactiveUtils.js.map +1 -1
  55. package/dist/src/utils/migrations.js +6 -6
  56. package/dist/src/utils/migrations.js.map +1 -1
  57. package/dist/src/utils/npm.js +6 -6
  58. package/dist/src/utils/npm.js.map +1 -1
  59. package/dist/src/utils/schema.js +1 -1
  60. package/dist/src/utils/schema.js.map +1 -1
  61. package/dist/src/utils/system/index.d.ts +1 -1
  62. package/dist/src/utils/system/index.d.ts.map +1 -1
  63. package/dist/src/utils/system/index.js +5 -2
  64. package/dist/src/utils/system/index.js.map +1 -1
  65. package/dist/src/utils/tenant.js +21 -21
  66. package/dist/src/utils/tenant.js.map +1 -1
  67. package/dist/src/utils/workspace.js +3 -3
  68. package/dist/src/utils/workspace.js.map +1 -1
  69. package/dist/src/utils/yaml.js +3 -3
  70. package/dist/src/utils/yaml.js.map +1 -1
  71. package/package.json +10 -10
  72. package/src/commands/migrations/MigrationExecuteHelper.ts +3 -7
  73. package/src/utils/admin.ts +2 -1
  74. 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.12.0-beta.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.12.0-beta.0",
18
- "@contember/config-loader": "^0.12.0-beta.0",
19
- "@contember/database-migrations": "^0.12.0-beta.0",
20
- "@contember/dic": "^0.12.0-beta.0",
21
- "@contember/engine-content-api": "^0.12.0-beta.0",
22
- "@contember/schema": "^0.12.0-beta.0",
23
- "@contember/schema-definition": "^0.12.0-beta.0",
24
- "@contember/schema-migrations": "^0.12.0-beta.0",
25
- "@contember/schema-utils": "^0.12.0-beta.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
- const result = await client.migrate(
85
+ await client.migrate(
86
86
  migrations.map(it => it.localMigration),
87
87
  force,
88
88
  )
89
- if (result.ok) {
90
- console.log('Migration executed')
91
- return 0
92
- }
93
- console.error(result.errors)
94
- return 1
89
+ console.log('Migration executed')
90
+ return 0
95
91
  }
@@ -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 'Failed to deploy admin'
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<MigrateResponse> {
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
- return (
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> {