@contember/engine-content-api 2.0.0-beta.4 → 2.0.0-beta.6

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 (22) hide show
  1. package/dist/development/src/mapper/delete/DeleteExecutor.cjs +1 -1
  2. package/dist/development/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  3. package/dist/development/src/mapper/delete/DeleteExecutor.js +1 -1
  4. package/dist/development/src/mapper/delete/DeleteExecutor.js.map +1 -1
  5. package/dist/production/src/mapper/delete/DeleteExecutor.cjs +1 -1
  6. package/dist/production/src/mapper/delete/DeleteExecutor.cjs.map +1 -1
  7. package/dist/production/src/mapper/delete/DeleteExecutor.js +1 -1
  8. package/dist/production/src/mapper/delete/DeleteExecutor.js.map +1 -1
  9. package/dist/tests/tsconfig.tsbuildinfo +1 -1
  10. package/dist/types/tsconfig.tsbuildinfo +1 -1
  11. package/package.json +10 -10
  12. package/src/mapper/delete/DeleteExecutor.ts +1 -1
  13. package/tests/cases/integration/graphQlRequests/delete/cascadeDelete.test.ts +3 -3
  14. package/tests/cases/integration/graphQlRequests/delete/orphanRemoval.test.ts +1 -1
  15. package/tests/cases/integration/graphQlRequests/delete/restrictOnDelete.test.ts +2 -2
  16. package/tests/cases/integration/graphQlRequests/delete/setNullOnDelete.test.ts +2 -2
  17. package/tests/cases/integration/graphQlRequests/update/manyHasOne/delete.test.ts +3 -3
  18. package/tests/cases/integration/graphQlRequests/update/oneHasOneInverse/connect.test.ts +1 -1
  19. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/connect.test.ts +1 -1
  20. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/create.test.ts +1 -1
  21. package/tests/cases/integration/graphQlRequests/update/oneHasOneOwning/delete.test.ts +2 -2
  22. package/tests/cases/integration/graphQlSchema/graphQlSchemaBuilder.test.ts +1 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/engine-content-api",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.6",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/production/index.js",
6
6
  "typings": "./dist/types/index.d.ts",
@@ -26,18 +26,18 @@
26
26
  "generate": "gql-gen --config graphql.codegen.yml"
27
27
  },
28
28
  "dependencies": {
29
- "@contember/database": "2.0.0-beta.4",
30
- "@contember/dic": "2.0.0-beta.4",
31
- "@contember/graphql-utils": "2.0.0-beta.4",
32
- "@contember/logger": "2.0.0-beta.4",
33
- "@contember/schema": "2.0.0-beta.4",
34
- "@contember/schema-definition": "2.0.0-beta.4",
35
- "@contember/schema-utils": "2.0.0-beta.4",
29
+ "@contember/database": "2.0.0-beta.6",
30
+ "@contember/dic": "2.0.0-beta.6",
31
+ "@contember/graphql-utils": "2.0.0-beta.6",
32
+ "@contember/logger": "2.0.0-beta.6",
33
+ "@contember/schema": "2.0.0-beta.6",
34
+ "@contember/schema-definition": "2.0.0-beta.6",
35
+ "@contember/schema-utils": "2.0.0-beta.6",
36
36
  "fast-deep-equal": "^3.1.3"
37
37
  },
38
38
  "devDependencies": {
39
- "@contember/database-tester": "2.0.0-beta.4",
40
- "@contember/schema-definition": "2.0.0-beta.4",
39
+ "@contember/database-tester": "2.0.0-beta.6",
40
+ "@contember/schema-definition": "2.0.0-beta.6",
41
41
  "@types/node": "^20.16.11",
42
42
  "graphql": "^16.9.0",
43
43
  "pg": "^8.12.0"
@@ -299,7 +299,7 @@ export class DeleteExecutor {
299
299
  .from(entity.tableName, 'root_')
300
300
  .select(['root_', entity.primaryColumn], 'id')
301
301
  .select(['root_', relation.joiningColumn.columnName], 'ref')
302
- .where(expr => expr.in(relation.joiningColumn.columnName, values))
302
+ .where(expr => expr.in(['root_', relation.joiningColumn.columnName], values))
303
303
  }
304
304
 
305
305
  private filterPlannedForDelete<R extends {id: Input.PrimaryValue}>(state: DeleteState, entity: Model.Entity, values: R[]): R[] {
@@ -35,12 +35,12 @@ test('delete author with posts and locales cascade delete', async () => {
35
35
  response: { rows: [{ id: testUuid(1), allowed: true }] },
36
36
  },
37
37
  {
38
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
38
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
39
39
  parameters: [testUuid(1)],
40
40
  response: { rows: [{ id: testUuid(2), allowed: true }] },
41
41
  },
42
42
  {
43
- sql: SQL`select "root_"."id" as "id", "root_"."post_id" as "ref", true as "allowed" from "public"."post_locales" as "root_" where "post_id" in (?)`,
43
+ sql: SQL`select "root_"."id" as "id", "root_"."post_id" as "ref", true as "allowed" from "public"."post_locales" as "root_" where "root_"."post_id" in (?)`,
44
44
  parameters: [testUuid(2)],
45
45
  response: { rows: [{ id: testUuid(3), allowed: true }] },
46
46
  },
@@ -90,7 +90,7 @@ test('delete author with posts (denied) ', async () => {
90
90
  response: { rows: [{ id: testUuid(1), allowed: true }] },
91
91
  },
92
92
  {
93
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
93
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
94
94
  parameters: [testUuid(1)],
95
95
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: false }] },
96
96
  },
@@ -53,7 +53,7 @@ test('delete post and orphaned content', async () => {
53
53
  },
54
54
  },
55
55
  {
56
- sql: SQL`select "root_"."id" as "id", "root_"."content_id" as "ref" from "public"."post" as "root_" where "content_id" in (?)`,
56
+ sql: SQL`select "root_"."id" as "id", "root_"."content_id" as "ref" from "public"."post" as "root_" where "root_"."content_id" in (?)`,
57
57
  parameters: [testUuid(2)],
58
58
  response: {
59
59
  rows: [{ id: testUuid(1), ref: testUuid(2) }],
@@ -32,7 +32,7 @@ test('delete author and with restrict on posts', async () => {
32
32
  response: { rows: [{ id: testUuid(1), allowed: true }] },
33
33
  },
34
34
  {
35
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref" from "public"."post" as "root_" where "author_id" in (?)`,
35
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
36
36
  parameters: [testUuid(1)],
37
37
  response: { rows: [] },
38
38
  },
@@ -82,7 +82,7 @@ test('delete author with restrict on posts - declined', async () => {
82
82
  response: { rows: [{ id: testUuid(1), allowed: true }] },
83
83
  },
84
84
  {
85
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref" from "public"."post" as "root_" where "author_id" in (?)`,
85
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
86
86
  parameters: [testUuid(1)],
87
87
  response: { rows: [{ id: testUuid(2), ref: testUuid(1) }] },
88
88
  },
@@ -47,7 +47,7 @@ test('delete author and set null on posts', async () => {
47
47
  response: { rows: [{ id: testUuid(1), allowed: true }] },
48
48
  },
49
49
  {
50
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
50
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
51
51
  parameters: [testUuid(1)],
52
52
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: true }] },
53
53
  },
@@ -99,7 +99,7 @@ test('delete author and set null on posts - declined', async () => {
99
99
  response: { rows: [{ id: testUuid(1), allowed: true }] },
100
100
  },
101
101
  {
102
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
102
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
103
103
  parameters: [testUuid(1)],
104
104
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: false }] },
105
105
  },
@@ -42,7 +42,7 @@ test('delete', async () => {
42
42
  response: { rows: [{ id: testUuid(1), allowed: true }] },
43
43
  },
44
44
  {
45
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
45
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
46
46
  parameters: [testUuid(1)],
47
47
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: true }] },
48
48
  },
@@ -101,7 +101,7 @@ test('delete with cascade', async () => {
101
101
  response: { rows: [{ id: testUuid(1), allowed: true }] },
102
102
  },
103
103
  {
104
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
104
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
105
105
  parameters: [testUuid(1)],
106
106
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: true }] },
107
107
  },
@@ -160,7 +160,7 @@ test('delete with cascade - denied', async () => {
160
160
  response: { rows: [{ id: testUuid(1), allowed: true }] },
161
161
  },
162
162
  {
163
- sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "author_id" in (?)`,
163
+ sql: SQL`select "root_"."id" as "id", "root_"."author_id" as "ref", true as "allowed" from "public"."post" as "root_" where "root_"."author_id" in (?)`,
164
164
  parameters: [testUuid(1)],
165
165
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: false }] },
166
166
  },
@@ -228,7 +228,7 @@ test('connect - different owner & orphan removal enabled', async () => {
228
228
  response: { rows: [{ id: testUuid(4), allowed: true }] },
229
229
  },
230
230
  {
231
- sql: 'select "root_"."id" as "id", "root_"."setting_id" as "ref" from "public"."site" as "root_" where "setting_id" in (?)',
231
+ sql: 'select "root_"."id" as "id", "root_"."setting_id" as "ref" from "public"."site" as "root_" where "root_"."setting_id" in (?)',
232
232
  parameters: [testUuid(4)],
233
233
  response: { rows: [] },
234
234
  },
@@ -211,7 +211,7 @@ test('connect - orphan removal', async () => {
211
211
  response: { rows: [{ id: settingId2, allowed: true }] },
212
212
  },
213
213
  {
214
- sql: 'select "root_"."id" as "id", "root_"."setting_id" as "ref" from "public"."site" as "root_" where "setting_id" in (?)',
214
+ sql: 'select "root_"."id" as "id", "root_"."setting_id" as "ref" from "public"."site" as "root_" where "root_"."setting_id" in (?)',
215
215
  parameters: [settingId2],
216
216
  response: { rows: [] },
217
217
  },
@@ -113,7 +113,7 @@ test('create - orphan removal', async () => {
113
113
  response: { rows: [{ id: currentSettingId, allowed: true }] },
114
114
  },
115
115
  {
116
- sql: 'select "root_"."id" as "id", "root_"."setting_id" as "ref" from "public"."site" as "root_" where "setting_id" in (?)',
116
+ sql: 'select "root_"."id" as "id", "root_"."setting_id" as "ref" from "public"."site" as "root_" where "root_"."setting_id" in (?)',
117
117
  parameters: [currentSettingId],
118
118
  response: { rows: [] },
119
119
  },
@@ -37,7 +37,7 @@ test('delete', async () => {
37
37
  response: { rows: [{ id: testUuid(1), allowed: true }] },
38
38
  },
39
39
  {
40
- sql: SQL`select "root_"."id" as "id", "root_"."setting_id" as "ref", true as "allowed" from "public"."site" as "root_" where "setting_id" in (?)`,
40
+ sql: SQL`select "root_"."id" as "id", "root_"."setting_id" as "ref", true as "allowed" from "public"."site" as "root_" where "root_"."setting_id" in (?)`,
41
41
  parameters: [testUuid(1)],
42
42
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: true }] },
43
43
  },
@@ -93,7 +93,7 @@ test('delete denied', async () => {
93
93
  response: { rows: [{ id: testUuid(1), allowed: true }] },
94
94
  },
95
95
  {
96
- sql: SQL`select "root_"."id" as "id", "root_"."setting_id" as "ref", true as "allowed" from "public"."site" as "root_" where "setting_id" in (?)`,
96
+ sql: SQL`select "root_"."id" as "id", "root_"."setting_id" as "ref", true as "allowed" from "public"."site" as "root_" where "root_"."setting_id" in (?)`,
97
97
  parameters: [testUuid(1)],
98
98
  response: { rows: [{ id: testUuid(2), ref: testUuid(1), allowed: false }] },
99
99
  },
@@ -390,9 +390,8 @@ describe('GraphQL schema builder', () => {
390
390
  })
391
391
  })
392
392
 
393
- it.only('no root ops', async () => {
393
+ it('no root ops', async () => {
394
394
  const schema = createSchema(NoRootOperation)
395
- console.log(schema.acl.roles.editor.entities.Image)
396
395
 
397
396
  await testSchema({
398
397
  schema: () => schema.model,