@contember/cli 2.0.0-alpha.15 → 2.0.0-alpha.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/cli",
3
- "version": "2.0.0-alpha.15",
3
+ "version": "2.0.0-alpha.16",
4
4
  "license": "Apache-2.0",
5
5
  "bin": {
6
6
  "contember": "./dist/production/run.js"
@@ -11,39 +11,39 @@
11
11
  "devDependencies": {
12
12
  "@types/fs-extra": "^11.0.4",
13
13
  "@types/js-yaml": "^4.0.9",
14
- "@types/node": "^20.9.0",
15
- "@types/prompts": "^2.4.8",
16
- "@types/semver": "^7.5.5",
17
- "autoprefixer": "^10.4.16",
18
- "postcss": "^8.4.31",
19
- "tailwindcss": "^3.3.5"
14
+ "@types/node": "^20.16.5",
15
+ "@types/prompts": "^2.4.9",
16
+ "@types/semver": "^7.5.8",
17
+ "autoprefixer": "^10.4.20",
18
+ "postcss": "^8.4.45",
19
+ "tailwindcss": "^3.4.10"
20
20
  },
21
21
  "dependencies": {
22
- "@contember/cli-common": "2.0.0-alpha.15",
23
- "@contember/config-loader": "2.0.0-alpha.15",
24
- "@contember/database": "2.0.0-alpha.15",
25
- "@contember/dic": "2.0.0-alpha.15",
26
- "@contember/engine-common": "2.0.0-alpha.15",
27
- "@contember/engine-content-api": "2.0.0-alpha.15",
28
- "@contember/migrations-client": "2.0.0-alpha.15",
29
- "@contember/schema": "2.0.0-alpha.15",
30
- "@contember/schema-migrations": "2.0.0-alpha.15",
31
- "@contember/schema-utils": "2.0.0-alpha.15",
32
- "@contember/typesafe": "2.0.0-alpha.15",
33
- "@graphql-tools/schema": "^10.0.0",
34
- "chalk": "^4.1.2",
22
+ "@contember/cli-common": "2.0.0-alpha.16",
23
+ "@contember/config-loader": "2.0.0-alpha.16",
24
+ "@contember/database": "2.0.0-alpha.16",
25
+ "@contember/dic": "2.0.0-alpha.16",
26
+ "@contember/engine-common": "2.0.0-alpha.16",
27
+ "@contember/engine-content-api": "2.0.0-alpha.16",
28
+ "@contember/graphql-client": "2.0.0-alpha.16",
29
+ "@contember/migrations-client": "2.0.0-alpha.16",
30
+ "@contember/schema": "2.0.0-alpha.16",
31
+ "@contember/schema-migrations": "2.0.0-alpha.16",
32
+ "@contember/schema-utils": "2.0.0-alpha.16",
33
+ "@contember/typesafe": "2.0.0-alpha.16",
34
+ "@graphql-tools/schema": "^10.0.6",
35
+ "chalk": "^5.3.0",
35
36
  "chalk-table": "^1.0.2",
36
- "esbuild": "^0.18.20",
37
+ "esbuild": "^0.21.5",
37
38
  "fast-glob": "^3.3.2",
38
- "graphql": "^16.8.1",
39
- "graphql-request": "^6.1.0",
39
+ "graphql": "^16.9.0",
40
40
  "js-yaml": "^4.1.0",
41
41
  "lodash-es": "^4.17.21",
42
- "pg": "^8.11.3",
43
- "preact": "^10.19.2",
44
- "preact-render-to-string": "^6.3.1",
42
+ "pg": "^8.12.0",
43
+ "preact": "^10.23.2",
44
+ "preact-render-to-string": "^6.5.10",
45
45
  "prompts": "^2.4.2",
46
- "semver": "^7.5.4",
47
- "yawn-yaml": "^2.2.0"
46
+ "semver": "^7.6.3",
47
+ "yawn-yaml": "^2.3.0"
48
48
  }
49
49
  }
@@ -1,4 +1,4 @@
1
- import { GraphQLClient } from 'graphql-request'
1
+ import { GraphQlClient } from '@contember/graphql-client'
2
2
 
3
3
  export const createTenantApiUrl = (url: string) => {
4
4
  if (url.endsWith('/')) {
@@ -12,14 +12,10 @@ export const createTenantApiUrl = (url: string) => {
12
12
 
13
13
 
14
14
  export class TenantClient {
15
- constructor(private readonly apiClient: GraphQLClient) {}
15
+ constructor(private readonly apiClient: GraphQlClient) {}
16
16
 
17
17
  public static create(url: string, apiToken: string): TenantClient {
18
- const graphqlClient = new GraphQLClient(createTenantApiUrl(url), {
19
- headers: {
20
- Authorization: `Bearer ${apiToken}`,
21
- },
22
- })
18
+ const graphqlClient = new GraphQlClient(createTenantApiUrl(url), apiToken)
23
19
  return new TenantClient(graphqlClient)
24
20
  }
25
21
 
@@ -32,9 +28,9 @@ export class TenantClient {
32
28
  }
33
29
  }
34
30
  }`
35
- const result = await this.apiClient.request<{
31
+ const result = await this.apiClient.execute<{
36
32
  createProject: { ok: boolean; error: { code: string } }
37
- }>(query, { slug })
33
+ }>(query, { variables: { slug } })
38
34
  if (!result.createProject.ok) {
39
35
  if (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {
40
36
  return
package/src/tsconfig.json CHANGED
@@ -12,6 +12,7 @@
12
12
  { "path": "../../config-loader/src" },
13
13
  { "path": "../../database/src" },
14
14
  { "path": "../../dic/src" },
15
+ { "path": "../../graphql-client/src" },
15
16
  { "path": "../../engine-content-api/src" },
16
17
  { "path": "../../engine-common/src" },
17
18
  { "path": "../../schema/src" },